-
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.
Merge branch 'main' into jof/public/config
- Loading branch information
Showing
43 changed files
with
427 additions
and
106 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,2 @@ | ||
[bandit] | ||
skips = B101 |
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,15 @@ | ||
[MAIN] | ||
disable= | ||
missing-docstring, | ||
duplicate-code, | ||
import-error, | ||
fixme, | ||
consider-iterating-dictionary, | ||
global-variable-not-assigned, | ||
broad-exception-raised | ||
|
||
load-plugins= | ||
pylint.extensions.mccabe, | ||
pylint_print | ||
|
||
max-line-length=100 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
import panther_event_type_helpers as event_type | ||
|
||
ADMIN_EVENTS = { | ||
"business.add_admin", | ||
"business.invite_admin", | ||
"team.promote_maintainer", | ||
} | ||
|
||
def get_admin_role(_): | ||
# github doesn't record the admin role in the event | ||
return "<UNKNOWN_ROLE>" | ||
|
||
def get_admin_role(event): | ||
action = event.get("action", "") | ||
return action if action in ADMIN_EVENTS else "<UNKNOWN_ADMIN_ROLE>" | ||
|
||
|
||
def get_event_type(event): | ||
if event.get("action") == "team.promote_maintainer": | ||
if event.get("action", "") in ADMIN_EVENTS: | ||
return event_type.ADMIN_ROLE_ASSIGNED | ||
if event.get("action") == "org.disable_two_factor_requirement": | ||
if event.get("action", "") == "org.disable_two_factor_requirement": | ||
return event_type.MFA_DISABLED | ||
return None |
Oops, something went wrong.