Repository navigation
Expand file tree
/
Copy pathapi_key.py
More file actions
85 lines (55 loc) · 2.08 KB
/
Copy pathapi_key.py
File metadata and controls
85 lines (55 loc) · 2.08 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
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Optional
from datetime import datetime
from .._models import BaseModel
__all__ = ["APIKey", "CreatedBy", "Policy", "PolicyStatement"]
class CreatedBy(BaseModel):
id: str
"""Kernel user ID of the creator."""
email: str
"""Email address of the creator."""
name: Optional[str] = None
"""Display name of the creator, if available."""
class PolicyStatement(BaseModel):
action: str
"""Permitted action, such as browsers:use or vaults:read."""
resource: str
"""Resource the action applies to, in the format projects/{project_id}/{kind}/{id}.
Wildcards are supported.
"""
class Policy(BaseModel):
"""Permissions granted to a scoped API key.
Absent for an ordinary key, which keeps unrestricted access within its organization or project.
"""
statements: List[PolicyStatement]
"""Allow statements. Every action and resource not listed is denied."""
class APIKey(BaseModel):
id: str
"""Unique API key identifier"""
created_at: datetime
"""When the API key was created"""
created_by: CreatedBy
deleted_at: Optional[datetime] = None
"""When the API key was deleted (soft-deleted).
Null for keys that have not been deleted.
"""
expires_at: Optional[datetime] = None
"""When the API key expires"""
masked_key: str
"""Masked version of the API key"""
name: str
"""Label for the API key.
API keys are not addressable by name; use the ID or key identifier for stable
references.
"""
project_id: Optional[str] = None
"""Project identifier for project-scoped API keys. Null means org-wide."""
project_name: Optional[str] = None
"""Project name for project-scoped API keys.
Null means the key is org-wide or the project name is unavailable.
"""
policy: Optional[Policy] = None
"""Permissions granted to a scoped API key.
Absent for an ordinary key, which keeps unrestricted access within its
organization or project.
"""