-
Notifications
You must be signed in to change notification settings - Fork 179
Expand file tree
/
Copy pathpath.py
More file actions
81 lines (54 loc) · 2.33 KB
/
Copy pathpath.py
File metadata and controls
81 lines (54 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
"""
Path parameter DTOs for RBAC API endpoints.
Shared between Client SDK and Manager API.
"""
from __future__ import annotations
from uuid import UUID
from pydantic import Field
from ai.backend.common.api_handlers import BaseRequestModel
from ai.backend.common.data.permission.types import RBACElementType
__all__ = (
"DeleteObjectPermissionPathParam",
"DeletePermissionPathParam",
"GetRolePathParam",
"SearchEntitiesPathParam",
"SearchScopesPathParam",
"SearchUsersAssignedToRolePathParam",
"UpdateRolePathParam",
)
class GetRolePathParam(BaseRequestModel):
"""Path parameter for getting a role."""
role_id: UUID = Field(description="The role ID to retrieve")
class UpdateRolePathParam(BaseRequestModel):
"""Path parameter for updating a role."""
role_id: UUID = Field(description="The role ID to update")
class SearchUsersAssignedToRolePathParam(BaseRequestModel):
"""Path parameter for searching users assigned to a role."""
role_id: UUID = Field(description="The role ID to search assigned users for")
class DeletePermissionPathParam(BaseRequestModel):
"""Path parameter for deleting a permission."""
permission_id: UUID = Field(description="The permission ID to delete")
class DeleteObjectPermissionPathParam(BaseRequestModel):
"""Path parameter for deleting an object permission."""
object_permission_id: UUID = Field(description="The object permission ID to delete")
class SearchScopesPathParam(BaseRequestModel):
"""Path parameter for searching scopes.
``scope_type`` is ``None`` when the caller requests the GLOBAL scope,
which has no ``RBACElementType`` equivalent.
"""
scope_type: RBACElementType | None = Field(
description="Scope types", examples=["domain", "project", "user"]
)
class SearchEntitiesPathParam(BaseRequestModel):
"""Path parameter for searching entities within a scope."""
scope_type: RBACElementType = Field(
description="Scope type", examples=["domain", "project", "user"]
)
scope_id: str = Field(
description="Scope ID (domain name, project UUID, or user UUID)",
examples=["default", "550e8400-e29b-41d4-a716-446655440000"],
)
entity_type: RBACElementType = Field(
description="Entity type to search",
examples=["user", "vfolder", "session", "image"],
)