Commit Graph
35 Commits
Author SHA1 Message Date
YueGuobin 3ddfe0254d api: add endpoint returning the current user's privileges
Add GET /access/users/me/privileges. It returns the effective privileges
of the logged in user, flattened across all roles assigned to the user
(directly or through group membership). Superadmins get the full
privilege list.

This gives clients a way to render their UI based on permissions. The
server stays the authority for permission checks: a privilege in the
list can still be denied on a specific resource path.
2026-11-05 23:05:28 +08:00
Mark Paronyan fcfa968cc5 feat(api): return token lifetimes and document API keys as bearer tokens 2026-10-07 14:18:18 +03:00
Mark Paronyan b46b9a1d26 style: sort imports in api tests 2026-10-02 12:43:26 +03:00
Mark Paronyan a0450b6bce refactor: ruff autofixes 2026-09-27 15:55:10 +03:00
YueGuobin 0e8d0cb87b Add stateless JWT refresh token mechanism
- New config: Controller.jwt_refresh_token_expire_minutes (default 30 days)
- New endpoint: POST /v3/access/users/refresh (public, unauthenticated)
- Login/authenticate responses now include refresh_token
- AuthService: _create_token helper, create_refresh_token, get_token_data
  now parses type claim (token_use) for token classification
- Security: refresh tokens rejected on HTTP + WebSocket access paths;
  /refresh strictly requires type=='refresh'
- Logout works for free via existing token_version mechanism
- Tests: 9 new TestRefreshToken cases, all passing; 34 existing tests
  still pass (no regressions)
2026-06-23 22:39:11 +08:00
grossmj d97aedb625 Fix tests 2026-04-06 20:03:38 +08:00
UmmmAGoodName 4cf8b79692 Fix addressing issue #2005 including tests 2026-04-05 21:51:52 +02:00
UmmmAGoodName 4a45a68703 Changed errors to new type, was causing warnings 2026-03-11 18:48:36 +01:00
grossmj 47a7324eb5 Fix tests 2026-02-25 19:00:57 +08:00
grossmj 1d45df6613 Upgrade dependencies 2026-01-24 21:38:58 +08:00
grossmj ba4e0c945d Refactor tests and upgrade dev package requirements 2025-01-17 19:12:44 +10:00
grossmj 9d6cea665a Replace python-jose library by joserfc 2024-12-30 15:25:24 +07:00
grossmj ae538dd11d Fix test user with wrong creds 2024-10-31 19:31:17 +10:00
grossmj ce4dd17409 Upgrade fastapi and fix tests 2024-10-31 19:23:28 +10:00
grossmj 0077fd98aa Add required privileges to all endpoints 2023-09-02 17:54:24 +07:00
grossmj 60ce1172e0 Use an ACL table to check for privileges 2023-08-27 18:20:42 +10:00
grossmj 9c456532d0 Pydantic v2 migration 2023-08-04 18:20:06 +10:00
grossmj 86c44cd6e7 Upgrade dev dependencies and fix tests to support pytest-asyncio strict mode 2022-08-24 21:03:16 +02:00
grossmj f4b67f2e59 Allow auth token to be passed as a URL param 2022-07-11 14:19:47 +02:00
grossmj 07d4892faf Check if user has the right to add a permission 2021-08-19 14:47:48 +09:30
grossmj 6dd0f4d4d3 Allow logged in user to change some of its data. Administrators can lock users using the is_active field. 2021-08-09 16:36:18 +09:30
grossmj d65b49acaa Add user permissions + RBAC tests. 2021-06-03 15:40:12 +09:30
grossmj fbc47598d9 Basic functional RBAC support. 2021-05-27 17:28:44 +09:30
grossmj 8810249d36 Add user groups support. 2021-05-15 15:10:02 +09:30
grossmj ad7d8e2e7d Fix tests. 2021-04-28 15:56:11 +09:30
grossmj 0465cb87f6 Protect the API and add alternative authentication endpoint. 2021-04-20 11:59:02 +09:30
grossmj e28452f09a Secure users API and handle manual password recovery. 2021-04-19 09:40:04 +09:30
grossmj c03226e368 Add default super admin account in controller db. 2021-04-18 17:39:47 +09:30
grossmj 6b8ce8219c Fix tests. 2021-04-15 18:30:22 +09:30
grossmj 30ebae207f Use Pydantic to validate the server config file. 2021-04-12 17:02:23 +09:30
grossmj 170e83e589 Fix tests and update requirements 2021-04-05 17:43:35 +09:30
grossmj 58c1b01439 Add default JWT secret key and fix tests. 2020-12-18 16:51:54 +10:30
grossmj bde706d19a Generate JWT secret key if none is configured in the config file.
Change location of the database.
2020-12-16 18:24:21 +10:30
grossmj d47dcb0d6f User authentication with tests. 2020-12-07 16:52:36 +10:30
grossmj bf7cf862af Refactor tests and start work on database integration. 2020-12-02 18:39:08 +10:30