whalebrew / whalebrew-packages

Core packages for Whalebrew
https://github.com/whalebrew/whalebrew
Apache License 2.0
115 stars 40 forks source link

awscli: CodeCommit access using credential-helper #58

Open michaelwittig opened 5 years ago

michaelwittig commented 5 years ago

I try to get CodeCommit access (using git credential helper)working with the awscli package:

In my git repos, I define this in .git/config to get access to CodeCommit.

[credential]
        helper =
        helper = !aws --profile xyz codecommit credential-helper $@
        UseHttpPath = true

In my case, profile xyz is configured to use MFA.

When I git pull, I get:

$ git pull
/usr/local/lib/python3.7/getpass.py:91: GetPassWarning: Can not control echo on the terminal.
  passwd = fallback_getpass(prompt, stream)
Warning: Password input may be echoed.
Enter MFA code for arn:aws:iam::XXX:mfa/michael: 

Username for 'https://git-codecommit.us-west-2.amazonaws.com/v1/repos/YYY': 

Any ideas how I can make this work?

tjamet commented 2 years ago

I understand, here, you are trying to use the aws cli in container run by whalebrew as a git credential helper, correct?

I tend to see the problem around a conflict in the way git, docker and aws handle TTYs. Not sure how to fix it properly at the moment though