aws / aws/git-remote-codecommit

git-remote-codecommit fails to recognize the new ~/.aws/config file formats created by AWS CLI v2.9.x

Open
#36 8 comments 9 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
289
Forks
40
PR merge metrics
No merged PRs in 30d

Description

# The new AWS CLI v2.9.x creates the following config file:

$ `cat ~/.aws/config`
[profile ]
sso_session =
sso_account_id =
sso_role_name =
region = us-east-2
[sso-session mac]
sso_start_url =
sso_region =
sso_registration_scopes = sso:account:access

# Following git command fails to recognize the above new AWS Config file format:

$ `git clone codecommit::://@`
Cloning into ''...
Traceback (most recent call last):
File "/opt/homebrew/bin/git-remote-codecommit", line 33, in
sys.exit(load_entry_point('git-remote-codecommit==1.16', 'console_scripts', 'git-remote-codecommit')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/git-remote-codecommit/1.16/libexec/lib/python3.11/site-packages/git_remote_codecommit/__init__.py", line 176, in main
context = Context.from_url(remote_url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/git-remote-codecommit/1.16/libexec/lib/python3.11/site-packages/git_remote_codecommit/__init__.py", line 148, in from_url
credentials = session.get_credentials()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/git-remote-codecommit/1.16/libexec/lib/python3.11/site-packages/botocore/session.py", line 509, in get_credentials
).load_credentials()
^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/git-remote-codecommit/1.16/libexec/lib/python3.11/site-packages/botocore/credentials.py", line 2095, in load_credentials
creds = provider.load()
^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/git-remote-codecommit/1.16/libexec/lib/python3.11/site-packages/botocore/credentials.py", line 2249, in load
sso_config = self._load_sso_config()
^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/git-remote-codecommit/1.16/libexec/lib/python3.11/site-packages/botocore/credentials.py", line 2239, in _load_sso_config
raise InvalidConfigError(
botocore.exceptions.InvalidConfigError: The profile "" is configured to use SSO but is missing required configuration: sso_start_url, sso_region

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.