Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: replace regions with v2 api #164

Merged
merged 2 commits into from
Jun 25, 2024

Conversation

jvdadda
Copy link
Contributor

@jvdadda jvdadda commented Apr 5, 2024

Description of changes:

Replace the v1 region API with V2. I do not succeed to find an exact equivalent, so to try to extract the region from the host, I check if I find the region id in the string, and if not, fallback to the default region provider.

I removed the sdk V1 dependency that have remove few helper method (from transiant dependencies), I reimplemented them instead of adding an extra dependency.

It should end the V1 SDK, unit tests are green, I tested for my own case, it works, hoping it will for everyone

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Will resolve #154

@jvdadda jvdadda marked this pull request as ready for review May 28, 2024 19:21
@jvdadda jvdadda requested a review from a team as a code owner May 28, 2024 19:21
@jvdadda
Copy link
Contributor Author

jvdadda commented May 28, 2024

@sidyag And here is the last pull request that remove all java-sdk-v1 dependencies

@ukby1234
Copy link

@sidyag friendly bump

@@ -61,15 +59,12 @@ public IAMOAuthBearerToken(String token) throws URISyntaxException {
byte[] decodedBytes = Base64.getUrlDecoder().decode(tokenBytes);
final String decodedPresignedUrl = new String(decodedBytes, StandardCharsets.UTF_8);
final URI uri = new URI(decodedPresignedUrl);
List<NameValuePair> params = URLEncodedUtils.parse(uri, StandardCharsets.UTF_8);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we use this anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sidyag , by removing AWS SDK V1, some transitive dependencies have been removed, then NameValuePair and URLEncodedUtils are no more available. I can have access again by adding org.apache.httpcomponents:httpclient:4.5.+ dependency if needed. I re-implemented the method to avoid adding the whole dependency

Copy link
Contributor

@sidyag sidyag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from the one comment.

@sidyag sidyag merged commit 945e3c7 into aws:main Jun 25, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate fully to SDKv2
3 participants