-
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.
Added an observer for IAMToken refreshes, so configs can be updated i…
…f needed
- Loading branch information
1 parent
dc4dd3f
commit 1f895cd
Showing
5 changed files
with
92 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
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