forked from loafle/openapi-generator-original
[Java][okhttp-gson] fix AWS auth issue (#16721)
* fix samples * fix awsauth in okhttp gson java client * update github workflow
This commit is contained in:
parent
7087b332f0
commit
a1d00e4785
@ -56,6 +56,7 @@ jobs:
|
|||||||
- samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml
|
- samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml
|
||||||
- samples/client/petstore/java/apache-httpclient
|
- samples/client/petstore/java/apache-httpclient
|
||||||
- samples/client/petstore/java/feign
|
- samples/client/petstore/java/feign
|
||||||
|
- samples/client/petstore/java/okhttp-gson-awsv4signature
|
||||||
- samples/openapi3/client/petstore/java/jersey2-java8-special-characters
|
- samples/openapi3/client/petstore/java/jersey2-java8-special-characters
|
||||||
- samples/openapi3/client/petstore/java/native
|
- samples/openapi3/client/petstore/java/native
|
||||||
- samples/client/petstore/java/okhttp-gson-swagger1/
|
- samples/client/petstore/java/okhttp-gson-swagger1/
|
||||||
|
@ -6,16 +6,20 @@ import {{invokerPackage}}.Pair;
|
|||||||
import {{invokerPackage}}.ApiException;
|
import {{invokerPackage}}.ApiException;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider;
|
import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider;
|
||||||
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
|
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
|
||||||
import software.amazon.awssdk.auth.credentials.AwsCredentials;
|
import software.amazon.awssdk.auth.credentials.AwsCredentials;
|
||||||
import software.amazon.awssdk.auth.signer.Aws4Signer;
|
import software.amazon.awssdk.auth.signer.Aws4Signer;
|
||||||
import software.amazon.awssdk.auth.signer.params.Aws4SignerParams;
|
import software.amazon.awssdk.auth.signer.params.Aws4SignerParams;
|
||||||
|
import software.amazon.awssdk.http.ContentStreamProvider;
|
||||||
import software.amazon.awssdk.http.SdkHttpFullRequest;
|
import software.amazon.awssdk.http.SdkHttpFullRequest;
|
||||||
import software.amazon.awssdk.http.SdkHttpMethod;
|
import software.amazon.awssdk.http.SdkHttpMethod;
|
||||||
import software.amazon.awssdk.regions.Region;
|
import software.amazon.awssdk.regions.Region;
|
||||||
@ -25,7 +29,7 @@ import okio.Buffer;
|
|||||||
{{>generatedAnnotation}}
|
{{>generatedAnnotation}}
|
||||||
public class AWS4Auth implements Authentication {
|
public class AWS4Auth implements Authentication {
|
||||||
|
|
||||||
private AWSCredentials credentials;
|
private AwsCredentials credentials;
|
||||||
private String region;
|
private String region;
|
||||||
private String service;
|
private String service;
|
||||||
|
|
||||||
|
@ -121,6 +121,9 @@ dependencies {
|
|||||||
{{#openApiNullable}}
|
{{#openApiNullable}}
|
||||||
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
|
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
|
||||||
{{/openApiNullable}}
|
{{/openApiNullable}}
|
||||||
|
{{#withAWSV4Signature}}
|
||||||
|
implementation 'software.amazon.awssdk:auth:2.20.157'
|
||||||
|
{{/withAWSV4Signature}}
|
||||||
{{#hasOAuthMethods}}
|
{{#hasOAuthMethods}}
|
||||||
implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2'
|
implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2'
|
||||||
{{/hasOAuthMethods}}
|
{{/hasOAuthMethods}}
|
||||||
|
@ -19,6 +19,9 @@ lazy val root = (project in file(".")).
|
|||||||
{{#openApiNullable}}
|
{{#openApiNullable}}
|
||||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.6",
|
"org.openapitools" % "jackson-databind-nullable" % "0.2.6",
|
||||||
{{/openApiNullable}}
|
{{/openApiNullable}}
|
||||||
|
{{#withAWSV4Signature}}
|
||||||
|
"software.amazon.awssdk" % "auth" % "2.20.157",
|
||||||
|
{{/withAWSV4Signature}}
|
||||||
{{#hasOAuthMethods}}
|
{{#hasOAuthMethods}}
|
||||||
"org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2",
|
"org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2",
|
||||||
{{/hasOAuthMethods}}
|
{{/hasOAuthMethods}}
|
||||||
|
@ -375,12 +375,11 @@
|
|||||||
<version>${jackson-databind-nullable-version}</version>
|
<version>${jackson-databind-nullable-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
{{/openApiNullable}}
|
{{/openApiNullable}}
|
||||||
|
|
||||||
{{#withAWSV4Signature}}
|
{{#withAWSV4Signature}}
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>software.amazon.awssdk</groupId>
|
<groupId>software.amazon.awssdk</groupId>
|
||||||
<artifactId>auth</artifactId>
|
<artifactId>auth</artifactId>
|
||||||
<version>2.20.120</version>
|
<version>2.20.157</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
{{/withAWSV4Signature}}
|
{{/withAWSV4Signature}}
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -300,7 +300,6 @@
|
|||||||
<artifactId>jackson-databind-nullable</artifactId>
|
<artifactId>jackson-databind-nullable</artifactId>
|
||||||
<version>${jackson-databind-nullable-version}</version>
|
<version>${jackson-databind-nullable-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.ws.rs</groupId>
|
<groupId>javax.ws.rs</groupId>
|
||||||
<artifactId>jsr311-api</artifactId>
|
<artifactId>jsr311-api</artifactId>
|
||||||
|
@ -300,7 +300,6 @@
|
|||||||
<artifactId>jackson-databind-nullable</artifactId>
|
<artifactId>jackson-databind-nullable</artifactId>
|
||||||
<version>${jackson-databind-nullable-version}</version>
|
<version>${jackson-databind-nullable-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.ws.rs</groupId>
|
<groupId>javax.ws.rs</groupId>
|
||||||
<artifactId>jsr311-api</artifactId>
|
<artifactId>jsr311-api</artifactId>
|
||||||
|
@ -305,7 +305,6 @@
|
|||||||
<artifactId>jackson-databind-nullable</artifactId>
|
<artifactId>jackson-databind-nullable</artifactId>
|
||||||
<version>${jackson-databind-nullable-version}</version>
|
<version>${jackson-databind-nullable-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.ws.rs</groupId>
|
<groupId>javax.ws.rs</groupId>
|
||||||
<artifactId>jsr311-api</artifactId>
|
<artifactId>jsr311-api</artifactId>
|
||||||
|
@ -115,6 +115,7 @@ dependencies {
|
|||||||
implementation 'javax.ws.rs:jsr311-api:1.1.1'
|
implementation 'javax.ws.rs:jsr311-api:1.1.1'
|
||||||
implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1'
|
implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1'
|
||||||
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
|
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
|
||||||
|
implementation 'software.amazon.awssdk:auth:2.20.157'
|
||||||
implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2'
|
implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2'
|
||||||
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
|
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
|
||||||
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
|
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
|
||||||
|
@ -17,6 +17,7 @@ lazy val root = (project in file(".")).
|
|||||||
"javax.ws.rs" % "jsr311-api" % "1.1.1",
|
"javax.ws.rs" % "jsr311-api" % "1.1.1",
|
||||||
"javax.ws.rs" % "javax.ws.rs-api" % "2.1.1",
|
"javax.ws.rs" % "javax.ws.rs-api" % "2.1.1",
|
||||||
"org.openapitools" % "jackson-databind-nullable" % "0.2.6",
|
"org.openapitools" % "jackson-databind-nullable" % "0.2.6",
|
||||||
|
"software.amazon.awssdk" % "auth" % "2.20.157",
|
||||||
"org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2",
|
"org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2",
|
||||||
"io.gsonfire" % "gson-fire" % "1.8.5" % "compile",
|
"io.gsonfire" % "gson-fire" % "1.8.5" % "compile",
|
||||||
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
|
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
|
||||||
|
@ -305,11 +305,10 @@
|
|||||||
<artifactId>jackson-databind-nullable</artifactId>
|
<artifactId>jackson-databind-nullable</artifactId>
|
||||||
<version>${jackson-databind-nullable-version}</version>
|
<version>${jackson-databind-nullable-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>software.amazon.awssdk</groupId>
|
<groupId>software.amazon.awssdk</groupId>
|
||||||
<artifactId>auth</artifactId>
|
<artifactId>auth</artifactId>
|
||||||
<version>2.20.120</version>
|
<version>2.20.157</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.ws.rs</groupId>
|
<groupId>javax.ws.rs</groupId>
|
||||||
|
@ -17,16 +17,20 @@ import org.openapitools.client.Pair;
|
|||||||
import org.openapitools.client.ApiException;
|
import org.openapitools.client.ApiException;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider;
|
import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider;
|
||||||
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
|
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
|
||||||
import software.amazon.awssdk.auth.credentials.AwsCredentials;
|
import software.amazon.awssdk.auth.credentials.AwsCredentials;
|
||||||
import software.amazon.awssdk.auth.signer.Aws4Signer;
|
import software.amazon.awssdk.auth.signer.Aws4Signer;
|
||||||
import software.amazon.awssdk.auth.signer.params.Aws4SignerParams;
|
import software.amazon.awssdk.auth.signer.params.Aws4SignerParams;
|
||||||
|
import software.amazon.awssdk.http.ContentStreamProvider;
|
||||||
import software.amazon.awssdk.http.SdkHttpFullRequest;
|
import software.amazon.awssdk.http.SdkHttpFullRequest;
|
||||||
import software.amazon.awssdk.http.SdkHttpMethod;
|
import software.amazon.awssdk.http.SdkHttpMethod;
|
||||||
import software.amazon.awssdk.regions.Region;
|
import software.amazon.awssdk.regions.Region;
|
||||||
@ -36,7 +40,7 @@ import okio.Buffer;
|
|||||||
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
|
||||||
public class AWS4Auth implements Authentication {
|
public class AWS4Auth implements Authentication {
|
||||||
|
|
||||||
private AWSCredentials credentials;
|
private AwsCredentials credentials;
|
||||||
private String region;
|
private String region;
|
||||||
private String service;
|
private String service;
|
||||||
|
|
||||||
|
@ -310,7 +310,6 @@
|
|||||||
<artifactId>jackson-databind-nullable</artifactId>
|
<artifactId>jackson-databind-nullable</artifactId>
|
||||||
<version>${jackson-databind-nullable-version}</version>
|
<version>${jackson-databind-nullable-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.ws.rs</groupId>
|
<groupId>javax.ws.rs</groupId>
|
||||||
<artifactId>jsr311-api</artifactId>
|
<artifactId>jsr311-api</artifactId>
|
||||||
|
@ -305,7 +305,6 @@
|
|||||||
<artifactId>jackson-databind-nullable</artifactId>
|
<artifactId>jackson-databind-nullable</artifactId>
|
||||||
<version>${jackson-databind-nullable-version}</version>
|
<version>${jackson-databind-nullable-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.ws.rs</groupId>
|
<groupId>javax.ws.rs</groupId>
|
||||||
<artifactId>jsr311-api</artifactId>
|
<artifactId>jsr311-api</artifactId>
|
||||||
|
@ -305,7 +305,6 @@
|
|||||||
<artifactId>jackson-databind-nullable</artifactId>
|
<artifactId>jackson-databind-nullable</artifactId>
|
||||||
<version>${jackson-databind-nullable-version}</version>
|
<version>${jackson-databind-nullable-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.ws.rs</groupId>
|
<groupId>javax.ws.rs</groupId>
|
||||||
<artifactId>jsr311-api</artifactId>
|
<artifactId>jsr311-api</artifactId>
|
||||||
|
@ -312,7 +312,6 @@
|
|||||||
<artifactId>jackson-databind-nullable</artifactId>
|
<artifactId>jackson-databind-nullable</artifactId>
|
||||||
<version>${jackson-databind-nullable-version}</version>
|
<version>${jackson-databind-nullable-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.ws.rs</groupId>
|
<groupId>javax.ws.rs</groupId>
|
||||||
<artifactId>jsr311-api</artifactId>
|
<artifactId>jsr311-api</artifactId>
|
||||||
|
@ -310,7 +310,6 @@
|
|||||||
<artifactId>jackson-databind-nullable</artifactId>
|
<artifactId>jackson-databind-nullable</artifactId>
|
||||||
<version>${jackson-databind-nullable-version}</version>
|
<version>${jackson-databind-nullable-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.ws.rs</groupId>
|
<groupId>javax.ws.rs</groupId>
|
||||||
<artifactId>jsr311-api</artifactId>
|
<artifactId>jsr311-api</artifactId>
|
||||||
|
@ -310,7 +310,6 @@
|
|||||||
<artifactId>jackson-databind-nullable</artifactId>
|
<artifactId>jackson-databind-nullable</artifactId>
|
||||||
<version>${jackson-databind-nullable-version}</version>
|
<version>${jackson-databind-nullable-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.ws.rs</groupId>
|
<groupId>javax.ws.rs</groupId>
|
||||||
<artifactId>jsr311-api</artifactId>
|
<artifactId>jsr311-api</artifactId>
|
||||||
|
@ -305,7 +305,6 @@
|
|||||||
<artifactId>jackson-databind-nullable</artifactId>
|
<artifactId>jackson-databind-nullable</artifactId>
|
||||||
<version>${jackson-databind-nullable-version}</version>
|
<version>${jackson-databind-nullable-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.ws.rs</groupId>
|
<groupId>javax.ws.rs</groupId>
|
||||||
<artifactId>jsr311-api</artifactId>
|
<artifactId>jsr311-api</artifactId>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user