-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #199 from softlayer/refreshv2
Added an observer for IAMToken refreshes
- Loading branch information
Showing
6 changed files
with
146 additions
and
10 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
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,23 @@ | ||
package session | ||
|
||
//counterfeiter:generate . IAMUpdater | ||
type IAMUpdater interface { | ||
Update(token string, refresh string) | ||
} | ||
|
||
type LogIamUpdater struct { | ||
debug bool | ||
} | ||
|
||
func NewLogIamUpdater(debug bool) *LogIamUpdater { | ||
return &LogIamUpdater{ | ||
debug: debug, | ||
} | ||
} | ||
|
||
func (iamupdater *LogIamUpdater) Update(token string, refresh string) { | ||
if iamupdater.debug { | ||
Logger.Printf("[DEBUG] New Token: %s\n", token) | ||
Logger.Printf("[DEBUG] New Refresh Token: %s\n", refresh) | ||
} | ||
} |
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