Commit Graph

31 Commits

Author SHA1 Message Date
Sam Dornan
7c2b049b70 chore(mypy): drop warn_return_any and validate provider responses with strict JSON (#4826) 2026-09-26 20:13:55 -04:00
zurdi
d9d65d8b56 refactor(audit): apply the pr-ready simplify pass
- record() takes the request as its actor, and a target can be a
  function: the lookups that name it now run inside the recorder's error
  handling, and for downloads only once the dedupe lets them record.
  That also restores the minimal visibility query on the file route.
- One changed_fields/change pair for rom, user, collection and platform
  edits, one collection helper, AuditActor.anonymous, a shared
  count_in_window and current_device_id, one test helper for recorded
  events and one fixture for audit events.
- The describers share simple/counted/visibility builders and the
  eventData readers with notifications, join lists per locale, and treat
  any *.delete as unlinked.
- EventLog builds one item list with the phase folded in, keeps each
  event's sentence across pages, formats days once, and loads users
  through the users store.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 02:45:12 +02:00
zurdi
01483dd715 fix: disconnect a session's sockets when it is revoked
A socket joins its user's room, and an admin's the admin room, once at
connect time, so logging out or revoking a user's sessions left their open
sockets receiving notifications and the log stream. Each socket is now
recorded against the login session that opened it, and removing a session
disconnects those sockets on whichever worker holds them.

The main server takes one disconnect handler, so it moves next to the
connect handler and runs the activity cleanup as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 14:23:39 +02:00
zurdi
78eef900b9 feat: update logs endpoint to require 'logs.read' scope and adjust related authorization checks 2026-06-20 09:55:10 +00:00
Georges-Antoine Assi
f107dc2752 changes from bot rview 2026-03-22 17:17:14 -04:00
Georges-Antoine Assi
c61f52ebed clean create web device 2026-03-15 20:25:38 -04:00
Georges-Antoine Assi
e1b07cacfc make devices actually unique 2026-03-15 20:09:33 -04:00
Georges-Antoine Assi
29112b4ddc create device on login web 2026-03-15 11:25:39 -04:00
Zurdi
4b9e76f550 backend structure refactor 2024-01-12 23:44:27 +01:00
Zurdi
eea7e41940 docstrings added to endpoints + organized imports + formatted code 2024-01-09 16:22:31 +01:00
Georges-Antoine Assi
3965ca1997 Add basic auth + fix tests and typing 2023-08-23 11:21:01 -04:00
zurdi
f4f936f624 user avatar and enable/disable user support added 2023-08-23 14:16:31 +02:00
Georges-Antoine Assi
92c505fcac First round of self cleanup 2023-08-18 21:12:31 -04:00
Georges-Antoine Assi
b92844ba80 Microfixes + get edit working 2023-08-18 10:03:34 -04:00
zurdi
5f598443eb starlette CSRFMiddleware import fixed 2023-08-18 12:17:43 +02:00
Georges-Antoine Assi
0b5a09d53f Add test for rom endpoint 2023-08-13 14:10:27 -04:00
Georges-Antoine Assi
6e87522f96 Add tests for platform 2023-08-13 12:44:23 -04:00
Georges-Antoine Assi
da4c318f6c Add tests for auth utils 2023-08-13 11:10:59 -04:00
Georges-Antoine Assi
9d0d7f7631 Fix bad jwt tokens 2023-08-12 22:15:24 -04:00
Georges-Antoine Assi
5943489f51 Oauth scheme and security list 2023-08-12 21:46:32 -04:00
Georges-Antoine Assi
8c39b8dbe6 Use random secrets for cors and middleware 2023-08-12 10:10:12 -04:00
Georges-Antoine Assi
590ea89972 Place auth behind flag 2023-08-11 13:42:16 -04:00
Georges-Antoine Assi
a5256dfe01 Move secret key to env variable 2023-08-11 13:02:13 -04:00
Georges-Antoine Assi
1b510d5499 Split oauth endpoint 2023-08-11 10:47:12 -04:00
Georges-Antoine Assi
8d41a87659 Add csrf token check 2023-08-11 09:47:10 -04:00
Georges-Antoine Assi
6cf6f6ca78 Implement refresh tokens 2023-08-11 00:30:30 -04:00
Georges-Antoine Assi
a8a402d250 Add scopes and roles 2023-08-10 23:37:05 -04:00
Georges-Antoine Assi
b2ca819c16 Add session middlware + redis back auth 2023-08-10 09:58:51 -04:00
Georges-Antoine Assi
cb306d3099 Working authentication via starlette 2023-08-10 00:06:25 -04:00
Georges-Antoine Assi
32a79ac52d Switch to cookie based auth 2023-08-09 22:48:38 -04:00
Georges-Antoine Assi
9c3bc6b842 Add jwt based auth 2023-08-09 22:15:05 -04:00