-
Notifications
You must be signed in to change notification settings - Fork 2.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
aws/session: Add Assume role for credential process from aws profile #2674
Merged
Merged
Changes from 5 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
6fe148c
Added support for Credential Process to assume role for AWS-SDK-GO
9db3f0a
Added support for Credential Process to assume role for AWS-SDK-GO
4020e0d
Merge branch 'GoSDK-543' of github.com:skotambkar/aws-sdk-go into GoS…
f3b7a90
Modified config file to unable support for Windows as well as Linux.
d659cb3
code cleanup
f1658b4
Eliminated redundant code from credential process tests, formatting c…
0def7bf
Updated travis to support make for windows
8a9d14d
Updated travis configuration file to support unit test on Windows wit…
7a1f20e
Fixed syntax error in Travis config file
cb77c1e
resolved dependency issue for travis configuration
2ec081f
Updated environment stashing logic to preserve SYSTEMROOT settings fo…
44f511f
Added system root in environments to keep when stashing
0759f56
changes in stashing systemroot for windows
d9cb70f
removed additional print statements
b8555c4
Refactored code with sdktesting with platform specific config environ…
8150197
Fixed minor bugs for tests and config files
a0e6b4c
Fix for TestNoConnection retry bug on Windows OS
4e8dc55
Code cleanup, added unit test for request connection retry, custom ca…
f313908
Updated readme file for awstesting
a6e326a
Updated request retry test
3ea246b
updated test log for supporting Go version 1.5
2c88c3f
Fixed TestShouldRetry to solve nil pointer dereference issue with *ur…
a7dc165
code cleanup
3c5b464
Added suggested changes
26d07ad
Added suggested changes
2239254
Added case index number in t.Run() for env_config_test
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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 |
---|---|---|
|
@@ -95,13 +95,30 @@ func (c *FakeContext) Value(key interface{}) interface{} { | |
return nil | ||
} | ||
|
||
// StashEnv stashes the current environment variables and returns an array of | ||
// all environment values as key=val strings. | ||
func StashEnv() []string { | ||
env := os.Environ() | ||
os.Clearenv() | ||
// StashEnv stashes the current environment variables except variables listed in envToKeep | ||
// Returns an array of all environment values as key=val strings. | ||
func StashEnv(envToKeep ...string) []string { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest updating |
||
|
||
extraEnv := getEnvs(envToKeep) | ||
|
||
originalEnv := os.Environ() | ||
os.Clearenv() //clear env | ||
|
||
for key, val := range extraEnv { | ||
os.Setenv(key, val) | ||
} | ||
|
||
return env | ||
return originalEnv | ||
} | ||
|
||
func getEnvs(envs []string) map[string]string { | ||
extraEnvs := make(map[string]string) | ||
for _, env := range envs { | ||
if val, ok := os.LookupEnv(env); ok && len(val) > 0 { | ||
extraEnvs[env] = val | ||
} | ||
} | ||
return extraEnvs | ||
} | ||
|
||
// PopEnv takes the list of the environment values and injects them into the | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
will want to test this against windows to ensure tests work.