weave-python 0.26.1__py3-none-any.whl → 0.27.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.
- weave/weaveapi/auth/v1/service_pb2.py +228 -0
- weave/weaveapi/auth/v1/service_pb2.pyi +1406 -0
- weave/weaveapi/auth/v1/service_pb2_grpc.py +1091 -0
- weave/weaveapi/auth/v1/service_pb2_grpc.pyi +606 -0
- weave/weaveapi/auth/v1/session_pb2.py +38 -0
- weave/weaveapi/auth/v1/session_pb2.pyi +111 -0
- weave/weaveapi/auth/v1/session_pb2_grpc.py +2 -0
- weave/weaveapi/auth/v1/session_pb2_grpc.pyi +20 -0
- weave/weaveapi/auth/v1/usage_pb2.py +52 -0
- weave/weaveapi/auth/v1/usage_pb2.pyi +241 -0
- weave/weaveapi/auth/v1/usage_pb2_grpc.py +2 -0
- weave/weaveapi/auth/v1/usage_pb2_grpc.pyi +20 -0
- weave/weaveapi/auth/v1/user_pb2.py +52 -0
- weave/weaveapi/auth/v1/user_pb2.pyi +594 -0
- weave/weaveapi/auth/v1/user_pb2_grpc.py +2 -0
- weave/weaveapi/auth/v1/user_pb2_grpc.pyi +20 -0
- weave/weaveapi/generate/v1/configuration_pb2.py +3 -3
- weave/weaveapi/generate/v1/generate_pb2.py +2 -2
- weave/weaveapi/generate/v1/service_pb2.py +2 -2
- weave/weaveapi/mcpregistry/v1/server_pb2.py +2 -2
- weave/weaveapi/mcpregistry/v1/service_pb2.py +3 -3
- weave/weaveapi/modex/v1/model_pb2.py +58 -0
- weave/weaveapi/modex/v1/model_pb2.pyi +642 -0
- weave/weaveapi/modex/v1/model_pb2_grpc.py +2 -0
- weave/weaveapi/modex/v1/model_pb2_grpc.pyi +20 -0
- weave/weaveapi/modex/v1/provider_pb2.py +38 -0
- weave/weaveapi/modex/v1/provider_pb2.pyi +91 -0
- weave/weaveapi/modex/v1/provider_pb2_grpc.py +2 -0
- weave/weaveapi/modex/v1/provider_pb2_grpc.pyi +20 -0
- weave/weaveapi/modex/v1/service_pb2.py +180 -0
- weave/weaveapi/modex/v1/service_pb2.pyi +1641 -0
- weave/weaveapi/modex/v1/service_pb2_grpc.py +602 -0
- weave/weaveapi/modex/v1/service_pb2_grpc.pyi +268 -0
- weave/weaveapi/payment/v1/invoice_pb2.py +46 -0
- weave/weaveapi/payment/v1/invoice_pb2.pyi +349 -0
- weave/weaveapi/payment/v1/invoice_pb2_grpc.py +2 -0
- weave/weaveapi/payment/v1/invoice_pb2_grpc.pyi +20 -0
- weave/weaveapi/payment/v1/service_pb2.py +244 -0
- weave/weaveapi/payment/v1/service_pb2.pyi +1492 -0
- weave/weaveapi/payment/v1/service_pb2_grpc.py +957 -0
- weave/weaveapi/payment/v1/service_pb2_grpc.pyi +572 -0
- weave/weaveapi/payment/v1/subscription_pb2.py +59 -0
- weave/weaveapi/payment/v1/subscription_pb2.pyi +695 -0
- weave/weaveapi/payment/v1/subscription_pb2_grpc.py +2 -0
- weave/weaveapi/payment/v1/subscription_pb2_grpc.pyi +20 -0
- weave/weaveapi/storage/v1/auth_pb2.py +2 -2
- weave/weaveapi/storage/v1/nosql_database_pb2.py +3 -3
- weave/weaveapi/storage/v1/object_store_pb2.py +3 -3
- weave/weaveapi/storage/v1/service_pb2.py +2 -2
- weave/weaveapi/storage/v1/sql_database_pb2.py +3 -3
- weave/weaveapi/storage/v1/storage_pb2.py +2 -2
- weave/weaveapi/synthesize/v1/dataset_pb2.py +2 -2
- weave/weaveapi/synthesize/v1/inline_data_pb2.py +3 -3
- weave/weaveapi/synthesize/v1/relationship_pb2.py +3 -3
- weave/weaveapi/synthesize/v1/service_pb2.py +2 -2
- weave/weaveapi/synthesize/v1/training_pb2.py +3 -3
- weave/weavesql/{db → weavedb}/queries.py +1 -1
- {weave_python-0.26.1.dist-info → weave_python-0.27.0.dist-info}/METADATA +1 -1
- weave_python-0.27.0.dist-info/RECORD +109 -0
- weave_python-0.26.1.dist-info/RECORD +0 -69
- /weave/weavesql/{db → weavedb}/models.py +0 -0
- {weave_python-0.26.1.dist-info → weave_python-0.27.0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,606 @@
|
|
|
1
|
+
"""
|
|
2
|
+
@generated by mypy-protobuf. Do not edit manually!
|
|
3
|
+
isort:skip_file
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import abc
|
|
7
|
+
import collections.abc
|
|
8
|
+
import grpc
|
|
9
|
+
import grpc.aio
|
|
10
|
+
import typing
|
|
11
|
+
import weaveapi.auth.v1.service_pb2
|
|
12
|
+
|
|
13
|
+
_T = typing.TypeVar("_T")
|
|
14
|
+
|
|
15
|
+
class _MaybeAsyncIterator(
|
|
16
|
+
collections.abc.AsyncIterator[_T],
|
|
17
|
+
collections.abc.Iterator[_T],
|
|
18
|
+
metaclass=abc.ABCMeta,
|
|
19
|
+
): ...
|
|
20
|
+
class _ServicerContext(grpc.ServicerContext, grpc.aio.ServicerContext): # type: ignore[misc, type-arg]
|
|
21
|
+
...
|
|
22
|
+
|
|
23
|
+
class AuthStub:
|
|
24
|
+
"""Auth handles authentication and user management
|
|
25
|
+
OAuth endpoints (provider-agnostic)
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
def __init__(
|
|
29
|
+
self, channel: typing.Union[grpc.Channel, grpc.aio.Channel]
|
|
30
|
+
) -> None: ...
|
|
31
|
+
InitiateOAuth: grpc.UnaryUnaryMultiCallable[
|
|
32
|
+
weaveapi.auth.v1.service_pb2.InitiateOAuthRequest,
|
|
33
|
+
weaveapi.auth.v1.service_pb2.InitiateOAuthResponse,
|
|
34
|
+
]
|
|
35
|
+
"""Initiate OAuth flow for any supported provider"""
|
|
36
|
+
|
|
37
|
+
HandleOAuthCallback: grpc.UnaryUnaryMultiCallable[
|
|
38
|
+
weaveapi.auth.v1.service_pb2.HandleOAuthCallbackRequest,
|
|
39
|
+
weaveapi.auth.v1.service_pb2.HandleOAuthCallbackResponse,
|
|
40
|
+
]
|
|
41
|
+
"""Handle OAuth callback from any provider"""
|
|
42
|
+
|
|
43
|
+
GetOAuthProviders: grpc.UnaryUnaryMultiCallable[
|
|
44
|
+
weaveapi.auth.v1.service_pb2.GetOAuthProvidersRequest,
|
|
45
|
+
weaveapi.auth.v1.service_pb2.GetOAuthProvidersResponse,
|
|
46
|
+
]
|
|
47
|
+
"""Get list of supported OAuth providers"""
|
|
48
|
+
|
|
49
|
+
LinkOAuthProvider: grpc.UnaryUnaryMultiCallable[
|
|
50
|
+
weaveapi.auth.v1.service_pb2.LinkOAuthProviderRequest,
|
|
51
|
+
weaveapi.auth.v1.service_pb2.LinkOAuthProviderResponse,
|
|
52
|
+
]
|
|
53
|
+
"""Link additional OAuth provider to existing account"""
|
|
54
|
+
|
|
55
|
+
UnlinkOAuthProvider: grpc.UnaryUnaryMultiCallable[
|
|
56
|
+
weaveapi.auth.v1.service_pb2.UnlinkOAuthProviderRequest,
|
|
57
|
+
weaveapi.auth.v1.service_pb2.UnlinkOAuthProviderResponse,
|
|
58
|
+
]
|
|
59
|
+
"""Unlink OAuth provider from account"""
|
|
60
|
+
|
|
61
|
+
RefreshToken: grpc.UnaryUnaryMultiCallable[
|
|
62
|
+
weaveapi.auth.v1.service_pb2.RefreshTokenRequest,
|
|
63
|
+
weaveapi.auth.v1.service_pb2.RefreshTokenResponse,
|
|
64
|
+
]
|
|
65
|
+
"""Token management
|
|
66
|
+
|
|
67
|
+
Refresh access token
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
RevokeToken: grpc.UnaryUnaryMultiCallable[
|
|
71
|
+
weaveapi.auth.v1.service_pb2.RevokeTokenRequest,
|
|
72
|
+
weaveapi.auth.v1.service_pb2.RevokeTokenResponse,
|
|
73
|
+
]
|
|
74
|
+
"""Revoke refresh token (logout)"""
|
|
75
|
+
|
|
76
|
+
ValidateToken: grpc.UnaryUnaryMultiCallable[
|
|
77
|
+
weaveapi.auth.v1.service_pb2.ValidateTokenRequest,
|
|
78
|
+
weaveapi.auth.v1.service_pb2.ValidateTokenResponse,
|
|
79
|
+
]
|
|
80
|
+
"""Validate access token"""
|
|
81
|
+
|
|
82
|
+
GetCurrentUser: grpc.UnaryUnaryMultiCallable[
|
|
83
|
+
weaveapi.auth.v1.service_pb2.GetCurrentUserRequest,
|
|
84
|
+
weaveapi.auth.v1.service_pb2.GetCurrentUserResponse,
|
|
85
|
+
]
|
|
86
|
+
"""User management
|
|
87
|
+
|
|
88
|
+
Get current user profile
|
|
89
|
+
"""
|
|
90
|
+
|
|
91
|
+
UpdateUser: grpc.UnaryUnaryMultiCallable[
|
|
92
|
+
weaveapi.auth.v1.service_pb2.UpdateUserRequest,
|
|
93
|
+
weaveapi.auth.v1.service_pb2.UpdateUserResponse,
|
|
94
|
+
]
|
|
95
|
+
"""Update user profile"""
|
|
96
|
+
|
|
97
|
+
DeleteUser: grpc.UnaryUnaryMultiCallable[
|
|
98
|
+
weaveapi.auth.v1.service_pb2.DeleteUserRequest,
|
|
99
|
+
weaveapi.auth.v1.service_pb2.DeleteUserResponse,
|
|
100
|
+
]
|
|
101
|
+
"""Delete user account"""
|
|
102
|
+
|
|
103
|
+
ListAPIKeys: grpc.UnaryUnaryMultiCallable[
|
|
104
|
+
weaveapi.auth.v1.service_pb2.ListAPIKeysRequest,
|
|
105
|
+
weaveapi.auth.v1.service_pb2.ListAPIKeysResponse,
|
|
106
|
+
]
|
|
107
|
+
"""API Key management
|
|
108
|
+
|
|
109
|
+
List user's API keys
|
|
110
|
+
"""
|
|
111
|
+
|
|
112
|
+
CreateAPIKey: grpc.UnaryUnaryMultiCallable[
|
|
113
|
+
weaveapi.auth.v1.service_pb2.CreateAPIKeyRequest,
|
|
114
|
+
weaveapi.auth.v1.service_pb2.CreateAPIKeyResponse,
|
|
115
|
+
]
|
|
116
|
+
"""Create new API key"""
|
|
117
|
+
|
|
118
|
+
GetAPIKey: grpc.UnaryUnaryMultiCallable[
|
|
119
|
+
weaveapi.auth.v1.service_pb2.GetAPIKeyRequest,
|
|
120
|
+
weaveapi.auth.v1.service_pb2.GetAPIKeyResponse,
|
|
121
|
+
]
|
|
122
|
+
"""Get API key details"""
|
|
123
|
+
|
|
124
|
+
UpdateAPIKey: grpc.UnaryUnaryMultiCallable[
|
|
125
|
+
weaveapi.auth.v1.service_pb2.UpdateAPIKeyRequest,
|
|
126
|
+
weaveapi.auth.v1.service_pb2.UpdateAPIKeyResponse,
|
|
127
|
+
]
|
|
128
|
+
"""Update API key (rename, etc)"""
|
|
129
|
+
|
|
130
|
+
RevokeAPIKey: grpc.UnaryUnaryMultiCallable[
|
|
131
|
+
weaveapi.auth.v1.service_pb2.RevokeAPIKeyRequest,
|
|
132
|
+
weaveapi.auth.v1.service_pb2.RevokeAPIKeyResponse,
|
|
133
|
+
]
|
|
134
|
+
"""Revoke API key"""
|
|
135
|
+
|
|
136
|
+
ValidateAPIKey: grpc.UnaryUnaryMultiCallable[
|
|
137
|
+
weaveapi.auth.v1.service_pb2.ValidateAPIKeyRequest,
|
|
138
|
+
weaveapi.auth.v1.service_pb2.ValidateAPIKeyResponse,
|
|
139
|
+
]
|
|
140
|
+
"""Validate API key (for internal use)"""
|
|
141
|
+
|
|
142
|
+
GetUsageStats: grpc.UnaryUnaryMultiCallable[
|
|
143
|
+
weaveapi.auth.v1.service_pb2.GetUsageStatsRequest,
|
|
144
|
+
weaveapi.auth.v1.service_pb2.GetUsageStatsResponse,
|
|
145
|
+
]
|
|
146
|
+
"""Usage and limits
|
|
147
|
+
|
|
148
|
+
Get user's API usage statistics
|
|
149
|
+
"""
|
|
150
|
+
|
|
151
|
+
GetRateLimitStatus: grpc.UnaryUnaryMultiCallable[
|
|
152
|
+
weaveapi.auth.v1.service_pb2.GetRateLimitStatusRequest,
|
|
153
|
+
weaveapi.auth.v1.service_pb2.GetRateLimitStatusResponse,
|
|
154
|
+
]
|
|
155
|
+
"""Get rate limit status"""
|
|
156
|
+
|
|
157
|
+
ListSessions: grpc.UnaryUnaryMultiCallable[
|
|
158
|
+
weaveapi.auth.v1.service_pb2.ListSessionsRequest,
|
|
159
|
+
weaveapi.auth.v1.service_pb2.ListSessionsResponse,
|
|
160
|
+
]
|
|
161
|
+
"""Session management
|
|
162
|
+
|
|
163
|
+
List active sessions
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
RevokeSession: grpc.UnaryUnaryMultiCallable[
|
|
167
|
+
weaveapi.auth.v1.service_pb2.RevokeSessionRequest,
|
|
168
|
+
weaveapi.auth.v1.service_pb2.RevokeSessionResponse,
|
|
169
|
+
]
|
|
170
|
+
"""Revoke a specific session"""
|
|
171
|
+
|
|
172
|
+
RevokeAllSessions: grpc.UnaryUnaryMultiCallable[
|
|
173
|
+
weaveapi.auth.v1.service_pb2.RevokeAllSessionsRequest,
|
|
174
|
+
weaveapi.auth.v1.service_pb2.RevokeAllSessionsResponse,
|
|
175
|
+
]
|
|
176
|
+
"""Revoke all sessions except current"""
|
|
177
|
+
|
|
178
|
+
class AuthAsyncStub:
|
|
179
|
+
"""Auth handles authentication and user management
|
|
180
|
+
OAuth endpoints (provider-agnostic)
|
|
181
|
+
"""
|
|
182
|
+
|
|
183
|
+
InitiateOAuth: grpc.aio.UnaryUnaryMultiCallable[
|
|
184
|
+
weaveapi.auth.v1.service_pb2.InitiateOAuthRequest,
|
|
185
|
+
weaveapi.auth.v1.service_pb2.InitiateOAuthResponse,
|
|
186
|
+
]
|
|
187
|
+
"""Initiate OAuth flow for any supported provider"""
|
|
188
|
+
|
|
189
|
+
HandleOAuthCallback: grpc.aio.UnaryUnaryMultiCallable[
|
|
190
|
+
weaveapi.auth.v1.service_pb2.HandleOAuthCallbackRequest,
|
|
191
|
+
weaveapi.auth.v1.service_pb2.HandleOAuthCallbackResponse,
|
|
192
|
+
]
|
|
193
|
+
"""Handle OAuth callback from any provider"""
|
|
194
|
+
|
|
195
|
+
GetOAuthProviders: grpc.aio.UnaryUnaryMultiCallable[
|
|
196
|
+
weaveapi.auth.v1.service_pb2.GetOAuthProvidersRequest,
|
|
197
|
+
weaveapi.auth.v1.service_pb2.GetOAuthProvidersResponse,
|
|
198
|
+
]
|
|
199
|
+
"""Get list of supported OAuth providers"""
|
|
200
|
+
|
|
201
|
+
LinkOAuthProvider: grpc.aio.UnaryUnaryMultiCallable[
|
|
202
|
+
weaveapi.auth.v1.service_pb2.LinkOAuthProviderRequest,
|
|
203
|
+
weaveapi.auth.v1.service_pb2.LinkOAuthProviderResponse,
|
|
204
|
+
]
|
|
205
|
+
"""Link additional OAuth provider to existing account"""
|
|
206
|
+
|
|
207
|
+
UnlinkOAuthProvider: grpc.aio.UnaryUnaryMultiCallable[
|
|
208
|
+
weaveapi.auth.v1.service_pb2.UnlinkOAuthProviderRequest,
|
|
209
|
+
weaveapi.auth.v1.service_pb2.UnlinkOAuthProviderResponse,
|
|
210
|
+
]
|
|
211
|
+
"""Unlink OAuth provider from account"""
|
|
212
|
+
|
|
213
|
+
RefreshToken: grpc.aio.UnaryUnaryMultiCallable[
|
|
214
|
+
weaveapi.auth.v1.service_pb2.RefreshTokenRequest,
|
|
215
|
+
weaveapi.auth.v1.service_pb2.RefreshTokenResponse,
|
|
216
|
+
]
|
|
217
|
+
"""Token management
|
|
218
|
+
|
|
219
|
+
Refresh access token
|
|
220
|
+
"""
|
|
221
|
+
|
|
222
|
+
RevokeToken: grpc.aio.UnaryUnaryMultiCallable[
|
|
223
|
+
weaveapi.auth.v1.service_pb2.RevokeTokenRequest,
|
|
224
|
+
weaveapi.auth.v1.service_pb2.RevokeTokenResponse,
|
|
225
|
+
]
|
|
226
|
+
"""Revoke refresh token (logout)"""
|
|
227
|
+
|
|
228
|
+
ValidateToken: grpc.aio.UnaryUnaryMultiCallable[
|
|
229
|
+
weaveapi.auth.v1.service_pb2.ValidateTokenRequest,
|
|
230
|
+
weaveapi.auth.v1.service_pb2.ValidateTokenResponse,
|
|
231
|
+
]
|
|
232
|
+
"""Validate access token"""
|
|
233
|
+
|
|
234
|
+
GetCurrentUser: grpc.aio.UnaryUnaryMultiCallable[
|
|
235
|
+
weaveapi.auth.v1.service_pb2.GetCurrentUserRequest,
|
|
236
|
+
weaveapi.auth.v1.service_pb2.GetCurrentUserResponse,
|
|
237
|
+
]
|
|
238
|
+
"""User management
|
|
239
|
+
|
|
240
|
+
Get current user profile
|
|
241
|
+
"""
|
|
242
|
+
|
|
243
|
+
UpdateUser: grpc.aio.UnaryUnaryMultiCallable[
|
|
244
|
+
weaveapi.auth.v1.service_pb2.UpdateUserRequest,
|
|
245
|
+
weaveapi.auth.v1.service_pb2.UpdateUserResponse,
|
|
246
|
+
]
|
|
247
|
+
"""Update user profile"""
|
|
248
|
+
|
|
249
|
+
DeleteUser: grpc.aio.UnaryUnaryMultiCallable[
|
|
250
|
+
weaveapi.auth.v1.service_pb2.DeleteUserRequest,
|
|
251
|
+
weaveapi.auth.v1.service_pb2.DeleteUserResponse,
|
|
252
|
+
]
|
|
253
|
+
"""Delete user account"""
|
|
254
|
+
|
|
255
|
+
ListAPIKeys: grpc.aio.UnaryUnaryMultiCallable[
|
|
256
|
+
weaveapi.auth.v1.service_pb2.ListAPIKeysRequest,
|
|
257
|
+
weaveapi.auth.v1.service_pb2.ListAPIKeysResponse,
|
|
258
|
+
]
|
|
259
|
+
"""API Key management
|
|
260
|
+
|
|
261
|
+
List user's API keys
|
|
262
|
+
"""
|
|
263
|
+
|
|
264
|
+
CreateAPIKey: grpc.aio.UnaryUnaryMultiCallable[
|
|
265
|
+
weaveapi.auth.v1.service_pb2.CreateAPIKeyRequest,
|
|
266
|
+
weaveapi.auth.v1.service_pb2.CreateAPIKeyResponse,
|
|
267
|
+
]
|
|
268
|
+
"""Create new API key"""
|
|
269
|
+
|
|
270
|
+
GetAPIKey: grpc.aio.UnaryUnaryMultiCallable[
|
|
271
|
+
weaveapi.auth.v1.service_pb2.GetAPIKeyRequest,
|
|
272
|
+
weaveapi.auth.v1.service_pb2.GetAPIKeyResponse,
|
|
273
|
+
]
|
|
274
|
+
"""Get API key details"""
|
|
275
|
+
|
|
276
|
+
UpdateAPIKey: grpc.aio.UnaryUnaryMultiCallable[
|
|
277
|
+
weaveapi.auth.v1.service_pb2.UpdateAPIKeyRequest,
|
|
278
|
+
weaveapi.auth.v1.service_pb2.UpdateAPIKeyResponse,
|
|
279
|
+
]
|
|
280
|
+
"""Update API key (rename, etc)"""
|
|
281
|
+
|
|
282
|
+
RevokeAPIKey: grpc.aio.UnaryUnaryMultiCallable[
|
|
283
|
+
weaveapi.auth.v1.service_pb2.RevokeAPIKeyRequest,
|
|
284
|
+
weaveapi.auth.v1.service_pb2.RevokeAPIKeyResponse,
|
|
285
|
+
]
|
|
286
|
+
"""Revoke API key"""
|
|
287
|
+
|
|
288
|
+
ValidateAPIKey: grpc.aio.UnaryUnaryMultiCallable[
|
|
289
|
+
weaveapi.auth.v1.service_pb2.ValidateAPIKeyRequest,
|
|
290
|
+
weaveapi.auth.v1.service_pb2.ValidateAPIKeyResponse,
|
|
291
|
+
]
|
|
292
|
+
"""Validate API key (for internal use)"""
|
|
293
|
+
|
|
294
|
+
GetUsageStats: grpc.aio.UnaryUnaryMultiCallable[
|
|
295
|
+
weaveapi.auth.v1.service_pb2.GetUsageStatsRequest,
|
|
296
|
+
weaveapi.auth.v1.service_pb2.GetUsageStatsResponse,
|
|
297
|
+
]
|
|
298
|
+
"""Usage and limits
|
|
299
|
+
|
|
300
|
+
Get user's API usage statistics
|
|
301
|
+
"""
|
|
302
|
+
|
|
303
|
+
GetRateLimitStatus: grpc.aio.UnaryUnaryMultiCallable[
|
|
304
|
+
weaveapi.auth.v1.service_pb2.GetRateLimitStatusRequest,
|
|
305
|
+
weaveapi.auth.v1.service_pb2.GetRateLimitStatusResponse,
|
|
306
|
+
]
|
|
307
|
+
"""Get rate limit status"""
|
|
308
|
+
|
|
309
|
+
ListSessions: grpc.aio.UnaryUnaryMultiCallable[
|
|
310
|
+
weaveapi.auth.v1.service_pb2.ListSessionsRequest,
|
|
311
|
+
weaveapi.auth.v1.service_pb2.ListSessionsResponse,
|
|
312
|
+
]
|
|
313
|
+
"""Session management
|
|
314
|
+
|
|
315
|
+
List active sessions
|
|
316
|
+
"""
|
|
317
|
+
|
|
318
|
+
RevokeSession: grpc.aio.UnaryUnaryMultiCallable[
|
|
319
|
+
weaveapi.auth.v1.service_pb2.RevokeSessionRequest,
|
|
320
|
+
weaveapi.auth.v1.service_pb2.RevokeSessionResponse,
|
|
321
|
+
]
|
|
322
|
+
"""Revoke a specific session"""
|
|
323
|
+
|
|
324
|
+
RevokeAllSessions: grpc.aio.UnaryUnaryMultiCallable[
|
|
325
|
+
weaveapi.auth.v1.service_pb2.RevokeAllSessionsRequest,
|
|
326
|
+
weaveapi.auth.v1.service_pb2.RevokeAllSessionsResponse,
|
|
327
|
+
]
|
|
328
|
+
"""Revoke all sessions except current"""
|
|
329
|
+
|
|
330
|
+
class AuthServicer(metaclass=abc.ABCMeta):
|
|
331
|
+
"""Auth handles authentication and user management
|
|
332
|
+
OAuth endpoints (provider-agnostic)
|
|
333
|
+
"""
|
|
334
|
+
|
|
335
|
+
@abc.abstractmethod
|
|
336
|
+
def InitiateOAuth(
|
|
337
|
+
self,
|
|
338
|
+
request: weaveapi.auth.v1.service_pb2.InitiateOAuthRequest,
|
|
339
|
+
context: _ServicerContext,
|
|
340
|
+
) -> typing.Union[
|
|
341
|
+
weaveapi.auth.v1.service_pb2.InitiateOAuthResponse,
|
|
342
|
+
collections.abc.Awaitable[weaveapi.auth.v1.service_pb2.InitiateOAuthResponse],
|
|
343
|
+
]:
|
|
344
|
+
"""Initiate OAuth flow for any supported provider"""
|
|
345
|
+
|
|
346
|
+
@abc.abstractmethod
|
|
347
|
+
def HandleOAuthCallback(
|
|
348
|
+
self,
|
|
349
|
+
request: weaveapi.auth.v1.service_pb2.HandleOAuthCallbackRequest,
|
|
350
|
+
context: _ServicerContext,
|
|
351
|
+
) -> typing.Union[
|
|
352
|
+
weaveapi.auth.v1.service_pb2.HandleOAuthCallbackResponse,
|
|
353
|
+
collections.abc.Awaitable[
|
|
354
|
+
weaveapi.auth.v1.service_pb2.HandleOAuthCallbackResponse
|
|
355
|
+
],
|
|
356
|
+
]:
|
|
357
|
+
"""Handle OAuth callback from any provider"""
|
|
358
|
+
|
|
359
|
+
@abc.abstractmethod
|
|
360
|
+
def GetOAuthProviders(
|
|
361
|
+
self,
|
|
362
|
+
request: weaveapi.auth.v1.service_pb2.GetOAuthProvidersRequest,
|
|
363
|
+
context: _ServicerContext,
|
|
364
|
+
) -> typing.Union[
|
|
365
|
+
weaveapi.auth.v1.service_pb2.GetOAuthProvidersResponse,
|
|
366
|
+
collections.abc.Awaitable[
|
|
367
|
+
weaveapi.auth.v1.service_pb2.GetOAuthProvidersResponse
|
|
368
|
+
],
|
|
369
|
+
]:
|
|
370
|
+
"""Get list of supported OAuth providers"""
|
|
371
|
+
|
|
372
|
+
@abc.abstractmethod
|
|
373
|
+
def LinkOAuthProvider(
|
|
374
|
+
self,
|
|
375
|
+
request: weaveapi.auth.v1.service_pb2.LinkOAuthProviderRequest,
|
|
376
|
+
context: _ServicerContext,
|
|
377
|
+
) -> typing.Union[
|
|
378
|
+
weaveapi.auth.v1.service_pb2.LinkOAuthProviderResponse,
|
|
379
|
+
collections.abc.Awaitable[
|
|
380
|
+
weaveapi.auth.v1.service_pb2.LinkOAuthProviderResponse
|
|
381
|
+
],
|
|
382
|
+
]:
|
|
383
|
+
"""Link additional OAuth provider to existing account"""
|
|
384
|
+
|
|
385
|
+
@abc.abstractmethod
|
|
386
|
+
def UnlinkOAuthProvider(
|
|
387
|
+
self,
|
|
388
|
+
request: weaveapi.auth.v1.service_pb2.UnlinkOAuthProviderRequest,
|
|
389
|
+
context: _ServicerContext,
|
|
390
|
+
) -> typing.Union[
|
|
391
|
+
weaveapi.auth.v1.service_pb2.UnlinkOAuthProviderResponse,
|
|
392
|
+
collections.abc.Awaitable[
|
|
393
|
+
weaveapi.auth.v1.service_pb2.UnlinkOAuthProviderResponse
|
|
394
|
+
],
|
|
395
|
+
]:
|
|
396
|
+
"""Unlink OAuth provider from account"""
|
|
397
|
+
|
|
398
|
+
@abc.abstractmethod
|
|
399
|
+
def RefreshToken(
|
|
400
|
+
self,
|
|
401
|
+
request: weaveapi.auth.v1.service_pb2.RefreshTokenRequest,
|
|
402
|
+
context: _ServicerContext,
|
|
403
|
+
) -> typing.Union[
|
|
404
|
+
weaveapi.auth.v1.service_pb2.RefreshTokenResponse,
|
|
405
|
+
collections.abc.Awaitable[weaveapi.auth.v1.service_pb2.RefreshTokenResponse],
|
|
406
|
+
]:
|
|
407
|
+
"""Token management
|
|
408
|
+
|
|
409
|
+
Refresh access token
|
|
410
|
+
"""
|
|
411
|
+
|
|
412
|
+
@abc.abstractmethod
|
|
413
|
+
def RevokeToken(
|
|
414
|
+
self,
|
|
415
|
+
request: weaveapi.auth.v1.service_pb2.RevokeTokenRequest,
|
|
416
|
+
context: _ServicerContext,
|
|
417
|
+
) -> typing.Union[
|
|
418
|
+
weaveapi.auth.v1.service_pb2.RevokeTokenResponse,
|
|
419
|
+
collections.abc.Awaitable[weaveapi.auth.v1.service_pb2.RevokeTokenResponse],
|
|
420
|
+
]:
|
|
421
|
+
"""Revoke refresh token (logout)"""
|
|
422
|
+
|
|
423
|
+
@abc.abstractmethod
|
|
424
|
+
def ValidateToken(
|
|
425
|
+
self,
|
|
426
|
+
request: weaveapi.auth.v1.service_pb2.ValidateTokenRequest,
|
|
427
|
+
context: _ServicerContext,
|
|
428
|
+
) -> typing.Union[
|
|
429
|
+
weaveapi.auth.v1.service_pb2.ValidateTokenResponse,
|
|
430
|
+
collections.abc.Awaitable[weaveapi.auth.v1.service_pb2.ValidateTokenResponse],
|
|
431
|
+
]:
|
|
432
|
+
"""Validate access token"""
|
|
433
|
+
|
|
434
|
+
@abc.abstractmethod
|
|
435
|
+
def GetCurrentUser(
|
|
436
|
+
self,
|
|
437
|
+
request: weaveapi.auth.v1.service_pb2.GetCurrentUserRequest,
|
|
438
|
+
context: _ServicerContext,
|
|
439
|
+
) -> typing.Union[
|
|
440
|
+
weaveapi.auth.v1.service_pb2.GetCurrentUserResponse,
|
|
441
|
+
collections.abc.Awaitable[weaveapi.auth.v1.service_pb2.GetCurrentUserResponse],
|
|
442
|
+
]:
|
|
443
|
+
"""User management
|
|
444
|
+
|
|
445
|
+
Get current user profile
|
|
446
|
+
"""
|
|
447
|
+
|
|
448
|
+
@abc.abstractmethod
|
|
449
|
+
def UpdateUser(
|
|
450
|
+
self,
|
|
451
|
+
request: weaveapi.auth.v1.service_pb2.UpdateUserRequest,
|
|
452
|
+
context: _ServicerContext,
|
|
453
|
+
) -> typing.Union[
|
|
454
|
+
weaveapi.auth.v1.service_pb2.UpdateUserResponse,
|
|
455
|
+
collections.abc.Awaitable[weaveapi.auth.v1.service_pb2.UpdateUserResponse],
|
|
456
|
+
]:
|
|
457
|
+
"""Update user profile"""
|
|
458
|
+
|
|
459
|
+
@abc.abstractmethod
|
|
460
|
+
def DeleteUser(
|
|
461
|
+
self,
|
|
462
|
+
request: weaveapi.auth.v1.service_pb2.DeleteUserRequest,
|
|
463
|
+
context: _ServicerContext,
|
|
464
|
+
) -> typing.Union[
|
|
465
|
+
weaveapi.auth.v1.service_pb2.DeleteUserResponse,
|
|
466
|
+
collections.abc.Awaitable[weaveapi.auth.v1.service_pb2.DeleteUserResponse],
|
|
467
|
+
]:
|
|
468
|
+
"""Delete user account"""
|
|
469
|
+
|
|
470
|
+
@abc.abstractmethod
|
|
471
|
+
def ListAPIKeys(
|
|
472
|
+
self,
|
|
473
|
+
request: weaveapi.auth.v1.service_pb2.ListAPIKeysRequest,
|
|
474
|
+
context: _ServicerContext,
|
|
475
|
+
) -> typing.Union[
|
|
476
|
+
weaveapi.auth.v1.service_pb2.ListAPIKeysResponse,
|
|
477
|
+
collections.abc.Awaitable[weaveapi.auth.v1.service_pb2.ListAPIKeysResponse],
|
|
478
|
+
]:
|
|
479
|
+
"""API Key management
|
|
480
|
+
|
|
481
|
+
List user's API keys
|
|
482
|
+
"""
|
|
483
|
+
|
|
484
|
+
@abc.abstractmethod
|
|
485
|
+
def CreateAPIKey(
|
|
486
|
+
self,
|
|
487
|
+
request: weaveapi.auth.v1.service_pb2.CreateAPIKeyRequest,
|
|
488
|
+
context: _ServicerContext,
|
|
489
|
+
) -> typing.Union[
|
|
490
|
+
weaveapi.auth.v1.service_pb2.CreateAPIKeyResponse,
|
|
491
|
+
collections.abc.Awaitable[weaveapi.auth.v1.service_pb2.CreateAPIKeyResponse],
|
|
492
|
+
]:
|
|
493
|
+
"""Create new API key"""
|
|
494
|
+
|
|
495
|
+
@abc.abstractmethod
|
|
496
|
+
def GetAPIKey(
|
|
497
|
+
self,
|
|
498
|
+
request: weaveapi.auth.v1.service_pb2.GetAPIKeyRequest,
|
|
499
|
+
context: _ServicerContext,
|
|
500
|
+
) -> typing.Union[
|
|
501
|
+
weaveapi.auth.v1.service_pb2.GetAPIKeyResponse,
|
|
502
|
+
collections.abc.Awaitable[weaveapi.auth.v1.service_pb2.GetAPIKeyResponse],
|
|
503
|
+
]:
|
|
504
|
+
"""Get API key details"""
|
|
505
|
+
|
|
506
|
+
@abc.abstractmethod
|
|
507
|
+
def UpdateAPIKey(
|
|
508
|
+
self,
|
|
509
|
+
request: weaveapi.auth.v1.service_pb2.UpdateAPIKeyRequest,
|
|
510
|
+
context: _ServicerContext,
|
|
511
|
+
) -> typing.Union[
|
|
512
|
+
weaveapi.auth.v1.service_pb2.UpdateAPIKeyResponse,
|
|
513
|
+
collections.abc.Awaitable[weaveapi.auth.v1.service_pb2.UpdateAPIKeyResponse],
|
|
514
|
+
]:
|
|
515
|
+
"""Update API key (rename, etc)"""
|
|
516
|
+
|
|
517
|
+
@abc.abstractmethod
|
|
518
|
+
def RevokeAPIKey(
|
|
519
|
+
self,
|
|
520
|
+
request: weaveapi.auth.v1.service_pb2.RevokeAPIKeyRequest,
|
|
521
|
+
context: _ServicerContext,
|
|
522
|
+
) -> typing.Union[
|
|
523
|
+
weaveapi.auth.v1.service_pb2.RevokeAPIKeyResponse,
|
|
524
|
+
collections.abc.Awaitable[weaveapi.auth.v1.service_pb2.RevokeAPIKeyResponse],
|
|
525
|
+
]:
|
|
526
|
+
"""Revoke API key"""
|
|
527
|
+
|
|
528
|
+
@abc.abstractmethod
|
|
529
|
+
def ValidateAPIKey(
|
|
530
|
+
self,
|
|
531
|
+
request: weaveapi.auth.v1.service_pb2.ValidateAPIKeyRequest,
|
|
532
|
+
context: _ServicerContext,
|
|
533
|
+
) -> typing.Union[
|
|
534
|
+
weaveapi.auth.v1.service_pb2.ValidateAPIKeyResponse,
|
|
535
|
+
collections.abc.Awaitable[weaveapi.auth.v1.service_pb2.ValidateAPIKeyResponse],
|
|
536
|
+
]:
|
|
537
|
+
"""Validate API key (for internal use)"""
|
|
538
|
+
|
|
539
|
+
@abc.abstractmethod
|
|
540
|
+
def GetUsageStats(
|
|
541
|
+
self,
|
|
542
|
+
request: weaveapi.auth.v1.service_pb2.GetUsageStatsRequest,
|
|
543
|
+
context: _ServicerContext,
|
|
544
|
+
) -> typing.Union[
|
|
545
|
+
weaveapi.auth.v1.service_pb2.GetUsageStatsResponse,
|
|
546
|
+
collections.abc.Awaitable[weaveapi.auth.v1.service_pb2.GetUsageStatsResponse],
|
|
547
|
+
]:
|
|
548
|
+
"""Usage and limits
|
|
549
|
+
|
|
550
|
+
Get user's API usage statistics
|
|
551
|
+
"""
|
|
552
|
+
|
|
553
|
+
@abc.abstractmethod
|
|
554
|
+
def GetRateLimitStatus(
|
|
555
|
+
self,
|
|
556
|
+
request: weaveapi.auth.v1.service_pb2.GetRateLimitStatusRequest,
|
|
557
|
+
context: _ServicerContext,
|
|
558
|
+
) -> typing.Union[
|
|
559
|
+
weaveapi.auth.v1.service_pb2.GetRateLimitStatusResponse,
|
|
560
|
+
collections.abc.Awaitable[
|
|
561
|
+
weaveapi.auth.v1.service_pb2.GetRateLimitStatusResponse
|
|
562
|
+
],
|
|
563
|
+
]:
|
|
564
|
+
"""Get rate limit status"""
|
|
565
|
+
|
|
566
|
+
@abc.abstractmethod
|
|
567
|
+
def ListSessions(
|
|
568
|
+
self,
|
|
569
|
+
request: weaveapi.auth.v1.service_pb2.ListSessionsRequest,
|
|
570
|
+
context: _ServicerContext,
|
|
571
|
+
) -> typing.Union[
|
|
572
|
+
weaveapi.auth.v1.service_pb2.ListSessionsResponse,
|
|
573
|
+
collections.abc.Awaitable[weaveapi.auth.v1.service_pb2.ListSessionsResponse],
|
|
574
|
+
]:
|
|
575
|
+
"""Session management
|
|
576
|
+
|
|
577
|
+
List active sessions
|
|
578
|
+
"""
|
|
579
|
+
|
|
580
|
+
@abc.abstractmethod
|
|
581
|
+
def RevokeSession(
|
|
582
|
+
self,
|
|
583
|
+
request: weaveapi.auth.v1.service_pb2.RevokeSessionRequest,
|
|
584
|
+
context: _ServicerContext,
|
|
585
|
+
) -> typing.Union[
|
|
586
|
+
weaveapi.auth.v1.service_pb2.RevokeSessionResponse,
|
|
587
|
+
collections.abc.Awaitable[weaveapi.auth.v1.service_pb2.RevokeSessionResponse],
|
|
588
|
+
]:
|
|
589
|
+
"""Revoke a specific session"""
|
|
590
|
+
|
|
591
|
+
@abc.abstractmethod
|
|
592
|
+
def RevokeAllSessions(
|
|
593
|
+
self,
|
|
594
|
+
request: weaveapi.auth.v1.service_pb2.RevokeAllSessionsRequest,
|
|
595
|
+
context: _ServicerContext,
|
|
596
|
+
) -> typing.Union[
|
|
597
|
+
weaveapi.auth.v1.service_pb2.RevokeAllSessionsResponse,
|
|
598
|
+
collections.abc.Awaitable[
|
|
599
|
+
weaveapi.auth.v1.service_pb2.RevokeAllSessionsResponse
|
|
600
|
+
],
|
|
601
|
+
]:
|
|
602
|
+
"""Revoke all sessions except current"""
|
|
603
|
+
|
|
604
|
+
def add_AuthServicer_to_server(
|
|
605
|
+
servicer: AuthServicer, server: typing.Union[grpc.Server, grpc.aio.Server]
|
|
606
|
+
) -> None: ...
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: weaveapi/auth/v1/session.proto
|
|
5
|
+
# Protobuf Python Version: 6.32.0
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
|
|
8
|
+
from google.protobuf import descriptor as _descriptor
|
|
9
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
10
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
11
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
12
|
+
from google.protobuf.internal import builder as _builder
|
|
13
|
+
|
|
14
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
15
|
+
_runtime_version.Domain.PUBLIC, 6, 32, 0, "", "weaveapi/auth/v1/session.proto"
|
|
16
|
+
)
|
|
17
|
+
# @@protoc_insertion_point(imports)
|
|
18
|
+
|
|
19
|
+
_sym_db = _symbol_database.Default()
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
|
|
23
|
+
b'\n\x1eweaveapi/auth/v1/session.proto\x12\x10weaveapi.auth.v1\x1a\x1fgoogle/protobuf/timestamp.proto"\xc6\x03\n\x07Session\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x17\n\x07user_id\x18\x02 \x01(\tR\x06userId\x12\x19\n\x08token_id\x18\x03 \x01(\tR\x07tokenId\x12\x1d\n\nip_address\x18\x04 \x01(\tR\tipAddress\x12\x1d\n\nuser_agent\x18\x05 \x01(\tR\tuserAgent\x12\x1a\n\x08location\x18\x06 \x01(\tR\x08location\x12\x1f\n\x0b\x64\x65vice_type\x18\x07 \x01(\tR\ndeviceType\x12\x1b\n\tis_active\x18\x08 \x01(\x08R\x08isActive\x12\x39\n\nexpires_at\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampR\texpiresAt\x12\x44\n\x10last_activity_at\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x0elastActivityAt\x12#\n\rrequest_count\x18\x0b \x01(\x05R\x0crequestCount\x12\x39\n\ncreated_at\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampR\tcreatedAtB\xbc\x01\n\x14\x63om.weaveapi.auth.v1B\x0cSessionProtoP\x01Z4github.com/weave-labs/weave-go/weaveapi/auth/v1;auth\xa2\x02\x03WAX\xaa\x02\x10Weaveapi.Auth.V1\xca\x02\x10Weaveapi\\Auth\\V1\xe2\x02\x1cWeaveapi\\Auth\\V1\\GPBMetadata\xea\x02\x12Weaveapi::Auth::V1b\x06proto3'
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
_globals = globals()
|
|
27
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
28
|
+
_builder.BuildTopDescriptorsAndMessages(
|
|
29
|
+
DESCRIPTOR, "weaveapi.auth.v1.session_pb2", _globals
|
|
30
|
+
)
|
|
31
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
32
|
+
_globals["DESCRIPTOR"]._loaded_options = None
|
|
33
|
+
_globals[
|
|
34
|
+
"DESCRIPTOR"
|
|
35
|
+
]._serialized_options = b"\n\024com.weaveapi.auth.v1B\014SessionProtoP\001Z4github.com/weave-labs/weave-go/weaveapi/auth/v1;auth\242\002\003WAX\252\002\020Weaveapi.Auth.V1\312\002\020Weaveapi\\Auth\\V1\342\002\034Weaveapi\\Auth\\V1\\GPBMetadata\352\002\022Weaveapi::Auth::V1"
|
|
36
|
+
_globals["_SESSION"]._serialized_start = 86
|
|
37
|
+
_globals["_SESSION"]._serialized_end = 540
|
|
38
|
+
# @@protoc_insertion_point(module_scope)
|