-
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.
Signed-off-by: Elijah Swift <elijah.swift@ibm.com>
- Loading branch information
1 parent
e2ad702
commit c497017
Showing
26 changed files
with
126 additions
and
134 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
"""Exception to use when the user passes bad segment name(s) on an extract request.""" | ||
|
||
|
||
class SegmentError(Exception): | ||
""" | ||
Raised when a user passes a bad segment name on an extract request. | ||
""" | ||
|
||
def __init__(self, invalid_segments: list, profile_type: str) -> None: | ||
self.message = "Unable to build Security Request.\n\n" | ||
for segment in invalid_segments: | ||
self.message += ( | ||
f"'{segment}' is not a valid segment for '{profile_type}'.\n" | ||
) | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
"""Exception to use when the user passes bad segment-trait name(s) on an add/alter request.""" | ||
|
||
|
||
class SegmentTraitError(Exception): | ||
""" | ||
Raised when a user passes an invalid segment-trait combination in the traits dictionary. | ||
""" | ||
|
||
def __init__(self, invalid_traits: list, profile_type: str) -> None: | ||
self.message = "Unable to build Security Request.\n\n" | ||
for trait in invalid_traits: | ||
self.message += f"'{trait}' is not a valid segment-trait " | ||
self.message += f"combination for '{profile_type}'.\n" | ||
|
||
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
Oops, something went wrong.