-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug fix where arg was dropped, minor refactoring and error output (#42)
* Refactor * lint * Fix bug where args were being dropped. Add better error message
- Loading branch information
1 parent
21e07c9
commit 3614ad5
Showing
2 changed files
with
34 additions
and
26 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,19 @@ | ||
from typing import Dict | ||
|
||
|
||
def format_cred_key(key: str, prefix: str) -> str: | ||
return f"{prefix}{key}".upper() | ||
|
||
|
||
# Avoids passing the user's AWS auth session into the running process by | ||
# removing environmental variables that have these keys | ||
# XXX: TODO move to ~/.confidant | ||
def sanitize_secrets(secrets: Dict[str, str]) -> None: | ||
remove = ['AWS_ACCESS_KEY_ID', | ||
'AWS_SECRET_ACCESS_KEY', | ||
'AWS_SECURITY_TOKEN', | ||
'AWS_SESSION_TOKEN'] | ||
|
||
for key in remove: | ||
if secrets.get(key): | ||
del secrets[key] |