-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
credential_process should connect subprocess stderr to caller stderr #1348
Comments
Off the top of my head I can't think of anything that this behavior change would break. I was initially unsure about using stderr as a prompting source, but when stdout is being used entirely then there's not much other choice. The library we use in our sample implementation uses getpass, which has stderr as a fallback. Incidentally, getpass is a possible workaround since it tries to write/read from the tty directly first. Most cases that should work, though there is the potential downside of a non-echoing input. |
Part of the drawback to using getpass to handle this requirement is where the credential process needs to output something more complicated than a single prompt. For example, in the code I've submitted to enhance awsprocesscreds to support MFA under Okta, the code lists out all of the MFA options available to the user. That could be built up as a single string prompt but it isn't nice for the user to then parse it visually. |
There is also the scenario where the credential process needs to provide the user with information about the progress of the authentication process. For example, if the user chooses a push notification operation, my code currently emits some text to let the user know that the code is waiting for the result of the push notification. Granted, I could remove that but I think it is more user-friendly if the user is kept informed about what is happening ... |
This thread has been stale for a while but it would be nice to know if this is gaining any traction. We have federated logins for AWS and a company policy that requires MFA at login. This means that we need more interaction with the user than just prompting for a password. Not being able to use |
FWIW AWS libraries in other languages already do this: |
Wanted to link this PR here as well as add that this would be useful for aws-vault as it prompts to decrypt the credentials when accessed. |
Hi all, wanted to post a workaround that can be done through the ~/.aws/config fairly easily. This should work with any executable, not just aws-vault.
I'm not sure why 'sh -c' is required here. I would think it should work without another subprocess but that doesn't seem to be the case. |
@ryan-gerstenkorn-sp |
|
What I really want, though this is a tall order, is for the credential process spec to allow for interactivity. Let me send something like this to {
"Version": "2",
"Prompt": "Enter password:",
"NoEcho": true
} and have the SDK responsible for prompting the user, and sending that to |
Why is that preferable to attaching stderr? |
Overall, this seems like a sensible feature. I'm researching how our other SDKs handle this to provide a consistent experience - as previously noted, the Go SDK does not capture @benkehoe, agree on the "tall order". It would be pretty powerful, but would definitely require a major overhaul to differentiate between events that are the credential JSON payloads and other messages. |
|
Would there be a downside to supporting both? Both being:
The stderr approach seems like a much smaller ask, while still allowing for basic (non-gui) interactivity |
There are two open pull requests addressing this issue since 3 years now - #2091 and #1835. At the moment it's not possible to use Who has the power to move this forward or is there anything preventing this from being fixed? |
This issue is being tracked in the cross-SDK repository now, since the change would need to be implemented across SDKs to maintain consistency. I'm going to close this issue; if you want to further indicate your support for this issue, please do so in the issue in the other repository. |
When the botocore is configured to use a credential_process to acquire AWS credentials, the sub-process stderr is never sent to the user.
(In our case, the
stderr
is prompting for the MFA details to be entered)stdin
is mapped correctly - and if I know that I'm waiting on MFA I can enter it and the process completes successfully.What I'd hope for -
stderr
is passed from the credential_process to the stderr on theaws
CLI process.The text was updated successfully, but these errors were encountered: