mirror of
https://github.com/hansjone/netx.git
synced 2026-10-11 01:43:21 +08:00
Harden auth scopes, SQL/WebCRT gates, and per-install JWT secrets.
Add capability RBAC, Alembic bootstrap, optional worker schedulers, and close public docs by default so lab installs stay usable without shared signing keys. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
cb8e0d23c5
commit
633a9d55bd
38 changed files with 1808 additions and 452 deletions
|
|
@ -19,12 +19,14 @@ class UserCreateRequest(BaseModel):
|
|||
username: str = Field(min_length=2, max_length=64)
|
||||
password: str = Field(min_length=6, max_length=256)
|
||||
role: str = Field(default="user")
|
||||
scopes: list[str] | None = None
|
||||
|
||||
|
||||
class UserUpdateRequest(BaseModel):
|
||||
is_active: bool | None = None
|
||||
role: str | None = None
|
||||
password: str | None = Field(default=None, min_length=6, max_length=256)
|
||||
scopes: list[str] | None = None
|
||||
|
||||
|
||||
class ApiTokenCreateRequest(BaseModel):
|
||||
|
|
@ -33,3 +35,5 @@ class ApiTokenCreateRequest(BaseModel):
|
|||
expires_in_days: int | None = Field(default=90, ge=0, le=3650)
|
||||
# Admin may create a token for another user; others ignored / forced to self.
|
||||
user_id: str | None = None
|
||||
# Capability subset; empty inherits owner scopes.
|
||||
scopes: list[str] | None = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue