-
Notifications
You must be signed in to change notification settings - Fork 27
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
Support AWS credential_process #72
Conversation
src/aws_credentials_file.erl
Outdated
CredsMap = maps:from_list(lists:filtermap( | ||
fun | ||
({<<"AccessKeyId">>, AKI}) -> {true, {<<"aws_access_key_id">>, AKI}}; | ||
({<<"SecretAccessKey">>, SAK}) -> {true, {<<"aws_secret_access_key">>, SAK}}; | ||
({<<"SessionToken">>, ST}) -> {true, {<<"aws_session_token">>, ST}}; | ||
(_) -> false | ||
end, maps:to_list(CredResult))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CredsMap = maps:from_list(lists:filtermap( | |
fun | |
({<<"AccessKeyId">>, AKI}) -> {true, {<<"aws_access_key_id">>, AKI}}; | |
({<<"SecretAccessKey">>, SAK}) -> {true, {<<"aws_secret_access_key">>, SAK}}; | |
({<<"SessionToken">>, ST}) -> {true, {<<"aws_session_token">>, ST}}; | |
(_) -> false | |
end, maps:to_list(CredResult))), | |
Keys = [<<"AccessKeyId">>,<<"SecretAccessKey">>,<<"SessionToken">>], | |
CredsMap = maps:filter(fun(K, V) -> lists:member(K, Keys) end, CredResult), |
First off, thank you for the PR! This is great! 🚀 🙏 Couple of initial comments:
|
Ah sorry I tried to fix the lint before I saw your message. I'll take your approach, thanks! I'll have a go at the test as well. |
Test added. I wasn't able to follow your approach for the map construction. Annoyingly, the keys are different between the JSON representation from the Moreover, since I can break it out into a separate function if you think that would help readability. |
Ofcourse. My coffee-deprived brain didn't take that into account 😅 Looks good ❤️ I've added a few more reviewers. I'll grab a cup of coffee and take a look around lunch 👍 |
LGTM 👌 Thank you! Will merge and tag in a couple of hours 👌 |
AWS credentials file supports a configuration called
credential_process
that executes a program to retrieve credentials.https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-sourcing-external.html