-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove redundant 'array_to_dict' function
- Loading branch information
1 parent
d149916
commit dafb5b5
Showing
2 changed files
with
4 additions
and
35 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from panther_base_helpers import array_to_dict, deep_get | ||
from panther_base_helpers import key_value_list_to_dict | ||
|
||
PRIVILEGED_GROUPS = { | ||
# "[email protected]" | ||
|
@@ -18,10 +18,10 @@ def rule(event): | |
return False | ||
|
||
# Get the username | ||
params = array_to_dict(event_.get("parameter", []), "name") | ||
params = key_value_list_to_dict(event_.get("parameter", []), "name", "value") | ||
global USER_EMAIL, GROUP_EMAIL # pylint: disable=global-statement | ||
USER_EMAIL = deep_get(params, "USER_EMAIL", "value", default="<UNKNOWN USER>") | ||
GROUP_EMAIL = deep_get(params, "GROUP_EMAIL", "value", default="<UNKNOWN GROUP") | ||
USER_EMAIL = params.get("USER_EMAIL", "<UNKNOWN USER>") | ||
GROUP_EMAIL = params.get("GROUP_EMAIL", "<UNKNOWN GROUP>") | ||
|
||
return GROUP_EMAIL in get_privileged_groups() | ||
|
||
|