-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Moved Debug logging testing of secret traits to common -Re-architected racf_key_map and racf_message_key_map under 1 dictionary -changed comments -established SecretRedactionError Signed-off-by: Elijah Swift <elijah.swift@ibm.com>
- Loading branch information
1 parent
ff53162
commit a2e6cef
Showing
12 changed files
with
214 additions
and
161 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""Exception to use when Additional Secrets could not be Redacted.""" | ||
|
||
from typing import List | ||
|
||
|
||
class SecretsRedactionError(Exception): | ||
""" | ||
Raised when a specified secret cannot be redacted because it does not map to a segement:trait. | ||
""" | ||
|
||
def __init__( | ||
self, profile_type: str = "", bad_secret_traits: List[str] = [] | ||
) -> None: | ||
profile_map = { | ||
"user": "User", | ||
"group": "Group", | ||
"dataSet": "Data Set", | ||
"resource": "General Resource", | ||
"permission": "Access", | ||
"groupConnection": "Group Connection", | ||
"systemSettings": "Setropts", | ||
} | ||
self.message = ( | ||
f"Cannot add specified additional secrets to {profile_map[profile_type]} " | ||
+ "administration." | ||
) | ||
|
||
if bad_secret_traits: | ||
for trait in bad_secret_traits: | ||
self.message = self.message + ( | ||
f"\nCould not map {trait} to a valid segment trait." | ||
) | ||
|
||
def __str__(self) -> str: | ||
return self.message |
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
File renamed without changes.
File renamed without changes.
Oops, something went wrong.