Skip to content

Commit

Permalink
fix: check for Z and replace with +00:00 in list_1password_audit_events
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgrittner committed Sep 12, 2024
1 parent bd9d83b commit d8053fa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions admyral/actions/integrations/compliance/one_password.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ def list_1password_audit_events(
),
] = None,
) -> list[dict[str, JsonValue]]:
# https://developer.1password.com/docs/events-api/reference#post-apiv1auditevents

secret = ctx.get().secrets.get("1PASSWORD_SECRET")
api_key = secret["api_key"]
domain = secret["domain"]
Expand All @@ -74,10 +76,12 @@ def list_1password_audit_events(
}
if start_time:
body["start_time"] = (
start_time[:-1] if start_time.endswith("Z") else start_time
f"{start_time[:-1]}+00:00" if start_time.endswith("Z") else start_time
)
if end_time:
body["end_time"] = end_time[:-1] if end_time.endswith("Z") else end_time
body["end_time"] = (
f"{end_time[:-1]}+00:00" if end_time.endswith("Z") else end_time
)

while limit is None or len(events) < limit:
client_response = client.post("/api/v1/auditevents", json=body)
Expand Down

0 comments on commit d8053fa

Please sign in to comment.