-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't use global credentials in low-level methods (#1309)
* Extract credentials fields into config.Credentials struct These are now retrieved using config.GlobalCredentials(), which will eventually be pushed further and further up the call stack, to make implementing flexible auth easier. * Remove GlobalCredentials usage from pkg/resourcemanager/iam All functions that used the global credentials now require creds passed in - all callers are updated to pass in the global credentials. Eventually this will push all creds-getting up to the level of the reconcile loop so that we can change it to get them from somewhere else. * Redefine config.Credentials as an interface for testing This allows tests to pass their own credentials without having to set the global ones. Remove GlobalCredentials usage from: * pkg/secrets/keyvault * pkg/resourcemanager/* * Eliminate global KeyVaultManager used in tests - now it's constructed with credentials in the affected tests instead. * Remove GlobalCredentials usage from pkg/resourcemanager/resourcegroups Credentials are now passed in when constructing a manager. Converted package level functions ListGroups, GetGroup, DeleteAllGroupsWithPrefix and WaitForDeleteCompletion into methods on AzureResourceGroupManager. There didn't seem to be a reason that they were functions when they would now need credentials. * Rename useMI to useManagedIdentity MI is too cryptic. * Incorporate code review comments Thanks @matthchr!
- Loading branch information
1 parent
b1bf206
commit 8acdb61
Showing
96 changed files
with
1,104 additions
and
917 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
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
Oops, something went wrong.