Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sbaluja
Copy link
Contributor

@sbaluja sbaluja commented Nov 4, 2025

Issue #, if available:

Description of changes:
This PR adds support for client-level auth resolution. It includes replacement of current authResolvers to be more generic, and allows for customers to set preferences for authentication methods.

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

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

@sbaluja sbaluja marked this pull request as ready for review November 4, 2025 21:03
* Authentication scheme preferences in order of preference.
* First available auth scheme will be used for each operation.
*/
Aws::Vector<Aws::String> authPreferences;
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if we should put this on the top level ClientConfiguration object, should it be code-genned on the service specific client configuration? that gives us two advantages, only smithy clients witll have it, and additionally we can make it a Aws::Array of constant space.

* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
Copy link
Contributor

Choose a reason for hiding this comment

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

cant remove installed headers, you can make the header point to something new, but removing installed headers can and will break customers if any of their code includes this header.


Aws::Vector<AuthSchemeOption> filtered;
for (const auto& pref : preferences) {
auto prefSchemeIt = AUTH_SCHEME_NAME_TO_ID.find(Aws::Utils::StringUtils::ToLower(pref.c_str()));
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a way to code generate AUTH_SCHEME_NAME_TO_ID so that we dont have all the mappings, just the ones we know are relevant? and would that simplfy any assumptions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we could probably do this, but it's gonna add complexity with little benefit imo. Since we construct GenericAuthResolver as part of the code gen, we could also construct with the mappings, and pass it down to the base class where the mapping is needed. Maybe missing something, but given that this is a 4 key/pair value lookup I don't think there's any gains here

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.

2 participants