Skip to content

Commit

Permalink
fix awsauth in okhttp gson java client
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 committed Oct 4, 2023
1 parent bf7c9a7 commit b3d42f9
Show file tree
Hide file tree
Showing 17 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@ import {{invokerPackage}}.Pair;
import {{invokerPackage}}.ApiException;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.List;
import java.util.stream.Collectors;

import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.AwsCredentials;
import software.amazon.awssdk.auth.signer.Aws4Signer;
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.SdkHttpMethod;
import software.amazon.awssdk.regions.Region;
Expand All @@ -25,7 +29,7 @@ import okio.Buffer;
{{>generatedAnnotation}}
public class AWS4Auth implements Authentication {
private AWSCredentials credentials;
private AwsCredentials credentials;
private String region;
private String service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ dependencies {
{{#openApiNullable}}
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
{{/openApiNullable}}
{{#withAWSV4Signature}}
implementation 'software.amazon.awssdk:auth:2.20.157'
{{/withAWSV4Signature}}
{{#hasOAuthMethods}}
implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2'
{{/hasOAuthMethods}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ lazy val root = (project in file(".")).
{{#openApiNullable}}
"org.openapitools" % "jackson-databind-nullable" % "0.2.6",
{{/openApiNullable}}
{{#withAWSV4Signature}}
"software.amazon.awssdk" % "auth" % "2.20.157",
{{/withAWSV4Signature}}
{{#hasOAuthMethods}}
"org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2",
{{/hasOAuthMethods}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,11 @@
<version>${jackson-databind-nullable-version}</version>
</dependency>
{{/openApiNullable}}
{{#withAWSV4Signature}}
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>auth</artifactId>
<version>2.20.120</version>
<version>2.20.157</version>
</dependency>
{{/withAWSV4Signature}}
<dependency>
Expand Down
1 change: 0 additions & 1 deletion samples/client/echo_api/java/okhttp-gson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@
<artifactId>jackson-databind-nullable</artifactId>
<version>${jackson-databind-nullable-version}</version>
</dependency>

<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
Expand Down
1 change: 0 additions & 1 deletion samples/client/others/java/okhttp-gson-streaming/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@
<artifactId>jackson-databind-nullable</artifactId>
<version>${jackson-databind-nullable-version}</version>
</dependency>

<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
Expand Down
1 change: 0 additions & 1 deletion samples/client/petstore/java/okhttp-gson-3.1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@
<artifactId>jackson-databind-nullable</artifactId>
<version>${jackson-databind-nullable-version}</version>
</dependency>

<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ dependencies {
implementation 'javax.ws.rs:jsr311-api:1.1.1'
implementation 'javax.ws.rs:javax.ws.rs-api:2.1.1'
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.commons', name: 'commons-lang3', version: '3.12.0'
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ lazy val root = (project in file(".")).
"javax.ws.rs" % "jsr311-api" % "1.1.1",
"javax.ws.rs" % "javax.ws.rs-api" % "2.1.1",
"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",
"io.gsonfire" % "gson-fire" % "1.8.5" % "compile",
"jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@
<artifactId>jackson-databind-nullable</artifactId>
<version>${jackson-databind-nullable-version}</version>
</dependency>

<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>auth</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@
<artifactId>jackson-databind-nullable</artifactId>
<version>${jackson-databind-nullable-version}</version>
</dependency>

<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@
<artifactId>jackson-databind-nullable</artifactId>
<version>${jackson-databind-nullable-version}</version>
</dependency>

<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@
<artifactId>jackson-databind-nullable</artifactId>
<version>${jackson-databind-nullable-version}</version>
</dependency>

<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@
<artifactId>jackson-databind-nullable</artifactId>
<version>${jackson-databind-nullable-version}</version>
</dependency>

<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
Expand Down
1 change: 0 additions & 1 deletion samples/client/petstore/java/okhttp-gson-swagger1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@
<artifactId>jackson-databind-nullable</artifactId>
<version>${jackson-databind-nullable-version}</version>
</dependency>

<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
Expand Down
1 change: 0 additions & 1 deletion samples/client/petstore/java/okhttp-gson-swagger2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@
<artifactId>jackson-databind-nullable</artifactId>
<version>${jackson-databind-nullable-version}</version>
</dependency>

<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
Expand Down
1 change: 0 additions & 1 deletion samples/client/petstore/java/okhttp-gson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@
<artifactId>jackson-databind-nullable</artifactId>
<version>${jackson-databind-nullable-version}</version>
</dependency>

<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
Expand Down

0 comments on commit b3d42f9

Please sign in to comment.