Skip to content

Commit a7e6d9c

Browse files
committed
users: Rework users management based on experience for improved UI/UX
Add invite-only onboarding and user management CLI - add invite/accept flows with JWT tokens and email templates - introduce usermanager helper script with multi-instance config - update docs for invite-only flow and CLI usage - add tests for invites and event handling tweaks Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
1 parent 52b94b2 commit a7e6d9c

20 files changed

Lines changed: 1282 additions & 119 deletions

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ Generate a new key for [Authentication](https://docs.kernelci.org/api_pipeline/a
3131
After that, please refer to [create and add a user](https://docs.kernelci.org/api_pipeline/api/local-instance/#create-an-admin-user-account) in Mongo DB.
3232
The user can also generate an [API token](https://docs.kernelci.org/api_pipeline/api/local-instance/#create-an-admin-pipeline-token) to use API endpoints.
3333

34+
For simple user management (invite, accept, login, whoami), use the helper
35+
script `scripts/usermanager.py`. It accepts an optional
36+
`usermanager.toml` config file (including multiple instances) or
37+
`KCI_API_URL` / `KCI_API_TOKEN` / `KCI_API_INSTANCE` environment variables.
38+
3439
Ultimately, there will be a web frontend to provide a login form. We don't
3540
have that yet as this new KernelCI API implementation is still in its early
3641
stages.

api/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class AuthSettings(BaseSettings):
1616
algorithm: str = "HS256"
1717
# Set to None so tokens don't expire
1818
access_token_expire_seconds: float = 315360000
19+
invite_token_expire_seconds: int = 60 * 60 * 24 * 7 # 7 days
20+
public_base_url: str | None = None
1921

2022

2123
# pylint: disable=too-few-public-methods

0 commit comments

Comments
 (0)