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

LoadOptions for wrapWithCredentialsCache #2000

Open
1 of 2 tasks
fpozzobon opened this issue Jan 30, 2023 · 0 comments
Open
1 of 2 tasks

LoadOptions for wrapWithCredentialsCache #2000

fpozzobon opened this issue Jan 30, 2023 · 0 comments
Labels
feature-request A feature should be added or improved. p3 This is a minor priority issue queued This issues is on the AWS team's backlog

Comments

@fpozzobon
Copy link

Describe the feature

When resolving credentials, it would be nice to be able to define wrapWithCredentialsCache used here.

Consumer of AWS library could define their own credential cache mechanism (eg asynchronous) while beneficiate from resolveCredentialChain to get the right credential provider.

Use Case

Credential Cache does not support asynchronous retrieval of credentials.
To be able to achieve this, it requires changes inside credential cache (PR aborted) or redefine provider after config.LoadDefaultConfig has been called (if consume wants to beneficiates from default configuration).

Proposed Solution

Adding LoadOptions:

// WrapWithCredentialsCache will wrap provider with custom credentialCache with the provided options
// default: aws.CredentialsCache if the provider is not already a aws.CredentialsCache
WrapWithCredentialsCache func(provider aws.CredentialsProvider, optFns ...func(options *aws.CredentialsCacheOptions)) aws.CredentialsProvider
func WithWrapWithCredentialsCache(v func(provider aws.CredentialsProvider, optFns ...func(options *aws.CredentialsCacheOptions)) aws.CredentialsProvider) aws.CredentialsProvider) LoadOptionsFunc {
	return func(o *LoadOptions) error {
		o.WrapWithCredentialsCache = v
		return nil
	}
}

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS Go SDK V2 Module Versions Used

github.com/aws/aws-sdk-go-v2@v1.17.3
github.com/aws/aws-sdk-go-v2/config@v1.18.10
github.com/aws/aws-sdk-go-v2/credentials@v1.13.10

Go version used

1.19

@fpozzobon fpozzobon added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jan 30, 2023
@aajtodd aajtodd removed the needs-triage This issue or PR still needs to be triaged. label Jan 31, 2023
@RanVaknin RanVaknin added the p3 This is a minor priority issue label Mar 22, 2023
@RanVaknin RanVaknin added the queued This issues is on the AWS team's backlog label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. p3 This is a minor priority issue queued This issues is on the AWS team's backlog
Projects
None yet
Development

No branches or pull requests

3 participants