Skip to content

Commit

Permalink
Merge pull request #237 from TeskaLabs/fix/validate-client-session-ex…
Browse files Browse the repository at this point in the history
…piration

Validate session expiration
  • Loading branch information
byewokko authored Jul 27, 2023
2 parents 2ece604 + affc22b commit 3d46d30
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
### Breaking changes
- Seacat Auth listens on ports 3081 and 8900 by default (#230, PLUM Sprint 230714)

### Fix
- Validate client session expiration (#237, PLUM Sprint 230714)

### Features
- Seacat Auth listens on ports 3081 and 8900 by default (#230, PLUM Sprint 230714)

Expand Down
6 changes: 5 additions & 1 deletion seacatauth/client/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,11 @@ async def update(self, client_id: str, **kwargs):
upsertor.unset(k)
else:
if k == "session_expiration" and isinstance(v, str):
v = convert_to_seconds(v)
try:
v = convert_to_seconds(v)
except ValueError as e:
raise asab.exceptions.ValidationError(
"{!r} must be either a number or a duration string.".format(k)) from e
upsertor.set(k, v)

await upsertor.execute(event_type=EventTypes.CLIENT_UPDATED)
Expand Down

0 comments on commit 3d46d30

Please sign in to comment.