scalekit-sdk-python 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- buf/__init__.py +0 -0
- buf/validate/__init__.py +0 -0
- buf/validate/expression_pb2.py +31 -0
- buf/validate/expression_pb2.pyi +34 -0
- buf/validate/expression_pb2_grpc.py +4 -0
- buf/validate/priv/__init__.py +0 -0
- buf/validate/priv/private_pb2.py +30 -0
- buf/validate/priv/private_pb2.pyi +25 -0
- buf/validate/priv/private_pb2_grpc.py +4 -0
- buf/validate/validate_pb2.py +402 -0
- buf/validate/validate_pb2.pyi +503 -0
- buf/validate/validate_pb2_grpc.py +4 -0
- scalekit/__init__.py +4 -0
- scalekit/client.py +143 -0
- scalekit/common/__init__.py +0 -0
- scalekit/common/scalekit.py +49 -0
- scalekit/common/user.py +75 -0
- scalekit/connection.py +103 -0
- scalekit/constants/__init__.py +0 -0
- scalekit/constants/user.py +21 -0
- scalekit/core.py +169 -0
- scalekit/domain.py +73 -0
- scalekit/organization.py +181 -0
- scalekit/v1/__init__.py +0 -0
- scalekit/v1/clients/__init__.py +0 -0
- scalekit/v1/clients/clients_pb2.py +103 -0
- scalekit/v1/clients/clients_pb2.pyi +156 -0
- scalekit/v1/clients/clients_pb2_grpc.py +232 -0
- scalekit/v1/commons/__init__.py +0 -0
- scalekit/v1/commons/commons_pb2.py +36 -0
- scalekit/v1/commons/commons_pb2.pyi +30 -0
- scalekit/v1/commons/commons_pb2_grpc.py +4 -0
- scalekit/v1/connections/__init__.py +0 -0
- scalekit/v1/connections/connections_pb2.py +355 -0
- scalekit/v1/connections/connections_pb2.pyi +526 -0
- scalekit/v1/connections/connections_pb2_grpc.py +265 -0
- scalekit/v1/domains/__init__.py +0 -0
- scalekit/v1/domains/domains_pb2.py +92 -0
- scalekit/v1/domains/domains_pb2.pyi +153 -0
- scalekit/v1/domains/domains_pb2_grpc.py +199 -0
- scalekit/v1/environments/__init__.py +0 -0
- scalekit/v1/environments/environments_pb2.py +171 -0
- scalekit/v1/environments/environments_pb2.pyi +241 -0
- scalekit/v1/environments/environments_pb2_grpc.py +463 -0
- scalekit/v1/errdetails/__init__.py +0 -0
- scalekit/v1/errdetails/errdetails_pb2.py +44 -0
- scalekit/v1/errdetails/errdetails_pb2.pyi +89 -0
- scalekit/v1/errdetails/errdetails_pb2_grpc.py +4 -0
- scalekit/v1/events/__init__.py +0 -0
- scalekit/v1/events/events_pb2.py +39 -0
- scalekit/v1/events/events_pb2.pyi +62 -0
- scalekit/v1/events/events_pb2_grpc.py +4 -0
- scalekit/v1/members/__init__.py +0 -0
- scalekit/v1/members/members_pb2.py +105 -0
- scalekit/v1/members/members_pb2.pyi +142 -0
- scalekit/v1/members/members_pb2_grpc.py +271 -0
- scalekit/v1/options/__init__.py +0 -0
- scalekit/v1/options/options_pb2.py +30 -0
- scalekit/v1/options/options_pb2.pyi +44 -0
- scalekit/v1/options/options_pb2_grpc.py +4 -0
- scalekit/v1/organizations/__init__.py +0 -0
- scalekit/v1/organizations/organizations_pb2.py +168 -0
- scalekit/v1/organizations/organizations_pb2.pyi +190 -0
- scalekit/v1/organizations/organizations_pb2_grpc.py +301 -0
- scalekit/v1/users/__init__.py +0 -0
- scalekit/v1/users/users_pb2.py +97 -0
- scalekit/v1/users/users_pb2.pyi +136 -0
- scalekit/v1/users/users_pb2_grpc.py +199 -0
- scalekit/v1/workspaces/__init__.py +0 -0
- scalekit/v1/workspaces/workspaces_pb2.py +90 -0
- scalekit/v1/workspaces/workspaces_pb2.pyi +102 -0
- scalekit/v1/workspaces/workspaces_pb2_grpc.py +198 -0
- scalekit_sdk_python-1.0.0.dist-info/LICENSE +21 -0
- scalekit_sdk_python-1.0.0.dist-info/METADATA +67 -0
- scalekit_sdk_python-1.0.0.dist-info/RECORD +77 -0
- scalekit_sdk_python-1.0.0.dist-info/WHEEL +5 -0
- scalekit_sdk_python-1.0.0.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
from buf.validate import expression_pb2 as _expression_pb2
|
|
2
|
+
from buf.validate.priv import private_pb2 as _private_pb2
|
|
3
|
+
from google.protobuf import descriptor_pb2 as _descriptor_pb2
|
|
4
|
+
from google.protobuf import duration_pb2 as _duration_pb2
|
|
5
|
+
from google.protobuf import timestamp_pb2 as _timestamp_pb2
|
|
6
|
+
from google.protobuf.internal import containers as _containers
|
|
7
|
+
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
|
|
8
|
+
from google.protobuf import descriptor as _descriptor
|
|
9
|
+
from google.protobuf import message as _message
|
|
10
|
+
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
|
|
11
|
+
|
|
12
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
13
|
+
|
|
14
|
+
class Ignore(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
15
|
+
__slots__ = ()
|
|
16
|
+
IGNORE_UNSPECIFIED: _ClassVar[Ignore]
|
|
17
|
+
IGNORE_IF_UNPOPULATED: _ClassVar[Ignore]
|
|
18
|
+
IGNORE_IF_DEFAULT_VALUE: _ClassVar[Ignore]
|
|
19
|
+
IGNORE_ALWAYS: _ClassVar[Ignore]
|
|
20
|
+
IGNORE_EMPTY: _ClassVar[Ignore]
|
|
21
|
+
IGNORE_DEFAULT: _ClassVar[Ignore]
|
|
22
|
+
|
|
23
|
+
class KnownRegex(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
24
|
+
__slots__ = ()
|
|
25
|
+
KNOWN_REGEX_UNSPECIFIED: _ClassVar[KnownRegex]
|
|
26
|
+
KNOWN_REGEX_HTTP_HEADER_NAME: _ClassVar[KnownRegex]
|
|
27
|
+
KNOWN_REGEX_HTTP_HEADER_VALUE: _ClassVar[KnownRegex]
|
|
28
|
+
IGNORE_UNSPECIFIED: Ignore
|
|
29
|
+
IGNORE_IF_UNPOPULATED: Ignore
|
|
30
|
+
IGNORE_IF_DEFAULT_VALUE: Ignore
|
|
31
|
+
IGNORE_ALWAYS: Ignore
|
|
32
|
+
IGNORE_EMPTY: Ignore
|
|
33
|
+
IGNORE_DEFAULT: Ignore
|
|
34
|
+
KNOWN_REGEX_UNSPECIFIED: KnownRegex
|
|
35
|
+
KNOWN_REGEX_HTTP_HEADER_NAME: KnownRegex
|
|
36
|
+
KNOWN_REGEX_HTTP_HEADER_VALUE: KnownRegex
|
|
37
|
+
MESSAGE_FIELD_NUMBER: _ClassVar[int]
|
|
38
|
+
message: _descriptor.FieldDescriptor
|
|
39
|
+
ONEOF_FIELD_NUMBER: _ClassVar[int]
|
|
40
|
+
oneof: _descriptor.FieldDescriptor
|
|
41
|
+
FIELD_FIELD_NUMBER: _ClassVar[int]
|
|
42
|
+
field: _descriptor.FieldDescriptor
|
|
43
|
+
|
|
44
|
+
class MessageConstraints(_message.Message):
|
|
45
|
+
__slots__ = ("disabled", "cel")
|
|
46
|
+
DISABLED_FIELD_NUMBER: _ClassVar[int]
|
|
47
|
+
CEL_FIELD_NUMBER: _ClassVar[int]
|
|
48
|
+
disabled: bool
|
|
49
|
+
cel: _containers.RepeatedCompositeFieldContainer[_expression_pb2.Constraint]
|
|
50
|
+
def __init__(self, disabled: bool = ..., cel: _Optional[_Iterable[_Union[_expression_pb2.Constraint, _Mapping]]] = ...) -> None: ...
|
|
51
|
+
|
|
52
|
+
class OneofConstraints(_message.Message):
|
|
53
|
+
__slots__ = ("required",)
|
|
54
|
+
REQUIRED_FIELD_NUMBER: _ClassVar[int]
|
|
55
|
+
required: bool
|
|
56
|
+
def __init__(self, required: bool = ...) -> None: ...
|
|
57
|
+
|
|
58
|
+
class FieldConstraints(_message.Message):
|
|
59
|
+
__slots__ = ("cel", "required", "ignore", "float", "double", "int32", "int64", "uint32", "uint64", "sint32", "sint64", "fixed32", "fixed64", "sfixed32", "sfixed64", "bool", "string", "bytes", "enum", "repeated", "map", "any", "duration", "timestamp", "skipped", "ignore_empty")
|
|
60
|
+
CEL_FIELD_NUMBER: _ClassVar[int]
|
|
61
|
+
REQUIRED_FIELD_NUMBER: _ClassVar[int]
|
|
62
|
+
IGNORE_FIELD_NUMBER: _ClassVar[int]
|
|
63
|
+
FLOAT_FIELD_NUMBER: _ClassVar[int]
|
|
64
|
+
DOUBLE_FIELD_NUMBER: _ClassVar[int]
|
|
65
|
+
INT32_FIELD_NUMBER: _ClassVar[int]
|
|
66
|
+
INT64_FIELD_NUMBER: _ClassVar[int]
|
|
67
|
+
UINT32_FIELD_NUMBER: _ClassVar[int]
|
|
68
|
+
UINT64_FIELD_NUMBER: _ClassVar[int]
|
|
69
|
+
SINT32_FIELD_NUMBER: _ClassVar[int]
|
|
70
|
+
SINT64_FIELD_NUMBER: _ClassVar[int]
|
|
71
|
+
FIXED32_FIELD_NUMBER: _ClassVar[int]
|
|
72
|
+
FIXED64_FIELD_NUMBER: _ClassVar[int]
|
|
73
|
+
SFIXED32_FIELD_NUMBER: _ClassVar[int]
|
|
74
|
+
SFIXED64_FIELD_NUMBER: _ClassVar[int]
|
|
75
|
+
BOOL_FIELD_NUMBER: _ClassVar[int]
|
|
76
|
+
STRING_FIELD_NUMBER: _ClassVar[int]
|
|
77
|
+
BYTES_FIELD_NUMBER: _ClassVar[int]
|
|
78
|
+
ENUM_FIELD_NUMBER: _ClassVar[int]
|
|
79
|
+
REPEATED_FIELD_NUMBER: _ClassVar[int]
|
|
80
|
+
MAP_FIELD_NUMBER: _ClassVar[int]
|
|
81
|
+
ANY_FIELD_NUMBER: _ClassVar[int]
|
|
82
|
+
DURATION_FIELD_NUMBER: _ClassVar[int]
|
|
83
|
+
TIMESTAMP_FIELD_NUMBER: _ClassVar[int]
|
|
84
|
+
SKIPPED_FIELD_NUMBER: _ClassVar[int]
|
|
85
|
+
IGNORE_EMPTY_FIELD_NUMBER: _ClassVar[int]
|
|
86
|
+
cel: _containers.RepeatedCompositeFieldContainer[_expression_pb2.Constraint]
|
|
87
|
+
required: bool
|
|
88
|
+
ignore: Ignore
|
|
89
|
+
float: FloatRules
|
|
90
|
+
double: DoubleRules
|
|
91
|
+
int32: Int32Rules
|
|
92
|
+
int64: Int64Rules
|
|
93
|
+
uint32: UInt32Rules
|
|
94
|
+
uint64: UInt64Rules
|
|
95
|
+
sint32: SInt32Rules
|
|
96
|
+
sint64: SInt64Rules
|
|
97
|
+
fixed32: Fixed32Rules
|
|
98
|
+
fixed64: Fixed64Rules
|
|
99
|
+
sfixed32: SFixed32Rules
|
|
100
|
+
sfixed64: SFixed64Rules
|
|
101
|
+
bool: BoolRules
|
|
102
|
+
string: StringRules
|
|
103
|
+
bytes: BytesRules
|
|
104
|
+
enum: EnumRules
|
|
105
|
+
repeated: RepeatedRules
|
|
106
|
+
map: MapRules
|
|
107
|
+
any: AnyRules
|
|
108
|
+
duration: DurationRules
|
|
109
|
+
timestamp: TimestampRules
|
|
110
|
+
skipped: bool
|
|
111
|
+
ignore_empty: bool
|
|
112
|
+
def __init__(self, cel: _Optional[_Iterable[_Union[_expression_pb2.Constraint, _Mapping]]] = ..., required: bool = ..., ignore: _Optional[_Union[Ignore, str]] = ..., float: _Optional[_Union[FloatRules, _Mapping]] = ..., double: _Optional[_Union[DoubleRules, _Mapping]] = ..., int32: _Optional[_Union[Int32Rules, _Mapping]] = ..., int64: _Optional[_Union[Int64Rules, _Mapping]] = ..., uint32: _Optional[_Union[UInt32Rules, _Mapping]] = ..., uint64: _Optional[_Union[UInt64Rules, _Mapping]] = ..., sint32: _Optional[_Union[SInt32Rules, _Mapping]] = ..., sint64: _Optional[_Union[SInt64Rules, _Mapping]] = ..., fixed32: _Optional[_Union[Fixed32Rules, _Mapping]] = ..., fixed64: _Optional[_Union[Fixed64Rules, _Mapping]] = ..., sfixed32: _Optional[_Union[SFixed32Rules, _Mapping]] = ..., sfixed64: _Optional[_Union[SFixed64Rules, _Mapping]] = ..., bool: _Optional[_Union[BoolRules, _Mapping]] = ..., string: _Optional[_Union[StringRules, _Mapping]] = ..., bytes: _Optional[_Union[BytesRules, _Mapping]] = ..., enum: _Optional[_Union[EnumRules, _Mapping]] = ..., repeated: _Optional[_Union[RepeatedRules, _Mapping]] = ..., map: _Optional[_Union[MapRules, _Mapping]] = ..., any: _Optional[_Union[AnyRules, _Mapping]] = ..., duration: _Optional[_Union[DurationRules, _Mapping]] = ..., timestamp: _Optional[_Union[TimestampRules, _Mapping]] = ..., skipped: bool = ..., ignore_empty: bool = ...) -> None: ...
|
|
113
|
+
|
|
114
|
+
class FloatRules(_message.Message):
|
|
115
|
+
__slots__ = ("const", "lt", "lte", "gt", "gte", "not_in", "finite")
|
|
116
|
+
CONST_FIELD_NUMBER: _ClassVar[int]
|
|
117
|
+
LT_FIELD_NUMBER: _ClassVar[int]
|
|
118
|
+
LTE_FIELD_NUMBER: _ClassVar[int]
|
|
119
|
+
GT_FIELD_NUMBER: _ClassVar[int]
|
|
120
|
+
GTE_FIELD_NUMBER: _ClassVar[int]
|
|
121
|
+
IN_FIELD_NUMBER: _ClassVar[int]
|
|
122
|
+
NOT_IN_FIELD_NUMBER: _ClassVar[int]
|
|
123
|
+
FINITE_FIELD_NUMBER: _ClassVar[int]
|
|
124
|
+
const: float
|
|
125
|
+
lt: float
|
|
126
|
+
lte: float
|
|
127
|
+
gt: float
|
|
128
|
+
gte: float
|
|
129
|
+
not_in: _containers.RepeatedScalarFieldContainer[float]
|
|
130
|
+
finite: bool
|
|
131
|
+
def __init__(self, const: _Optional[float] = ..., lt: _Optional[float] = ..., lte: _Optional[float] = ..., gt: _Optional[float] = ..., gte: _Optional[float] = ..., not_in: _Optional[_Iterable[float]] = ..., finite: bool = ..., **kwargs) -> None: ...
|
|
132
|
+
|
|
133
|
+
class DoubleRules(_message.Message):
|
|
134
|
+
__slots__ = ("const", "lt", "lte", "gt", "gte", "not_in", "finite")
|
|
135
|
+
CONST_FIELD_NUMBER: _ClassVar[int]
|
|
136
|
+
LT_FIELD_NUMBER: _ClassVar[int]
|
|
137
|
+
LTE_FIELD_NUMBER: _ClassVar[int]
|
|
138
|
+
GT_FIELD_NUMBER: _ClassVar[int]
|
|
139
|
+
GTE_FIELD_NUMBER: _ClassVar[int]
|
|
140
|
+
IN_FIELD_NUMBER: _ClassVar[int]
|
|
141
|
+
NOT_IN_FIELD_NUMBER: _ClassVar[int]
|
|
142
|
+
FINITE_FIELD_NUMBER: _ClassVar[int]
|
|
143
|
+
const: float
|
|
144
|
+
lt: float
|
|
145
|
+
lte: float
|
|
146
|
+
gt: float
|
|
147
|
+
gte: float
|
|
148
|
+
not_in: _containers.RepeatedScalarFieldContainer[float]
|
|
149
|
+
finite: bool
|
|
150
|
+
def __init__(self, const: _Optional[float] = ..., lt: _Optional[float] = ..., lte: _Optional[float] = ..., gt: _Optional[float] = ..., gte: _Optional[float] = ..., not_in: _Optional[_Iterable[float]] = ..., finite: bool = ..., **kwargs) -> None: ...
|
|
151
|
+
|
|
152
|
+
class Int32Rules(_message.Message):
|
|
153
|
+
__slots__ = ("const", "lt", "lte", "gt", "gte", "not_in")
|
|
154
|
+
CONST_FIELD_NUMBER: _ClassVar[int]
|
|
155
|
+
LT_FIELD_NUMBER: _ClassVar[int]
|
|
156
|
+
LTE_FIELD_NUMBER: _ClassVar[int]
|
|
157
|
+
GT_FIELD_NUMBER: _ClassVar[int]
|
|
158
|
+
GTE_FIELD_NUMBER: _ClassVar[int]
|
|
159
|
+
IN_FIELD_NUMBER: _ClassVar[int]
|
|
160
|
+
NOT_IN_FIELD_NUMBER: _ClassVar[int]
|
|
161
|
+
const: int
|
|
162
|
+
lt: int
|
|
163
|
+
lte: int
|
|
164
|
+
gt: int
|
|
165
|
+
gte: int
|
|
166
|
+
not_in: _containers.RepeatedScalarFieldContainer[int]
|
|
167
|
+
def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., **kwargs) -> None: ...
|
|
168
|
+
|
|
169
|
+
class Int64Rules(_message.Message):
|
|
170
|
+
__slots__ = ("const", "lt", "lte", "gt", "gte", "not_in")
|
|
171
|
+
CONST_FIELD_NUMBER: _ClassVar[int]
|
|
172
|
+
LT_FIELD_NUMBER: _ClassVar[int]
|
|
173
|
+
LTE_FIELD_NUMBER: _ClassVar[int]
|
|
174
|
+
GT_FIELD_NUMBER: _ClassVar[int]
|
|
175
|
+
GTE_FIELD_NUMBER: _ClassVar[int]
|
|
176
|
+
IN_FIELD_NUMBER: _ClassVar[int]
|
|
177
|
+
NOT_IN_FIELD_NUMBER: _ClassVar[int]
|
|
178
|
+
const: int
|
|
179
|
+
lt: int
|
|
180
|
+
lte: int
|
|
181
|
+
gt: int
|
|
182
|
+
gte: int
|
|
183
|
+
not_in: _containers.RepeatedScalarFieldContainer[int]
|
|
184
|
+
def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., **kwargs) -> None: ...
|
|
185
|
+
|
|
186
|
+
class UInt32Rules(_message.Message):
|
|
187
|
+
__slots__ = ("const", "lt", "lte", "gt", "gte", "not_in")
|
|
188
|
+
CONST_FIELD_NUMBER: _ClassVar[int]
|
|
189
|
+
LT_FIELD_NUMBER: _ClassVar[int]
|
|
190
|
+
LTE_FIELD_NUMBER: _ClassVar[int]
|
|
191
|
+
GT_FIELD_NUMBER: _ClassVar[int]
|
|
192
|
+
GTE_FIELD_NUMBER: _ClassVar[int]
|
|
193
|
+
IN_FIELD_NUMBER: _ClassVar[int]
|
|
194
|
+
NOT_IN_FIELD_NUMBER: _ClassVar[int]
|
|
195
|
+
const: int
|
|
196
|
+
lt: int
|
|
197
|
+
lte: int
|
|
198
|
+
gt: int
|
|
199
|
+
gte: int
|
|
200
|
+
not_in: _containers.RepeatedScalarFieldContainer[int]
|
|
201
|
+
def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., **kwargs) -> None: ...
|
|
202
|
+
|
|
203
|
+
class UInt64Rules(_message.Message):
|
|
204
|
+
__slots__ = ("const", "lt", "lte", "gt", "gte", "not_in")
|
|
205
|
+
CONST_FIELD_NUMBER: _ClassVar[int]
|
|
206
|
+
LT_FIELD_NUMBER: _ClassVar[int]
|
|
207
|
+
LTE_FIELD_NUMBER: _ClassVar[int]
|
|
208
|
+
GT_FIELD_NUMBER: _ClassVar[int]
|
|
209
|
+
GTE_FIELD_NUMBER: _ClassVar[int]
|
|
210
|
+
IN_FIELD_NUMBER: _ClassVar[int]
|
|
211
|
+
NOT_IN_FIELD_NUMBER: _ClassVar[int]
|
|
212
|
+
const: int
|
|
213
|
+
lt: int
|
|
214
|
+
lte: int
|
|
215
|
+
gt: int
|
|
216
|
+
gte: int
|
|
217
|
+
not_in: _containers.RepeatedScalarFieldContainer[int]
|
|
218
|
+
def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., **kwargs) -> None: ...
|
|
219
|
+
|
|
220
|
+
class SInt32Rules(_message.Message):
|
|
221
|
+
__slots__ = ("const", "lt", "lte", "gt", "gte", "not_in")
|
|
222
|
+
CONST_FIELD_NUMBER: _ClassVar[int]
|
|
223
|
+
LT_FIELD_NUMBER: _ClassVar[int]
|
|
224
|
+
LTE_FIELD_NUMBER: _ClassVar[int]
|
|
225
|
+
GT_FIELD_NUMBER: _ClassVar[int]
|
|
226
|
+
GTE_FIELD_NUMBER: _ClassVar[int]
|
|
227
|
+
IN_FIELD_NUMBER: _ClassVar[int]
|
|
228
|
+
NOT_IN_FIELD_NUMBER: _ClassVar[int]
|
|
229
|
+
const: int
|
|
230
|
+
lt: int
|
|
231
|
+
lte: int
|
|
232
|
+
gt: int
|
|
233
|
+
gte: int
|
|
234
|
+
not_in: _containers.RepeatedScalarFieldContainer[int]
|
|
235
|
+
def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., **kwargs) -> None: ...
|
|
236
|
+
|
|
237
|
+
class SInt64Rules(_message.Message):
|
|
238
|
+
__slots__ = ("const", "lt", "lte", "gt", "gte", "not_in")
|
|
239
|
+
CONST_FIELD_NUMBER: _ClassVar[int]
|
|
240
|
+
LT_FIELD_NUMBER: _ClassVar[int]
|
|
241
|
+
LTE_FIELD_NUMBER: _ClassVar[int]
|
|
242
|
+
GT_FIELD_NUMBER: _ClassVar[int]
|
|
243
|
+
GTE_FIELD_NUMBER: _ClassVar[int]
|
|
244
|
+
IN_FIELD_NUMBER: _ClassVar[int]
|
|
245
|
+
NOT_IN_FIELD_NUMBER: _ClassVar[int]
|
|
246
|
+
const: int
|
|
247
|
+
lt: int
|
|
248
|
+
lte: int
|
|
249
|
+
gt: int
|
|
250
|
+
gte: int
|
|
251
|
+
not_in: _containers.RepeatedScalarFieldContainer[int]
|
|
252
|
+
def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., **kwargs) -> None: ...
|
|
253
|
+
|
|
254
|
+
class Fixed32Rules(_message.Message):
|
|
255
|
+
__slots__ = ("const", "lt", "lte", "gt", "gte", "not_in")
|
|
256
|
+
CONST_FIELD_NUMBER: _ClassVar[int]
|
|
257
|
+
LT_FIELD_NUMBER: _ClassVar[int]
|
|
258
|
+
LTE_FIELD_NUMBER: _ClassVar[int]
|
|
259
|
+
GT_FIELD_NUMBER: _ClassVar[int]
|
|
260
|
+
GTE_FIELD_NUMBER: _ClassVar[int]
|
|
261
|
+
IN_FIELD_NUMBER: _ClassVar[int]
|
|
262
|
+
NOT_IN_FIELD_NUMBER: _ClassVar[int]
|
|
263
|
+
const: int
|
|
264
|
+
lt: int
|
|
265
|
+
lte: int
|
|
266
|
+
gt: int
|
|
267
|
+
gte: int
|
|
268
|
+
not_in: _containers.RepeatedScalarFieldContainer[int]
|
|
269
|
+
def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., **kwargs) -> None: ...
|
|
270
|
+
|
|
271
|
+
class Fixed64Rules(_message.Message):
|
|
272
|
+
__slots__ = ("const", "lt", "lte", "gt", "gte", "not_in")
|
|
273
|
+
CONST_FIELD_NUMBER: _ClassVar[int]
|
|
274
|
+
LT_FIELD_NUMBER: _ClassVar[int]
|
|
275
|
+
LTE_FIELD_NUMBER: _ClassVar[int]
|
|
276
|
+
GT_FIELD_NUMBER: _ClassVar[int]
|
|
277
|
+
GTE_FIELD_NUMBER: _ClassVar[int]
|
|
278
|
+
IN_FIELD_NUMBER: _ClassVar[int]
|
|
279
|
+
NOT_IN_FIELD_NUMBER: _ClassVar[int]
|
|
280
|
+
const: int
|
|
281
|
+
lt: int
|
|
282
|
+
lte: int
|
|
283
|
+
gt: int
|
|
284
|
+
gte: int
|
|
285
|
+
not_in: _containers.RepeatedScalarFieldContainer[int]
|
|
286
|
+
def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., **kwargs) -> None: ...
|
|
287
|
+
|
|
288
|
+
class SFixed32Rules(_message.Message):
|
|
289
|
+
__slots__ = ("const", "lt", "lte", "gt", "gte", "not_in")
|
|
290
|
+
CONST_FIELD_NUMBER: _ClassVar[int]
|
|
291
|
+
LT_FIELD_NUMBER: _ClassVar[int]
|
|
292
|
+
LTE_FIELD_NUMBER: _ClassVar[int]
|
|
293
|
+
GT_FIELD_NUMBER: _ClassVar[int]
|
|
294
|
+
GTE_FIELD_NUMBER: _ClassVar[int]
|
|
295
|
+
IN_FIELD_NUMBER: _ClassVar[int]
|
|
296
|
+
NOT_IN_FIELD_NUMBER: _ClassVar[int]
|
|
297
|
+
const: int
|
|
298
|
+
lt: int
|
|
299
|
+
lte: int
|
|
300
|
+
gt: int
|
|
301
|
+
gte: int
|
|
302
|
+
not_in: _containers.RepeatedScalarFieldContainer[int]
|
|
303
|
+
def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., **kwargs) -> None: ...
|
|
304
|
+
|
|
305
|
+
class SFixed64Rules(_message.Message):
|
|
306
|
+
__slots__ = ("const", "lt", "lte", "gt", "gte", "not_in")
|
|
307
|
+
CONST_FIELD_NUMBER: _ClassVar[int]
|
|
308
|
+
LT_FIELD_NUMBER: _ClassVar[int]
|
|
309
|
+
LTE_FIELD_NUMBER: _ClassVar[int]
|
|
310
|
+
GT_FIELD_NUMBER: _ClassVar[int]
|
|
311
|
+
GTE_FIELD_NUMBER: _ClassVar[int]
|
|
312
|
+
IN_FIELD_NUMBER: _ClassVar[int]
|
|
313
|
+
NOT_IN_FIELD_NUMBER: _ClassVar[int]
|
|
314
|
+
const: int
|
|
315
|
+
lt: int
|
|
316
|
+
lte: int
|
|
317
|
+
gt: int
|
|
318
|
+
gte: int
|
|
319
|
+
not_in: _containers.RepeatedScalarFieldContainer[int]
|
|
320
|
+
def __init__(self, const: _Optional[int] = ..., lt: _Optional[int] = ..., lte: _Optional[int] = ..., gt: _Optional[int] = ..., gte: _Optional[int] = ..., not_in: _Optional[_Iterable[int]] = ..., **kwargs) -> None: ...
|
|
321
|
+
|
|
322
|
+
class BoolRules(_message.Message):
|
|
323
|
+
__slots__ = ("const",)
|
|
324
|
+
CONST_FIELD_NUMBER: _ClassVar[int]
|
|
325
|
+
const: bool
|
|
326
|
+
def __init__(self, const: bool = ...) -> None: ...
|
|
327
|
+
|
|
328
|
+
class StringRules(_message.Message):
|
|
329
|
+
__slots__ = ("const", "len", "min_len", "max_len", "len_bytes", "min_bytes", "max_bytes", "pattern", "prefix", "suffix", "contains", "not_contains", "not_in", "email", "hostname", "ip", "ipv4", "ipv6", "uri", "uri_ref", "address", "uuid", "tuuid", "ip_with_prefixlen", "ipv4_with_prefixlen", "ipv6_with_prefixlen", "ip_prefix", "ipv4_prefix", "ipv6_prefix", "host_and_port", "well_known_regex", "strict")
|
|
330
|
+
CONST_FIELD_NUMBER: _ClassVar[int]
|
|
331
|
+
LEN_FIELD_NUMBER: _ClassVar[int]
|
|
332
|
+
MIN_LEN_FIELD_NUMBER: _ClassVar[int]
|
|
333
|
+
MAX_LEN_FIELD_NUMBER: _ClassVar[int]
|
|
334
|
+
LEN_BYTES_FIELD_NUMBER: _ClassVar[int]
|
|
335
|
+
MIN_BYTES_FIELD_NUMBER: _ClassVar[int]
|
|
336
|
+
MAX_BYTES_FIELD_NUMBER: _ClassVar[int]
|
|
337
|
+
PATTERN_FIELD_NUMBER: _ClassVar[int]
|
|
338
|
+
PREFIX_FIELD_NUMBER: _ClassVar[int]
|
|
339
|
+
SUFFIX_FIELD_NUMBER: _ClassVar[int]
|
|
340
|
+
CONTAINS_FIELD_NUMBER: _ClassVar[int]
|
|
341
|
+
NOT_CONTAINS_FIELD_NUMBER: _ClassVar[int]
|
|
342
|
+
IN_FIELD_NUMBER: _ClassVar[int]
|
|
343
|
+
NOT_IN_FIELD_NUMBER: _ClassVar[int]
|
|
344
|
+
EMAIL_FIELD_NUMBER: _ClassVar[int]
|
|
345
|
+
HOSTNAME_FIELD_NUMBER: _ClassVar[int]
|
|
346
|
+
IP_FIELD_NUMBER: _ClassVar[int]
|
|
347
|
+
IPV4_FIELD_NUMBER: _ClassVar[int]
|
|
348
|
+
IPV6_FIELD_NUMBER: _ClassVar[int]
|
|
349
|
+
URI_FIELD_NUMBER: _ClassVar[int]
|
|
350
|
+
URI_REF_FIELD_NUMBER: _ClassVar[int]
|
|
351
|
+
ADDRESS_FIELD_NUMBER: _ClassVar[int]
|
|
352
|
+
UUID_FIELD_NUMBER: _ClassVar[int]
|
|
353
|
+
TUUID_FIELD_NUMBER: _ClassVar[int]
|
|
354
|
+
IP_WITH_PREFIXLEN_FIELD_NUMBER: _ClassVar[int]
|
|
355
|
+
IPV4_WITH_PREFIXLEN_FIELD_NUMBER: _ClassVar[int]
|
|
356
|
+
IPV6_WITH_PREFIXLEN_FIELD_NUMBER: _ClassVar[int]
|
|
357
|
+
IP_PREFIX_FIELD_NUMBER: _ClassVar[int]
|
|
358
|
+
IPV4_PREFIX_FIELD_NUMBER: _ClassVar[int]
|
|
359
|
+
IPV6_PREFIX_FIELD_NUMBER: _ClassVar[int]
|
|
360
|
+
HOST_AND_PORT_FIELD_NUMBER: _ClassVar[int]
|
|
361
|
+
WELL_KNOWN_REGEX_FIELD_NUMBER: _ClassVar[int]
|
|
362
|
+
STRICT_FIELD_NUMBER: _ClassVar[int]
|
|
363
|
+
const: str
|
|
364
|
+
len: int
|
|
365
|
+
min_len: int
|
|
366
|
+
max_len: int
|
|
367
|
+
len_bytes: int
|
|
368
|
+
min_bytes: int
|
|
369
|
+
max_bytes: int
|
|
370
|
+
pattern: str
|
|
371
|
+
prefix: str
|
|
372
|
+
suffix: str
|
|
373
|
+
contains: str
|
|
374
|
+
not_contains: str
|
|
375
|
+
not_in: _containers.RepeatedScalarFieldContainer[str]
|
|
376
|
+
email: bool
|
|
377
|
+
hostname: bool
|
|
378
|
+
ip: bool
|
|
379
|
+
ipv4: bool
|
|
380
|
+
ipv6: bool
|
|
381
|
+
uri: bool
|
|
382
|
+
uri_ref: bool
|
|
383
|
+
address: bool
|
|
384
|
+
uuid: bool
|
|
385
|
+
tuuid: bool
|
|
386
|
+
ip_with_prefixlen: bool
|
|
387
|
+
ipv4_with_prefixlen: bool
|
|
388
|
+
ipv6_with_prefixlen: bool
|
|
389
|
+
ip_prefix: bool
|
|
390
|
+
ipv4_prefix: bool
|
|
391
|
+
ipv6_prefix: bool
|
|
392
|
+
host_and_port: bool
|
|
393
|
+
well_known_regex: KnownRegex
|
|
394
|
+
strict: bool
|
|
395
|
+
def __init__(self, const: _Optional[str] = ..., len: _Optional[int] = ..., min_len: _Optional[int] = ..., max_len: _Optional[int] = ..., len_bytes: _Optional[int] = ..., min_bytes: _Optional[int] = ..., max_bytes: _Optional[int] = ..., pattern: _Optional[str] = ..., prefix: _Optional[str] = ..., suffix: _Optional[str] = ..., contains: _Optional[str] = ..., not_contains: _Optional[str] = ..., not_in: _Optional[_Iterable[str]] = ..., email: bool = ..., hostname: bool = ..., ip: bool = ..., ipv4: bool = ..., ipv6: bool = ..., uri: bool = ..., uri_ref: bool = ..., address: bool = ..., uuid: bool = ..., tuuid: bool = ..., ip_with_prefixlen: bool = ..., ipv4_with_prefixlen: bool = ..., ipv6_with_prefixlen: bool = ..., ip_prefix: bool = ..., ipv4_prefix: bool = ..., ipv6_prefix: bool = ..., host_and_port: bool = ..., well_known_regex: _Optional[_Union[KnownRegex, str]] = ..., strict: bool = ..., **kwargs) -> None: ...
|
|
396
|
+
|
|
397
|
+
class BytesRules(_message.Message):
|
|
398
|
+
__slots__ = ("const", "len", "min_len", "max_len", "pattern", "prefix", "suffix", "contains", "not_in", "ip", "ipv4", "ipv6")
|
|
399
|
+
CONST_FIELD_NUMBER: _ClassVar[int]
|
|
400
|
+
LEN_FIELD_NUMBER: _ClassVar[int]
|
|
401
|
+
MIN_LEN_FIELD_NUMBER: _ClassVar[int]
|
|
402
|
+
MAX_LEN_FIELD_NUMBER: _ClassVar[int]
|
|
403
|
+
PATTERN_FIELD_NUMBER: _ClassVar[int]
|
|
404
|
+
PREFIX_FIELD_NUMBER: _ClassVar[int]
|
|
405
|
+
SUFFIX_FIELD_NUMBER: _ClassVar[int]
|
|
406
|
+
CONTAINS_FIELD_NUMBER: _ClassVar[int]
|
|
407
|
+
IN_FIELD_NUMBER: _ClassVar[int]
|
|
408
|
+
NOT_IN_FIELD_NUMBER: _ClassVar[int]
|
|
409
|
+
IP_FIELD_NUMBER: _ClassVar[int]
|
|
410
|
+
IPV4_FIELD_NUMBER: _ClassVar[int]
|
|
411
|
+
IPV6_FIELD_NUMBER: _ClassVar[int]
|
|
412
|
+
const: bytes
|
|
413
|
+
len: int
|
|
414
|
+
min_len: int
|
|
415
|
+
max_len: int
|
|
416
|
+
pattern: str
|
|
417
|
+
prefix: bytes
|
|
418
|
+
suffix: bytes
|
|
419
|
+
contains: bytes
|
|
420
|
+
not_in: _containers.RepeatedScalarFieldContainer[bytes]
|
|
421
|
+
ip: bool
|
|
422
|
+
ipv4: bool
|
|
423
|
+
ipv6: bool
|
|
424
|
+
def __init__(self, const: _Optional[bytes] = ..., len: _Optional[int] = ..., min_len: _Optional[int] = ..., max_len: _Optional[int] = ..., pattern: _Optional[str] = ..., prefix: _Optional[bytes] = ..., suffix: _Optional[bytes] = ..., contains: _Optional[bytes] = ..., not_in: _Optional[_Iterable[bytes]] = ..., ip: bool = ..., ipv4: bool = ..., ipv6: bool = ..., **kwargs) -> None: ...
|
|
425
|
+
|
|
426
|
+
class EnumRules(_message.Message):
|
|
427
|
+
__slots__ = ("const", "defined_only", "not_in")
|
|
428
|
+
CONST_FIELD_NUMBER: _ClassVar[int]
|
|
429
|
+
DEFINED_ONLY_FIELD_NUMBER: _ClassVar[int]
|
|
430
|
+
IN_FIELD_NUMBER: _ClassVar[int]
|
|
431
|
+
NOT_IN_FIELD_NUMBER: _ClassVar[int]
|
|
432
|
+
const: int
|
|
433
|
+
defined_only: bool
|
|
434
|
+
not_in: _containers.RepeatedScalarFieldContainer[int]
|
|
435
|
+
def __init__(self, const: _Optional[int] = ..., defined_only: bool = ..., not_in: _Optional[_Iterable[int]] = ..., **kwargs) -> None: ...
|
|
436
|
+
|
|
437
|
+
class RepeatedRules(_message.Message):
|
|
438
|
+
__slots__ = ("min_items", "max_items", "unique", "items")
|
|
439
|
+
MIN_ITEMS_FIELD_NUMBER: _ClassVar[int]
|
|
440
|
+
MAX_ITEMS_FIELD_NUMBER: _ClassVar[int]
|
|
441
|
+
UNIQUE_FIELD_NUMBER: _ClassVar[int]
|
|
442
|
+
ITEMS_FIELD_NUMBER: _ClassVar[int]
|
|
443
|
+
min_items: int
|
|
444
|
+
max_items: int
|
|
445
|
+
unique: bool
|
|
446
|
+
items: FieldConstraints
|
|
447
|
+
def __init__(self, min_items: _Optional[int] = ..., max_items: _Optional[int] = ..., unique: bool = ..., items: _Optional[_Union[FieldConstraints, _Mapping]] = ...) -> None: ...
|
|
448
|
+
|
|
449
|
+
class MapRules(_message.Message):
|
|
450
|
+
__slots__ = ("min_pairs", "max_pairs", "keys", "values")
|
|
451
|
+
MIN_PAIRS_FIELD_NUMBER: _ClassVar[int]
|
|
452
|
+
MAX_PAIRS_FIELD_NUMBER: _ClassVar[int]
|
|
453
|
+
KEYS_FIELD_NUMBER: _ClassVar[int]
|
|
454
|
+
VALUES_FIELD_NUMBER: _ClassVar[int]
|
|
455
|
+
min_pairs: int
|
|
456
|
+
max_pairs: int
|
|
457
|
+
keys: FieldConstraints
|
|
458
|
+
values: FieldConstraints
|
|
459
|
+
def __init__(self, min_pairs: _Optional[int] = ..., max_pairs: _Optional[int] = ..., keys: _Optional[_Union[FieldConstraints, _Mapping]] = ..., values: _Optional[_Union[FieldConstraints, _Mapping]] = ...) -> None: ...
|
|
460
|
+
|
|
461
|
+
class AnyRules(_message.Message):
|
|
462
|
+
__slots__ = ("not_in",)
|
|
463
|
+
IN_FIELD_NUMBER: _ClassVar[int]
|
|
464
|
+
NOT_IN_FIELD_NUMBER: _ClassVar[int]
|
|
465
|
+
not_in: _containers.RepeatedScalarFieldContainer[str]
|
|
466
|
+
def __init__(self, not_in: _Optional[_Iterable[str]] = ..., **kwargs) -> None: ...
|
|
467
|
+
|
|
468
|
+
class DurationRules(_message.Message):
|
|
469
|
+
__slots__ = ("const", "lt", "lte", "gt", "gte", "not_in")
|
|
470
|
+
CONST_FIELD_NUMBER: _ClassVar[int]
|
|
471
|
+
LT_FIELD_NUMBER: _ClassVar[int]
|
|
472
|
+
LTE_FIELD_NUMBER: _ClassVar[int]
|
|
473
|
+
GT_FIELD_NUMBER: _ClassVar[int]
|
|
474
|
+
GTE_FIELD_NUMBER: _ClassVar[int]
|
|
475
|
+
IN_FIELD_NUMBER: _ClassVar[int]
|
|
476
|
+
NOT_IN_FIELD_NUMBER: _ClassVar[int]
|
|
477
|
+
const: _duration_pb2.Duration
|
|
478
|
+
lt: _duration_pb2.Duration
|
|
479
|
+
lte: _duration_pb2.Duration
|
|
480
|
+
gt: _duration_pb2.Duration
|
|
481
|
+
gte: _duration_pb2.Duration
|
|
482
|
+
not_in: _containers.RepeatedCompositeFieldContainer[_duration_pb2.Duration]
|
|
483
|
+
def __init__(self, const: _Optional[_Union[_duration_pb2.Duration, _Mapping]] = ..., lt: _Optional[_Union[_duration_pb2.Duration, _Mapping]] = ..., lte: _Optional[_Union[_duration_pb2.Duration, _Mapping]] = ..., gt: _Optional[_Union[_duration_pb2.Duration, _Mapping]] = ..., gte: _Optional[_Union[_duration_pb2.Duration, _Mapping]] = ..., not_in: _Optional[_Iterable[_Union[_duration_pb2.Duration, _Mapping]]] = ..., **kwargs) -> None: ...
|
|
484
|
+
|
|
485
|
+
class TimestampRules(_message.Message):
|
|
486
|
+
__slots__ = ("const", "lt", "lte", "lt_now", "gt", "gte", "gt_now", "within")
|
|
487
|
+
CONST_FIELD_NUMBER: _ClassVar[int]
|
|
488
|
+
LT_FIELD_NUMBER: _ClassVar[int]
|
|
489
|
+
LTE_FIELD_NUMBER: _ClassVar[int]
|
|
490
|
+
LT_NOW_FIELD_NUMBER: _ClassVar[int]
|
|
491
|
+
GT_FIELD_NUMBER: _ClassVar[int]
|
|
492
|
+
GTE_FIELD_NUMBER: _ClassVar[int]
|
|
493
|
+
GT_NOW_FIELD_NUMBER: _ClassVar[int]
|
|
494
|
+
WITHIN_FIELD_NUMBER: _ClassVar[int]
|
|
495
|
+
const: _timestamp_pb2.Timestamp
|
|
496
|
+
lt: _timestamp_pb2.Timestamp
|
|
497
|
+
lte: _timestamp_pb2.Timestamp
|
|
498
|
+
lt_now: bool
|
|
499
|
+
gt: _timestamp_pb2.Timestamp
|
|
500
|
+
gte: _timestamp_pb2.Timestamp
|
|
501
|
+
gt_now: bool
|
|
502
|
+
within: _duration_pb2.Duration
|
|
503
|
+
def __init__(self, const: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., lt: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., lte: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., lt_now: bool = ..., gt: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., gte: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., gt_now: bool = ..., within: _Optional[_Union[_duration_pb2.Duration, _Mapping]] = ...) -> None: ...
|
scalekit/__init__.py
ADDED
scalekit/client.py
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from urllib.parse import urlencode
|
|
3
|
+
|
|
4
|
+
import jwt
|
|
5
|
+
from scalekit.core import CoreClient
|
|
6
|
+
from scalekit.domain import DomainClient
|
|
7
|
+
from scalekit.connection import ConnectionClient
|
|
8
|
+
from scalekit.organization import OrganizationClient
|
|
9
|
+
from scalekit.common.scalekit import (
|
|
10
|
+
AuthorizationUrlOptions,
|
|
11
|
+
CodeAuthenticationOptions,
|
|
12
|
+
GrantType,
|
|
13
|
+
)
|
|
14
|
+
from scalekit.constants.user import id_token_claim_to_user_map
|
|
15
|
+
|
|
16
|
+
AUTHORIZE_ENDPOINT = "oauth/authorize"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ScalekitClient:
|
|
20
|
+
""" """
|
|
21
|
+
|
|
22
|
+
def __init__(self, env_url: str, client_id: str, client_secret: str):
|
|
23
|
+
"""
|
|
24
|
+
Initializer for Scalekit base class
|
|
25
|
+
|
|
26
|
+
:param env_url : Environment URL
|
|
27
|
+
:type : ``` str ```
|
|
28
|
+
:param client_id : Client ID
|
|
29
|
+
:type : ``` str ```
|
|
30
|
+
:param client_secret : Client Secret
|
|
31
|
+
:type : ``` str ```
|
|
32
|
+
:returns
|
|
33
|
+
None
|
|
34
|
+
"""
|
|
35
|
+
try:
|
|
36
|
+
self.core_client = CoreClient(
|
|
37
|
+
env_url=env_url, client_id=client_id, client_secret=client_secret
|
|
38
|
+
)
|
|
39
|
+
self.domain = DomainClient(self.core_client)
|
|
40
|
+
self.connection = ConnectionClient(self.core_client)
|
|
41
|
+
self.organization = OrganizationClient(self.core_client)
|
|
42
|
+
except Exception as exp:
|
|
43
|
+
raise exp
|
|
44
|
+
|
|
45
|
+
def get_authorization_url(
|
|
46
|
+
self, redirect_uri: str, options: AuthorizationUrlOptions | None
|
|
47
|
+
):
|
|
48
|
+
"""
|
|
49
|
+
Method to get authorization URL
|
|
50
|
+
|
|
51
|
+
:param redirect_uri : Redirect URI for SAML SSO
|
|
52
|
+
:type : ``` str ```
|
|
53
|
+
:param options : ``` Auth URL options object```
|
|
54
|
+
:type : ``` obj ```
|
|
55
|
+
:returns
|
|
56
|
+
Authorization URL
|
|
57
|
+
"""
|
|
58
|
+
try:
|
|
59
|
+
scopes = (
|
|
60
|
+
options.scopes if options.scopes else ["openid", "profile", "email"]
|
|
61
|
+
)
|
|
62
|
+
query_string = urlencode(
|
|
63
|
+
{
|
|
64
|
+
"response_type": "code",
|
|
65
|
+
"client_id": self.core_client.client_id,
|
|
66
|
+
"redirect_uri": redirect_uri,
|
|
67
|
+
"scope": " ".join(scopes),
|
|
68
|
+
"state": options.state,
|
|
69
|
+
"nonce": options.nonce,
|
|
70
|
+
"login_hint": options.login_hint,
|
|
71
|
+
"domain_hint": options.domain_hint,
|
|
72
|
+
"connection_id": options.connection_id,
|
|
73
|
+
"organization_id": options.organization_id,
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
return f"{self.core_client.env_url}/{AUTHORIZE_ENDPOINT}?{query_string}"
|
|
78
|
+
except Exception as exp:
|
|
79
|
+
raise exp
|
|
80
|
+
|
|
81
|
+
def authenticate_with_code(
|
|
82
|
+
self, code, redirect_uri, options: CodeAuthenticationOptions
|
|
83
|
+
):
|
|
84
|
+
"""
|
|
85
|
+
Method to authenticate with code options
|
|
86
|
+
|
|
87
|
+
:param code : authorization_code
|
|
88
|
+
:type : ``` str ```
|
|
89
|
+
:param redirect_uri : Redirect URI
|
|
90
|
+
:type : ``` str ```
|
|
91
|
+
:param options : ``` CodeAuthenticationOptions Object ```
|
|
92
|
+
:type : ``` obj ```
|
|
93
|
+
:returns:
|
|
94
|
+
dict with user, id token & access token
|
|
95
|
+
"""
|
|
96
|
+
try:
|
|
97
|
+
response = self.core_client.authenticate(
|
|
98
|
+
json.dumps(
|
|
99
|
+
{
|
|
100
|
+
"code": code,
|
|
101
|
+
"redirect_uri": redirect_uri,
|
|
102
|
+
"grant_type": GrantType.AuthorizationCode.value,
|
|
103
|
+
"client_id": self.core_client.client_id,
|
|
104
|
+
"client_secret": self.core_client.client_secret,
|
|
105
|
+
"code_verifier": options.code_verifier,
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
)
|
|
109
|
+
response = json.loads(response.content)
|
|
110
|
+
id_token = response["id_token"]
|
|
111
|
+
access_token = response["access_token"]
|
|
112
|
+
|
|
113
|
+
self.core_client.get_jwks()
|
|
114
|
+
kid = jwt.get_unverified_header(id_token)["kid"]
|
|
115
|
+
key = self.core_client.keys[kid]
|
|
116
|
+
claims = jwt.decode(
|
|
117
|
+
id_token, key=key, algorithms="RS256", options={"verify_aud": False}
|
|
118
|
+
)
|
|
119
|
+
user = {}
|
|
120
|
+
for k, v in claims.items():
|
|
121
|
+
if id_token_claim_to_user_map.get(k, None):
|
|
122
|
+
user[id_token_claim_to_user_map[k]] = v
|
|
123
|
+
|
|
124
|
+
return {"user": user, "id_token": id_token, "access_token": access_token}
|
|
125
|
+
|
|
126
|
+
except Exception as exp:
|
|
127
|
+
raise exp
|
|
128
|
+
|
|
129
|
+
def validate_access_token(self, token: str) -> bool:
|
|
130
|
+
"""
|
|
131
|
+
Method to validate access token
|
|
132
|
+
|
|
133
|
+
:param token : access token
|
|
134
|
+
:type : ``` str ```
|
|
135
|
+
:returns
|
|
136
|
+
bool
|
|
137
|
+
"""
|
|
138
|
+
self.core_client.get_jwks()
|
|
139
|
+
try:
|
|
140
|
+
jwt.decode(token, self.core_client.keys)
|
|
141
|
+
return True
|
|
142
|
+
except jwt.exceptions.InvalidTokenError:
|
|
143
|
+
return False
|
|
File without changes
|