-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace Aws4Signer with AwsV4HttpSigner
Previously the library using the deprecated Aws4Signer. This PR replaces it with the new AwsV4HttpSigner.
- Loading branch information
1 parent
756a6e3
commit 1620f0d
Showing
13 changed files
with
199 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
- [Upgrading AWS Request Signing Interceptor](#upgrading-opensearch-python-client) | ||
- [## Upgrading to >= 3.0.0](#upgrading-to->=-3.0.0) | ||
|
||
|
||
# Upgrading AWS Request Signing Interceptor | ||
|
||
## Upgrading to >= 3.0.0 | ||
|
||
`Aws4Signer` has been deprecated in the AWS SDK for Java 2.0 and replaced with `AwsV4HttpSigner`. | ||
|
||
As a consequence, the `AwsRequestSigningApacheInterceptor` and `AwsRequestSigningApacheV5Interceptor` now requires an `AwsV4HttpSigner` instance instead of an `Aws4Signer`. | ||
|
||
To upgrade, replace the `Aws4Signer` with `AwsV4HttpSigner` in your code. For example, if you are using `AwsRequestSigningApacheInterceptor`: | ||
|
||
```java | ||
import java.io.IOException; | ||
import io.github.acm19.aws.interceptor.http.AwsRequestSigningApacheV5Interceptor; | ||
import org.apache.hc.client5.http.ClientProtocolException; | ||
import org.apache.hc.core5.http.HttpRequestInterceptor; | ||
import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider; | ||
import software.amazon.awssdk.auth.signer.Aws4Signer; | ||
import software.amazon.awssdk.regions.Region; | ||
|
||
final class Example { | ||
public static void main(String[] args) throws ClientProtocolException, IOException { | ||
HttpRequestInterceptor interceptor = new AwsRequestSigningApacheV5Interceptor( | ||
"service", | ||
Aws4Signer.create(), | ||
DefaultCredentialsProvider.create(), | ||
Region.US_WEST_2 | ||
); | ||
} | ||
} | ||
``` | ||
|
||
becomes: | ||
|
||
```java | ||
import java.io.IOException; | ||
import io.github.acm19.aws.interceptor.http.AwsRequestSigningApacheV5Interceptor; | ||
import org.apache.hc.client5.http.ClientProtocolException; | ||
import org.apache.hc.core5.http.HttpRequestInterceptor; | ||
import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider; | ||
import software.amazon.awssdk.auth.signer.Aws4Signer; | ||
import software.amazon.awssdk.regions.Region; | ||
|
||
final class Example { | ||
public static void main(String[] args) throws ClientProtocolException, IOException { | ||
HttpRequestInterceptor interceptor = new AwsRequestSigningApacheV5Interceptor( | ||
"service", | ||
AwsV4HttpSigner.create(), | ||
DefaultCredentialsProvider.create(), | ||
Region.US_WEST_2 | ||
); | ||
} | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.