forked from aws/aws-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aws/defaults: Export Shared Config/Creds filename helpers (aws#1308)
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 aws#1293
- Loading branch information
Showing
13 changed files
with
310 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
### SDK Features | ||
|
||
### SDK Enhancements | ||
* `aws/defaults`: Exports shared credentials and config default filenames used by the SDK. [#1308](https://github.com/aws/aws-sdk-go/pull/1308) | ||
* Adds SharedCredentialsFilename and SharedConfigFilename functions to defaults package. | ||
|
||
### SDK Bugs | ||
* `aws/credentials`: Fixes shared credential provider's default filename on Windows. [#1308](https://github.com/aws/aws-sdk-go/pull/1308) | ||
* The shared credentials provider would attempt to use the wrong filename on Windows if the `HOME` environment variable was defined. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package defaults | ||
|
||
import ( | ||
"github.com/aws/aws-sdk-go/internal/shareddefaults" | ||
) | ||
|
||
// SharedCredentialsFilename returns the SDK's default file path | ||
// for the shared credentials file. | ||
// | ||
// Builds the shared config file path based on the OS's platform. | ||
// | ||
// - Linux/Unix: $HOME/.aws/credentials | ||
// - Windows: %USERPROFILE%\.aws\credentials | ||
func SharedCredentialsFilename() string { | ||
return shareddefaults.SharedCredentialsFilename() | ||
} | ||
|
||
// SharedConfigFilename returns the SDK's default file path for | ||
// the shared config file. | ||
// | ||
// Builds the shared config file path based on the OS's platform. | ||
// | ||
// - Linux/Unix: $HOME/.aws/config | ||
// - Windows: %USERPROFILE%\.aws\config | ||
func SharedConfigFilename() string { | ||
return shareddefaults.SharedConfigFilename() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.