-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SOAR-17745] Duo admin Improve handling of 429s in task code (#3048)
* Updating plugin.spec (#3047) * Duo admin Improve handling of 429s in task code * Linting the code * Version bump * Adjusting styling * Resolving static code analysis * Resolving plugin's validation * CR fixes * Additional test case * Bumping the SDK and linting the code --------- Co-authored-by: rmurray-r7 <[email protected]>
- Loading branch information
1 parent
4adc1ac
commit 50a2790
Showing
12 changed files
with
114 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
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
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,7 @@ | ||
from datetime import datetime | ||
|
||
|
||
class Utils: | ||
@staticmethod | ||
def convert_epoch_to_readable(epoch_time: float) -> str: | ||
return datetime.utcfromtimestamp(epoch_time).strftime("%Y-%m-%d %H:%M:%S") |
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
10 changes: 10 additions & 0 deletions
10
plugins/duo_admin/unit_test/expected/monitor_logs_rate_limit.json.exp
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,10 @@ | ||
{ | ||
"logs": [], | ||
"state": { | ||
"previous_admin_log_hashes": [], | ||
"previous_auth_log_hashes": [], | ||
"rate_limit_datetime": 3050853836.506636, | ||
"previous_trust_monitor_event_hashes": [] | ||
}, | ||
"status_code": 429 | ||
} |
6 changes: 6 additions & 0 deletions
6
plugins/duo_admin/unit_test/inputs/monitor_logs_with_rate_limit.json.inp
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,6 @@ | ||
{ | ||
"previous_admin_log_hashes": [], | ||
"previous_auth_log_hashes": [], | ||
"rate_limit_datetime": 3050853836.506636, | ||
"previous_trust_monitor_event_hashes": [] | ||
} |
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