-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathauth_context.py
More file actions
98 lines (64 loc) · 2.58 KB
/
Copy pathauth_context.py
File metadata and controls
98 lines (64 loc) · 2.58 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Optional
from typing_extensions import Literal
from ..._models import BaseModel
__all__ = [
"AuthContext",
"Authentication",
"Authorization",
"AuthorizationCredentialScope",
"AuthorizationEffectiveScope",
"Organization",
"Principal",
]
class Authentication(BaseModel):
credential_id: Optional[str] = None
"""
The API key ID when authenticated with an API key; null for session credentials.
"""
method: Literal["api_key", "jwt"]
"""The credential format used to authenticate the request."""
source: Literal["api_key", "oauth", "dashboard"]
"""The source classification resolved by authentication middleware."""
class AuthorizationCredentialScope(BaseModel):
"""A scope within the authenticated organization.
A null project_id represents organization-wide scope.
"""
project_id: Optional[str] = None
"""The Kernel project ID, or null when the scope is organization-wide."""
class AuthorizationEffectiveScope(BaseModel):
"""A scope within the authenticated organization.
A null project_id represents organization-wide scope.
"""
project_id: Optional[str] = None
"""The Kernel project ID, or null when the scope is organization-wide."""
class Authorization(BaseModel):
"""The credential's maximum scope and the effective scope selected for this request.
Future permission data can be added without changing scope semantics.
"""
credential_scope: AuthorizationCredentialScope
"""A scope within the authenticated organization.
A null project_id represents organization-wide scope.
"""
effective_scope: AuthorizationEffectiveScope
"""A scope within the authenticated organization.
A null project_id represents organization-wide scope.
"""
class Organization(BaseModel):
id: str
"""The authenticated Kernel organization ID."""
class Principal(BaseModel):
id: str
"""The API key ID for API-key principals or user ID for user principals."""
type: Literal["api_key", "user"]
"""The kind of principal authenticated for the request."""
class AuthContext(BaseModel):
"""The identity and authorization context resolved for the current request."""
authentication: Authentication
authorization: Authorization
"""The credential's maximum scope and the effective scope selected for this
request.
Future permission data can be added without changing scope semantics.
"""
organization: Organization
principal: Principal