Repository navigation
Conversation
SSOProfile now reads the profile with the SDK parser, and not with a hand parser. It follows source_profile, so a role profile with an SSO source profile gets the login offer. The login and the error name the source profile, because that profile has the SSO configuration. The SDK parser needs the [sso-session] section of an sso_session profile. Without that section, the SDK cannot load the profile, so the command fails before this check. ConfigFilePath, HasSSOConfig, and the injected configuration path in ssoLogin are gone. The error message and the login decision now read the same files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requirements
Related issues
Follow-up to #919.
Describe the solution you've provided
role_arnandsource_profilegets its credentials from the source profile. If the source profile uses SSO and its token expires, the command did not offeraws sso login. The error told you to runaws sts get-caller-identity.SSOProfilereads the profile withawsconfig.LoadSharedConfigProfile. It followssource_profileand returns the first profile in the chain that uses SSO. The prompt and the error name that profile, becauseaws sso loginneeds the profile with the SSO configuration.HasSSOConfigparsed the INI file by hand, next to the SDK parser. The two parsers can disagree.HasSSOConfig,sectionProfile, andConfigFilePathare gone.credentialsFilePathandconfigFilePathreplacesharedConfigPaths, and they use the SDK default paths.ssoLoginhad its ownconfigPath, butnoCredentialsErrorreadAWS_CONFIG_FILE. The prompt and the error message could read different files.ssoLoginhas noconfigPath. Both read the same files. The tests setAWS_CONFIG_FILE.The SDK parser needs the
[sso-session]section of ansso_sessionprofile. Without it,LoadDefaultConfigfails before this check, so no real run changes. The test configurations now include the section.Describe alternatives you've considered
The review also found that one failure reads the configuration files several times. A fix is to resolve the SSO profile once in
NewClientsand keep it on the error. This change moves about ten tests fromcmd/aws_devops_agenttointernal/awsdevops, and it saves a few file reads on a failure path. I did not do it in this PR.Additional context
TestSSOTokenInvalidForEachSDKCasehas a new case. It uses the real SDK for a role profile with ansso_sessionsource profile and no cached token.🤖 Generated with Claude Code