-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Support auth scheme preference config #3268
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
base: version-3
Are you sure you want to change the base?
Conversation
Detected 2 possible performance regressions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall approach looks good to me! Left a question.
ordered_auth = preferred_auth.each_with_object([]) do |pref, list| | ||
next unless ENDPOINT_AUTH_PREFERENCE_MAP.key?(pref) | ||
|
||
ENDPOINT_AUTH_PREFERENCE_MAP[pref].each { |name| list << { 'name' => name } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the list adding hashes of name
to auth scheme names rather than just being a list of names? Is auth_schemes
a list of name
, auth_scheme_name
key pairs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The endpoint auth schemes model has a list of maps in the same way, so I transformed the preference list to be the same, then added them together. This overall made the logic and change simpler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢✨
gems/aws-sdk-core/lib/aws-sdk-core/plugins/credentials_configuration.rb
Outdated
Show resolved
Hide resolved
gems/aws-sdk-core/lib/aws-sdk-core/plugins/credentials_configuration.rb
Outdated
Show resolved
Hide resolved
…ration.rb Co-authored-by: Juli Tera <57973151+jterapin@users.noreply.github.com>
…ration.rb Co-authored-by: Juli Tera <57973151+jterapin@users.noreply.github.com>
Support auth scheme preference config using
ENV['AWS_AUTH_SCHEME_PREFERENCE']
orauth_scheme_preference
shared config. Configuration values are an array in code and a comma separated string in env/shared config and do not use name spaces. Invalid values are ignored. If an auth scheme is resolved and preferred, the credentials/token is expected. This differs from original design because v3 does not resolve auth per operation but rather on client initialize.