more admin stuff 2
This commit is contained in:
@ -18,6 +18,13 @@ HOSTNAME_LABEL_RE = re.compile(r"^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$")
|
||||
ROLE_NAME = Literal[
|
||||
"ssh_connect", "rdp_connect", "file_transfer", "clipboard",
|
||||
"session_recording_view", "admin_hostgroup",
|
||||
# Hinzugefuegt fuer RBAC-Erweiterung 'Credentials ins RBAC-Modell' (Migration
|
||||
# 0008_credentials_roles.sql): erlaubt Nicht-Admins mit dieser Rolle auf
|
||||
# einer Hostgruppe gezielten Zugriff auf Zugangsdaten (SSH-Keys, RDP-
|
||||
# Passwoerter) der Hosts dieser Gruppe, siehe app/auth/deps.py::
|
||||
# require_admin_scope_or_host_role und admin/routes.py (rdp-credentials,
|
||||
# ssh-keys-Zuordnung, GET /admin/hosts/{id}/credentials).
|
||||
"credentials_view", "credentials_manage",
|
||||
]
|
||||
|
||||
|
||||
@ -146,7 +153,7 @@ class HostUpdateRequest(BaseModel):
|
||||
class RoleGrantRequest(BaseModel):
|
||||
user_id: int
|
||||
host_group_id: int
|
||||
role_names: list[ROLE_NAME] = Field(min_length=1, max_length=6)
|
||||
role_names: list[ROLE_NAME] = Field(min_length=1, max_length=8)
|
||||
expires_at: str | None = None
|
||||
|
||||
|
||||
@ -174,7 +181,7 @@ class GroupMemberRequest(BaseModel):
|
||||
class GroupRoleGrantRequest(BaseModel):
|
||||
user_group_id: int
|
||||
host_group_id: int
|
||||
role_names: list[ROLE_NAME] = Field(min_length=1, max_length=6)
|
||||
role_names: list[ROLE_NAME] = Field(min_length=1, max_length=8)
|
||||
expires_at: str | None = None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user