aws / git-remote-codecommit

An implementation of Git Remote Helper that makes it easier to interact with AWS CodeCommit
Apache License 2.0
271 stars 38 forks source link

BUG: AWS SSO Login Should Not Be Required for `git remote show origin` Command #52

Open sohang3112 opened 3 months ago

sohang3112 commented 3 months ago

Bug Description

In a repository cloned from AWS CodeCommit using the git-remote-codecommit library, the git remote show origin command fails with a TokenRetrievalError if the AWS SSO CLI session has expired. This is problematic because displaying the remote URL should not require an active AWS SSO session. The AWS SSO login should only be required for commands that perform actions requiring authentication, not for commands that merely retrieve and display repository metadata.

Steps to Reproduce:

Actual Behavior:

The following error occurs:

botocore.exceptions.TokenRetrievalError: Error when retrieving token from sso: Token has expired and refresh failed

Expected Behavior:

The git remote show origin command should only display the repository URL and should not require an active AWS SSO session. AWS SSO login should only be necessary for commands that interact with the repository data, not for commands that simply display information.