Skip to content
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

Allow S3 credentials to be inferred by Boto #2229

Merged
merged 1 commit into from Jul 31, 2017
Merged

Conversation

danlamanna
Copy link
Member

Fixes #2054

This commit adds an option to S3 assetstores named inferCredentials
which will allow boto clients to connect without being explicitly
given credentials but instead by using Boto's fallback mechanisms
documented here:
http://boto3.readthedocs.io/en/latest/guide/configuration.html#configuring-credentials.

The easiest way to test this is to test creating an assetstore without credentials and without inferring, and then without credentials and with inferring, while tailing these logs:

from botocore.credentials import logger as botoCredentialsLogger
botoCredentialsLogger.setLevel(logging.DEBUG)
botoCredentialsLogger.addHandler(logging.FileHandler('boto.log'))

When inferring you should see it doing the lookups in the log file:

Looking for credentials via: env
Looking for credentials via: assume-role
Looking for credentials via: shared-credentials-file
Found credentials in shared credentials file: ~/.aws/credentials

I'm unsure of how exactly I should programmatically test this, seeing as how moto more or less ignores credentials entirely.

Sidenote: The Girder ansible-client has since gone out of date with the recent changes to S3 assetstores, I'll open a PR soon-ish bringing all of the arguments there up to date.

This commit adds an option to S3 assetstores named inferCredentials
which will allow boto clients to connect without being explicitly
given credentials but instead by using Boto's fallback mechanisms
documented here:
http://boto3.readthedocs.io/en/latest/guide/configuration.html#configuring-credentials.
@danlamanna danlamanna merged commit 25251fc into master Jul 31, 2017
@danlamanna danlamanna deleted the infer-s3-credentials branch July 31, 2017 16:03
danlamanna added a commit that referenced this pull request Aug 1, 2017
@mgrauer mgrauer mentioned this pull request Aug 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants