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

aws/defaults: Export Shared Config/Creds filename helpers #1308

Merged
merged 4 commits into from
Jun 1, 2017

Conversation

jasdel
Copy link
Contributor

@jasdel jasdel commented May 30, 2017

Exports the shared credentials and shared config filename helper functions to make it easier to get the filename of the credentials and config file.

Corrects a bug in the shared credentials and config HOME path that would return an invalid filename on windows if the HOME environment variable was defined.

Replaces #1293

Copy link
Contributor

@xibz xibz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one minor comment


for _, e := range env {
p := strings.SplitN(e, "=", 2)
os.Setenv(p[0], p[1])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could panic for someone that passed in an invalid string. Should we document that or check for length?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, i'll add validation of the length.

@jasdel jasdel force-pushed the fixup/ExportSharedConfigFilepath branch from 94364b6 to 9890f9d Compare May 31, 2017 23:03
@jasdel jasdel merged commit 5f43689 into aws:master Jun 1, 2017
@jasdel jasdel deleted the fixup/ExportSharedConfigFilepath branch June 1, 2017 16:56
jasdel added a commit to jasdel/aws-sdk-go that referenced this pull request Jun 1, 2017
In aws#1308 the filename was being retrieved with the SharedConfigFilename
utility function not SharedCredentialsFilename function.
jasdel added a commit that referenced this pull request Jun 1, 2017
In #1308 the filename was being retrieved with the SharedConfigFilename
utility function not SharedCredentialsFilename function.

This bug caused the session.New with the SharedCredentials file to break.

Fix #1313
@awstools awstools mentioned this pull request Jun 1, 2017
jasdel added a commit that referenced this pull request Jun 2, 2017
)

Adds tests for SharedCredentialProvider ensuring the correct default shared credential file is used if none is provided.

Related #1308 #1312 #1313
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants