Skip to content

Conversation

@sugmanue
Copy link
Contributor

Motivation and Context

This change allows the service generated instance of ServiceClientConfiguration.Builder to read/write its values directly from an SdkClientConfiguration.Builder by mapping the required option to the getters and setters.

Also this change adds two new properties to the ServiceClientConfiguration class to support the plugins use case:

  • credentialsProvider of IdentityProvider<? extends AwsCredentialsIdentity>
  • authSchemeProvider of <Service>AuthSchemeProvider (the service specific auth scheme provider)

This change is part of the SRA plugins for Identity and Auth.

Modifications

Testing

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@sugmanue sugmanue requested a review from a team as a code owner September 15, 2023 18:19
@sugmanue sugmanue requested a review from joviegas September 15, 2023 18:49

builder.addMethod(buildClientMethod());
builder.addMethod(initializeServiceClientConfigMethod());
builder.addMethod(SyncClientBuilderClass.initializeServiceClientConfigMethod(serviceConfigClassName));
Copy link
Contributor

Choose a reason for hiding this comment

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

Using a static method of SyncClientBuilderClass within AsyncClientBuilderClass seems ambigous. Would it be better to move the initializeServiceClientConfigMethod to a common utility class used by both sync/Async ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we can do that in a follow up pull request if that's OK.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a TODO : here so that we might not miss it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will remove this method and instead move it to the base class in the next PR.

@joviegas
Copy link
Contributor

Do we already have functional junits test where these settings actually gets used/resolved ?

@sugmanue
Copy link
Contributor Author

Do we already have functional junits test where these settings actually gets used/resolved ?

Not yet, we will in the coming pull requests when those settings are actually used, right now I'm only setting them up for it.

@sugmanue sugmanue force-pushed the sugmanue/sra-plugins-update-client-service-config branch from fbff43b to afe4f64 Compare September 19, 2023 15:14
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug C 3 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 2 Security Hotspots
Code Smell A 409 Code Smells

84.6% 84.6% Coverage
3.8% 3.8% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@sugmanue sugmanue merged commit 3906e80 into feature/master/sra-identity-auth Sep 19, 2023
@sugmanue sugmanue deleted the sugmanue/sra-plugins-update-client-service-config branch September 19, 2023 18:10
// advanced option
Signer signer = this.advancedOption(SdkAdvancedClientOption.SIGNER).orElse(null);
builder.option(SdkAdvancedClientOption.SIGNER, signer);
builder.option(SdkClientOption.SIGNER_OVERRIDDEN, signer != null);
Copy link
Contributor

Choose a reason for hiding this comment

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

This used to be

        clientOverrideConfiguration.advancedOption(SIGNER).ifPresent(s -> {
            builder.option(SIGNER_OVERRIDDEN, true);
        });

which means SIGNER_OVERRIDDEN would be null or true before, but now is always false or true. This actually affects this logic:

return isClientSignerOverridden.isPresent() || requestSigner.isPresent();

I think this can be fixed to check for true instead of isPresent.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fixing in #4473

alextwoods added a commit that referenced this pull request Nov 19, 2025
…der_refresh1

Implement credentials refresh for LoginCredentialsProvider
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.

3 participants