otdf-python 0.4.1__py3-none-any.whl → 0.4.2__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.
Files changed (58) hide show
  1. otdf_python/autoconfigure_utils.py +0 -2
  2. otdf_python/collection_store.py +0 -1
  3. otdf_python/ecdh.py +0 -6
  4. otdf_python/kas_client.py +18 -0
  5. otdf_python/kas_connect_rpc_client.py +59 -19
  6. otdf_python/nanotdf.py +0 -8
  7. otdf_python/nanotdf_ecdsa_struct.py +0 -2
  8. otdf_python/nanotdf_type.py +1 -1
  9. otdf_python/sdk.py +2 -16
  10. otdf_python/sdk_builder.py +2 -6
  11. {otdf_python-0.4.1.dist-info → otdf_python-0.4.2.dist-info}/METADATA +3 -2
  12. {otdf_python-0.4.1.dist-info → otdf_python-0.4.2.dist-info}/RECORD +43 -34
  13. otdf_python_proto/__init__.py +2 -6
  14. otdf_python_proto/authorization/__init__.py +10 -0
  15. otdf_python_proto/authorization/authorization_connect.py +250 -0
  16. otdf_python_proto/authorization/v2/authorization_connect.py +315 -0
  17. otdf_python_proto/entityresolution/__init__.py +10 -0
  18. otdf_python_proto/entityresolution/entity_resolution_connect.py +185 -0
  19. otdf_python_proto/entityresolution/v2/entity_resolution_connect.py +185 -0
  20. otdf_python_proto/kas/__init__.py +2 -2
  21. otdf_python_proto/kas/kas_connect.py +259 -0
  22. otdf_python_proto/policy/actions/__init__.py +11 -0
  23. otdf_python_proto/policy/actions/actions_connect.py +380 -0
  24. otdf_python_proto/policy/attributes/__init__.py +11 -0
  25. otdf_python_proto/policy/attributes/attributes_connect.py +1310 -0
  26. otdf_python_proto/policy/kasregistry/__init__.py +11 -0
  27. otdf_python_proto/policy/kasregistry/key_access_server_registry_connect.py +912 -0
  28. otdf_python_proto/policy/keymanagement/__init__.py +11 -0
  29. otdf_python_proto/policy/keymanagement/key_management_connect.py +380 -0
  30. otdf_python_proto/policy/namespaces/__init__.py +11 -0
  31. otdf_python_proto/policy/namespaces/namespaces_connect.py +648 -0
  32. otdf_python_proto/policy/registeredresources/__init__.py +11 -0
  33. otdf_python_proto/policy/registeredresources/registered_resources_connect.py +770 -0
  34. otdf_python_proto/policy/resourcemapping/__init__.py +11 -0
  35. otdf_python_proto/policy/resourcemapping/resource_mapping_connect.py +790 -0
  36. otdf_python_proto/policy/subjectmapping/__init__.py +11 -0
  37. otdf_python_proto/policy/subjectmapping/subject_mapping_connect.py +851 -0
  38. otdf_python_proto/policy/unsafe/__init__.py +11 -0
  39. otdf_python_proto/policy/unsafe/unsafe_connect.py +705 -0
  40. otdf_python_proto/wellknownconfiguration/__init__.py +10 -0
  41. otdf_python_proto/wellknownconfiguration/wellknown_configuration_connect.py +124 -0
  42. otdf_python_proto/authorization/authorization_pb2_connect.py +0 -191
  43. otdf_python_proto/authorization/v2/authorization_pb2_connect.py +0 -233
  44. otdf_python_proto/entityresolution/entity_resolution_pb2_connect.py +0 -149
  45. otdf_python_proto/entityresolution/v2/entity_resolution_pb2_connect.py +0 -149
  46. otdf_python_proto/kas/kas_pb2_connect.py +0 -192
  47. otdf_python_proto/policy/actions/actions_pb2_connect.py +0 -275
  48. otdf_python_proto/policy/attributes/attributes_pb2_connect.py +0 -863
  49. otdf_python_proto/policy/kasregistry/key_access_server_registry_pb2_connect.py +0 -611
  50. otdf_python_proto/policy/keymanagement/key_management_pb2_connect.py +0 -275
  51. otdf_python_proto/policy/namespaces/namespaces_pb2_connect.py +0 -443
  52. otdf_python_proto/policy/registeredresources/registered_resources_pb2_connect.py +0 -527
  53. otdf_python_proto/policy/resourcemapping/resource_mapping_pb2_connect.py +0 -527
  54. otdf_python_proto/policy/subjectmapping/subject_mapping_pb2_connect.py +0 -569
  55. otdf_python_proto/policy/unsafe/unsafe_pb2_connect.py +0 -485
  56. otdf_python_proto/wellknownconfiguration/wellknown_configuration_pb2_connect.py +0 -107
  57. {otdf_python-0.4.1.dist-info → otdf_python-0.4.2.dist-info}/WHEEL +0 -0
  58. {otdf_python-0.4.1.dist-info → otdf_python-0.4.2.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,250 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT!
3
+ # source: authorization/authorization.proto
4
+
5
+ from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping
6
+ from typing import Protocol
7
+
8
+ from connectrpc.client import ConnectClient, ConnectClientSync
9
+ from connectrpc.code import Code
10
+ from connectrpc.errors import ConnectError
11
+ from connectrpc.interceptor import Interceptor, InterceptorSync
12
+ from connectrpc.method import IdempotencyLevel, MethodInfo
13
+ from connectrpc.request import Headers, RequestContext
14
+ from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync
15
+ from . import authorization_pb2 as authorization_dot_authorization__pb2
16
+
17
+
18
+ class AuthorizationService(Protocol):
19
+ async def get_decisions(self, request: authorization_dot_authorization__pb2.GetDecisionsRequest, ctx: RequestContext) -> authorization_dot_authorization__pb2.GetDecisionsResponse:
20
+ raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
21
+
22
+ async def get_decisions_by_token(self, request: authorization_dot_authorization__pb2.GetDecisionsByTokenRequest, ctx: RequestContext) -> authorization_dot_authorization__pb2.GetDecisionsByTokenResponse:
23
+ raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
24
+
25
+ async def get_entitlements(self, request: authorization_dot_authorization__pb2.GetEntitlementsRequest, ctx: RequestContext) -> authorization_dot_authorization__pb2.GetEntitlementsResponse:
26
+ raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
27
+
28
+
29
+ class AuthorizationServiceASGIApplication(ConnectASGIApplication[AuthorizationService]):
30
+ def __init__(self, service: AuthorizationService | AsyncGenerator[AuthorizationService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None) -> None:
31
+ super().__init__(
32
+ service=service,
33
+ endpoints=lambda svc: {
34
+ "/authorization.AuthorizationService/GetDecisions": Endpoint.unary(
35
+ method=MethodInfo(
36
+ name="GetDecisions",
37
+ service_name="authorization.AuthorizationService",
38
+ input=authorization_dot_authorization__pb2.GetDecisionsRequest,
39
+ output=authorization_dot_authorization__pb2.GetDecisionsResponse,
40
+ idempotency_level=IdempotencyLevel.UNKNOWN,
41
+ ),
42
+ function=svc.get_decisions,
43
+ ),
44
+ "/authorization.AuthorizationService/GetDecisionsByToken": Endpoint.unary(
45
+ method=MethodInfo(
46
+ name="GetDecisionsByToken",
47
+ service_name="authorization.AuthorizationService",
48
+ input=authorization_dot_authorization__pb2.GetDecisionsByTokenRequest,
49
+ output=authorization_dot_authorization__pb2.GetDecisionsByTokenResponse,
50
+ idempotency_level=IdempotencyLevel.UNKNOWN,
51
+ ),
52
+ function=svc.get_decisions_by_token,
53
+ ),
54
+ "/authorization.AuthorizationService/GetEntitlements": Endpoint.unary(
55
+ method=MethodInfo(
56
+ name="GetEntitlements",
57
+ service_name="authorization.AuthorizationService",
58
+ input=authorization_dot_authorization__pb2.GetEntitlementsRequest,
59
+ output=authorization_dot_authorization__pb2.GetEntitlementsResponse,
60
+ idempotency_level=IdempotencyLevel.UNKNOWN,
61
+ ),
62
+ function=svc.get_entitlements,
63
+ ),
64
+ },
65
+ interceptors=interceptors,
66
+ read_max_bytes=read_max_bytes,
67
+ )
68
+
69
+ @property
70
+ def path(self) -> str:
71
+ """Returns the URL path to mount the application to when serving multiple applications."""
72
+ return "/authorization.AuthorizationService"
73
+
74
+
75
+ class AuthorizationServiceClient(ConnectClient):
76
+ async def get_decisions(
77
+ self,
78
+ request: authorization_dot_authorization__pb2.GetDecisionsRequest,
79
+ *,
80
+ headers: Headers | Mapping[str, str] | None = None,
81
+ timeout_ms: int | None = None,
82
+ ) -> authorization_dot_authorization__pb2.GetDecisionsResponse:
83
+ return await self.execute_unary(
84
+ request=request,
85
+ method=MethodInfo(
86
+ name="GetDecisions",
87
+ service_name="authorization.AuthorizationService",
88
+ input=authorization_dot_authorization__pb2.GetDecisionsRequest,
89
+ output=authorization_dot_authorization__pb2.GetDecisionsResponse,
90
+ idempotency_level=IdempotencyLevel.UNKNOWN,
91
+ ),
92
+ headers=headers,
93
+ timeout_ms=timeout_ms,
94
+ )
95
+
96
+ async def get_decisions_by_token(
97
+ self,
98
+ request: authorization_dot_authorization__pb2.GetDecisionsByTokenRequest,
99
+ *,
100
+ headers: Headers | Mapping[str, str] | None = None,
101
+ timeout_ms: int | None = None,
102
+ ) -> authorization_dot_authorization__pb2.GetDecisionsByTokenResponse:
103
+ return await self.execute_unary(
104
+ request=request,
105
+ method=MethodInfo(
106
+ name="GetDecisionsByToken",
107
+ service_name="authorization.AuthorizationService",
108
+ input=authorization_dot_authorization__pb2.GetDecisionsByTokenRequest,
109
+ output=authorization_dot_authorization__pb2.GetDecisionsByTokenResponse,
110
+ idempotency_level=IdempotencyLevel.UNKNOWN,
111
+ ),
112
+ headers=headers,
113
+ timeout_ms=timeout_ms,
114
+ )
115
+
116
+ async def get_entitlements(
117
+ self,
118
+ request: authorization_dot_authorization__pb2.GetEntitlementsRequest,
119
+ *,
120
+ headers: Headers | Mapping[str, str] | None = None,
121
+ timeout_ms: int | None = None,
122
+ ) -> authorization_dot_authorization__pb2.GetEntitlementsResponse:
123
+ return await self.execute_unary(
124
+ request=request,
125
+ method=MethodInfo(
126
+ name="GetEntitlements",
127
+ service_name="authorization.AuthorizationService",
128
+ input=authorization_dot_authorization__pb2.GetEntitlementsRequest,
129
+ output=authorization_dot_authorization__pb2.GetEntitlementsResponse,
130
+ idempotency_level=IdempotencyLevel.UNKNOWN,
131
+ ),
132
+ headers=headers,
133
+ timeout_ms=timeout_ms,
134
+ )
135
+
136
+
137
+ class AuthorizationServiceSync(Protocol):
138
+ def get_decisions(self, request: authorization_dot_authorization__pb2.GetDecisionsRequest, ctx: RequestContext) -> authorization_dot_authorization__pb2.GetDecisionsResponse:
139
+ raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
140
+ def get_decisions_by_token(self, request: authorization_dot_authorization__pb2.GetDecisionsByTokenRequest, ctx: RequestContext) -> authorization_dot_authorization__pb2.GetDecisionsByTokenResponse:
141
+ raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
142
+ def get_entitlements(self, request: authorization_dot_authorization__pb2.GetEntitlementsRequest, ctx: RequestContext) -> authorization_dot_authorization__pb2.GetEntitlementsResponse:
143
+ raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
144
+
145
+
146
+ class AuthorizationServiceWSGIApplication(ConnectWSGIApplication):
147
+ def __init__(self, service: AuthorizationServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None) -> None:
148
+ super().__init__(
149
+ endpoints={
150
+ "/authorization.AuthorizationService/GetDecisions": EndpointSync.unary(
151
+ method=MethodInfo(
152
+ name="GetDecisions",
153
+ service_name="authorization.AuthorizationService",
154
+ input=authorization_dot_authorization__pb2.GetDecisionsRequest,
155
+ output=authorization_dot_authorization__pb2.GetDecisionsResponse,
156
+ idempotency_level=IdempotencyLevel.UNKNOWN,
157
+ ),
158
+ function=service.get_decisions,
159
+ ),
160
+ "/authorization.AuthorizationService/GetDecisionsByToken": EndpointSync.unary(
161
+ method=MethodInfo(
162
+ name="GetDecisionsByToken",
163
+ service_name="authorization.AuthorizationService",
164
+ input=authorization_dot_authorization__pb2.GetDecisionsByTokenRequest,
165
+ output=authorization_dot_authorization__pb2.GetDecisionsByTokenResponse,
166
+ idempotency_level=IdempotencyLevel.UNKNOWN,
167
+ ),
168
+ function=service.get_decisions_by_token,
169
+ ),
170
+ "/authorization.AuthorizationService/GetEntitlements": EndpointSync.unary(
171
+ method=MethodInfo(
172
+ name="GetEntitlements",
173
+ service_name="authorization.AuthorizationService",
174
+ input=authorization_dot_authorization__pb2.GetEntitlementsRequest,
175
+ output=authorization_dot_authorization__pb2.GetEntitlementsResponse,
176
+ idempotency_level=IdempotencyLevel.UNKNOWN,
177
+ ),
178
+ function=service.get_entitlements,
179
+ ),
180
+ },
181
+ interceptors=interceptors,
182
+ read_max_bytes=read_max_bytes,
183
+ )
184
+
185
+ @property
186
+ def path(self) -> str:
187
+ """Returns the URL path to mount the application to when serving multiple applications."""
188
+ return "/authorization.AuthorizationService"
189
+
190
+
191
+ class AuthorizationServiceClientSync(ConnectClientSync):
192
+ def get_decisions(
193
+ self,
194
+ request: authorization_dot_authorization__pb2.GetDecisionsRequest,
195
+ *,
196
+ headers: Headers | Mapping[str, str] | None = None,
197
+ timeout_ms: int | None = None,
198
+ ) -> authorization_dot_authorization__pb2.GetDecisionsResponse:
199
+ return self.execute_unary(
200
+ request=request,
201
+ method=MethodInfo(
202
+ name="GetDecisions",
203
+ service_name="authorization.AuthorizationService",
204
+ input=authorization_dot_authorization__pb2.GetDecisionsRequest,
205
+ output=authorization_dot_authorization__pb2.GetDecisionsResponse,
206
+ idempotency_level=IdempotencyLevel.UNKNOWN,
207
+ ),
208
+ headers=headers,
209
+ timeout_ms=timeout_ms,
210
+ )
211
+
212
+ def get_decisions_by_token(
213
+ self,
214
+ request: authorization_dot_authorization__pb2.GetDecisionsByTokenRequest,
215
+ *,
216
+ headers: Headers | Mapping[str, str] | None = None,
217
+ timeout_ms: int | None = None,
218
+ ) -> authorization_dot_authorization__pb2.GetDecisionsByTokenResponse:
219
+ return self.execute_unary(
220
+ request=request,
221
+ method=MethodInfo(
222
+ name="GetDecisionsByToken",
223
+ service_name="authorization.AuthorizationService",
224
+ input=authorization_dot_authorization__pb2.GetDecisionsByTokenRequest,
225
+ output=authorization_dot_authorization__pb2.GetDecisionsByTokenResponse,
226
+ idempotency_level=IdempotencyLevel.UNKNOWN,
227
+ ),
228
+ headers=headers,
229
+ timeout_ms=timeout_ms,
230
+ )
231
+
232
+ def get_entitlements(
233
+ self,
234
+ request: authorization_dot_authorization__pb2.GetEntitlementsRequest,
235
+ *,
236
+ headers: Headers | Mapping[str, str] | None = None,
237
+ timeout_ms: int | None = None,
238
+ ) -> authorization_dot_authorization__pb2.GetEntitlementsResponse:
239
+ return self.execute_unary(
240
+ request=request,
241
+ method=MethodInfo(
242
+ name="GetEntitlements",
243
+ service_name="authorization.AuthorizationService",
244
+ input=authorization_dot_authorization__pb2.GetEntitlementsRequest,
245
+ output=authorization_dot_authorization__pb2.GetEntitlementsResponse,
246
+ idempotency_level=IdempotencyLevel.UNKNOWN,
247
+ ),
248
+ headers=headers,
249
+ timeout_ms=timeout_ms,
250
+ )
@@ -0,0 +1,315 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT!
3
+ # source: authorization/v2/authorization.proto
4
+
5
+ from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping
6
+ from typing import Protocol
7
+
8
+ from connectrpc.client import ConnectClient, ConnectClientSync
9
+ from connectrpc.code import Code
10
+ from connectrpc.errors import ConnectError
11
+ from connectrpc.interceptor import Interceptor, InterceptorSync
12
+ from connectrpc.method import IdempotencyLevel, MethodInfo
13
+ from connectrpc.request import Headers, RequestContext
14
+ from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync
15
+ import authorization.v2.authorization_pb2 as authorization_dot_v2_dot_authorization__pb2
16
+
17
+
18
+ class AuthorizationService(Protocol):
19
+ async def get_decision(self, request: authorization_dot_v2_dot_authorization__pb2.GetDecisionRequest, ctx: RequestContext) -> authorization_dot_v2_dot_authorization__pb2.GetDecisionResponse:
20
+ raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
21
+
22
+ async def get_decision_multi_resource(self, request: authorization_dot_v2_dot_authorization__pb2.GetDecisionMultiResourceRequest, ctx: RequestContext) -> authorization_dot_v2_dot_authorization__pb2.GetDecisionMultiResourceResponse:
23
+ raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
24
+
25
+ async def get_decision_bulk(self, request: authorization_dot_v2_dot_authorization__pb2.GetDecisionBulkRequest, ctx: RequestContext) -> authorization_dot_v2_dot_authorization__pb2.GetDecisionBulkResponse:
26
+ raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
27
+
28
+ async def get_entitlements(self, request: authorization_dot_v2_dot_authorization__pb2.GetEntitlementsRequest, ctx: RequestContext) -> authorization_dot_v2_dot_authorization__pb2.GetEntitlementsResponse:
29
+ raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
30
+
31
+
32
+ class AuthorizationServiceASGIApplication(ConnectASGIApplication[AuthorizationService]):
33
+ def __init__(self, service: AuthorizationService | AsyncGenerator[AuthorizationService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None) -> None:
34
+ super().__init__(
35
+ service=service,
36
+ endpoints=lambda svc: {
37
+ "/authorization.v2.AuthorizationService/GetDecision": Endpoint.unary(
38
+ method=MethodInfo(
39
+ name="GetDecision",
40
+ service_name="authorization.v2.AuthorizationService",
41
+ input=authorization_dot_v2_dot_authorization__pb2.GetDecisionRequest,
42
+ output=authorization_dot_v2_dot_authorization__pb2.GetDecisionResponse,
43
+ idempotency_level=IdempotencyLevel.UNKNOWN,
44
+ ),
45
+ function=svc.get_decision,
46
+ ),
47
+ "/authorization.v2.AuthorizationService/GetDecisionMultiResource": Endpoint.unary(
48
+ method=MethodInfo(
49
+ name="GetDecisionMultiResource",
50
+ service_name="authorization.v2.AuthorizationService",
51
+ input=authorization_dot_v2_dot_authorization__pb2.GetDecisionMultiResourceRequest,
52
+ output=authorization_dot_v2_dot_authorization__pb2.GetDecisionMultiResourceResponse,
53
+ idempotency_level=IdempotencyLevel.UNKNOWN,
54
+ ),
55
+ function=svc.get_decision_multi_resource,
56
+ ),
57
+ "/authorization.v2.AuthorizationService/GetDecisionBulk": Endpoint.unary(
58
+ method=MethodInfo(
59
+ name="GetDecisionBulk",
60
+ service_name="authorization.v2.AuthorizationService",
61
+ input=authorization_dot_v2_dot_authorization__pb2.GetDecisionBulkRequest,
62
+ output=authorization_dot_v2_dot_authorization__pb2.GetDecisionBulkResponse,
63
+ idempotency_level=IdempotencyLevel.UNKNOWN,
64
+ ),
65
+ function=svc.get_decision_bulk,
66
+ ),
67
+ "/authorization.v2.AuthorizationService/GetEntitlements": Endpoint.unary(
68
+ method=MethodInfo(
69
+ name="GetEntitlements",
70
+ service_name="authorization.v2.AuthorizationService",
71
+ input=authorization_dot_v2_dot_authorization__pb2.GetEntitlementsRequest,
72
+ output=authorization_dot_v2_dot_authorization__pb2.GetEntitlementsResponse,
73
+ idempotency_level=IdempotencyLevel.UNKNOWN,
74
+ ),
75
+ function=svc.get_entitlements,
76
+ ),
77
+ },
78
+ interceptors=interceptors,
79
+ read_max_bytes=read_max_bytes,
80
+ )
81
+
82
+ @property
83
+ def path(self) -> str:
84
+ """Returns the URL path to mount the application to when serving multiple applications."""
85
+ return "/authorization.v2.AuthorizationService"
86
+
87
+
88
+ class AuthorizationServiceClient(ConnectClient):
89
+ async def get_decision(
90
+ self,
91
+ request: authorization_dot_v2_dot_authorization__pb2.GetDecisionRequest,
92
+ *,
93
+ headers: Headers | Mapping[str, str] | None = None,
94
+ timeout_ms: int | None = None,
95
+ ) -> authorization_dot_v2_dot_authorization__pb2.GetDecisionResponse:
96
+ return await self.execute_unary(
97
+ request=request,
98
+ method=MethodInfo(
99
+ name="GetDecision",
100
+ service_name="authorization.v2.AuthorizationService",
101
+ input=authorization_dot_v2_dot_authorization__pb2.GetDecisionRequest,
102
+ output=authorization_dot_v2_dot_authorization__pb2.GetDecisionResponse,
103
+ idempotency_level=IdempotencyLevel.UNKNOWN,
104
+ ),
105
+ headers=headers,
106
+ timeout_ms=timeout_ms,
107
+ )
108
+
109
+ async def get_decision_multi_resource(
110
+ self,
111
+ request: authorization_dot_v2_dot_authorization__pb2.GetDecisionMultiResourceRequest,
112
+ *,
113
+ headers: Headers | Mapping[str, str] | None = None,
114
+ timeout_ms: int | None = None,
115
+ ) -> authorization_dot_v2_dot_authorization__pb2.GetDecisionMultiResourceResponse:
116
+ return await self.execute_unary(
117
+ request=request,
118
+ method=MethodInfo(
119
+ name="GetDecisionMultiResource",
120
+ service_name="authorization.v2.AuthorizationService",
121
+ input=authorization_dot_v2_dot_authorization__pb2.GetDecisionMultiResourceRequest,
122
+ output=authorization_dot_v2_dot_authorization__pb2.GetDecisionMultiResourceResponse,
123
+ idempotency_level=IdempotencyLevel.UNKNOWN,
124
+ ),
125
+ headers=headers,
126
+ timeout_ms=timeout_ms,
127
+ )
128
+
129
+ async def get_decision_bulk(
130
+ self,
131
+ request: authorization_dot_v2_dot_authorization__pb2.GetDecisionBulkRequest,
132
+ *,
133
+ headers: Headers | Mapping[str, str] | None = None,
134
+ timeout_ms: int | None = None,
135
+ ) -> authorization_dot_v2_dot_authorization__pb2.GetDecisionBulkResponse:
136
+ return await self.execute_unary(
137
+ request=request,
138
+ method=MethodInfo(
139
+ name="GetDecisionBulk",
140
+ service_name="authorization.v2.AuthorizationService",
141
+ input=authorization_dot_v2_dot_authorization__pb2.GetDecisionBulkRequest,
142
+ output=authorization_dot_v2_dot_authorization__pb2.GetDecisionBulkResponse,
143
+ idempotency_level=IdempotencyLevel.UNKNOWN,
144
+ ),
145
+ headers=headers,
146
+ timeout_ms=timeout_ms,
147
+ )
148
+
149
+ async def get_entitlements(
150
+ self,
151
+ request: authorization_dot_v2_dot_authorization__pb2.GetEntitlementsRequest,
152
+ *,
153
+ headers: Headers | Mapping[str, str] | None = None,
154
+ timeout_ms: int | None = None,
155
+ ) -> authorization_dot_v2_dot_authorization__pb2.GetEntitlementsResponse:
156
+ return await self.execute_unary(
157
+ request=request,
158
+ method=MethodInfo(
159
+ name="GetEntitlements",
160
+ service_name="authorization.v2.AuthorizationService",
161
+ input=authorization_dot_v2_dot_authorization__pb2.GetEntitlementsRequest,
162
+ output=authorization_dot_v2_dot_authorization__pb2.GetEntitlementsResponse,
163
+ idempotency_level=IdempotencyLevel.UNKNOWN,
164
+ ),
165
+ headers=headers,
166
+ timeout_ms=timeout_ms,
167
+ )
168
+
169
+
170
+ class AuthorizationServiceSync(Protocol):
171
+ def get_decision(self, request: authorization_dot_v2_dot_authorization__pb2.GetDecisionRequest, ctx: RequestContext) -> authorization_dot_v2_dot_authorization__pb2.GetDecisionResponse:
172
+ raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
173
+ def get_decision_multi_resource(self, request: authorization_dot_v2_dot_authorization__pb2.GetDecisionMultiResourceRequest, ctx: RequestContext) -> authorization_dot_v2_dot_authorization__pb2.GetDecisionMultiResourceResponse:
174
+ raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
175
+ def get_decision_bulk(self, request: authorization_dot_v2_dot_authorization__pb2.GetDecisionBulkRequest, ctx: RequestContext) -> authorization_dot_v2_dot_authorization__pb2.GetDecisionBulkResponse:
176
+ raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
177
+ def get_entitlements(self, request: authorization_dot_v2_dot_authorization__pb2.GetEntitlementsRequest, ctx: RequestContext) -> authorization_dot_v2_dot_authorization__pb2.GetEntitlementsResponse:
178
+ raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
179
+
180
+
181
+ class AuthorizationServiceWSGIApplication(ConnectWSGIApplication):
182
+ def __init__(self, service: AuthorizationServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None) -> None:
183
+ super().__init__(
184
+ endpoints={
185
+ "/authorization.v2.AuthorizationService/GetDecision": EndpointSync.unary(
186
+ method=MethodInfo(
187
+ name="GetDecision",
188
+ service_name="authorization.v2.AuthorizationService",
189
+ input=authorization_dot_v2_dot_authorization__pb2.GetDecisionRequest,
190
+ output=authorization_dot_v2_dot_authorization__pb2.GetDecisionResponse,
191
+ idempotency_level=IdempotencyLevel.UNKNOWN,
192
+ ),
193
+ function=service.get_decision,
194
+ ),
195
+ "/authorization.v2.AuthorizationService/GetDecisionMultiResource": EndpointSync.unary(
196
+ method=MethodInfo(
197
+ name="GetDecisionMultiResource",
198
+ service_name="authorization.v2.AuthorizationService",
199
+ input=authorization_dot_v2_dot_authorization__pb2.GetDecisionMultiResourceRequest,
200
+ output=authorization_dot_v2_dot_authorization__pb2.GetDecisionMultiResourceResponse,
201
+ idempotency_level=IdempotencyLevel.UNKNOWN,
202
+ ),
203
+ function=service.get_decision_multi_resource,
204
+ ),
205
+ "/authorization.v2.AuthorizationService/GetDecisionBulk": EndpointSync.unary(
206
+ method=MethodInfo(
207
+ name="GetDecisionBulk",
208
+ service_name="authorization.v2.AuthorizationService",
209
+ input=authorization_dot_v2_dot_authorization__pb2.GetDecisionBulkRequest,
210
+ output=authorization_dot_v2_dot_authorization__pb2.GetDecisionBulkResponse,
211
+ idempotency_level=IdempotencyLevel.UNKNOWN,
212
+ ),
213
+ function=service.get_decision_bulk,
214
+ ),
215
+ "/authorization.v2.AuthorizationService/GetEntitlements": EndpointSync.unary(
216
+ method=MethodInfo(
217
+ name="GetEntitlements",
218
+ service_name="authorization.v2.AuthorizationService",
219
+ input=authorization_dot_v2_dot_authorization__pb2.GetEntitlementsRequest,
220
+ output=authorization_dot_v2_dot_authorization__pb2.GetEntitlementsResponse,
221
+ idempotency_level=IdempotencyLevel.UNKNOWN,
222
+ ),
223
+ function=service.get_entitlements,
224
+ ),
225
+ },
226
+ interceptors=interceptors,
227
+ read_max_bytes=read_max_bytes,
228
+ )
229
+
230
+ @property
231
+ def path(self) -> str:
232
+ """Returns the URL path to mount the application to when serving multiple applications."""
233
+ return "/authorization.v2.AuthorizationService"
234
+
235
+
236
+ class AuthorizationServiceClientSync(ConnectClientSync):
237
+ def get_decision(
238
+ self,
239
+ request: authorization_dot_v2_dot_authorization__pb2.GetDecisionRequest,
240
+ *,
241
+ headers: Headers | Mapping[str, str] | None = None,
242
+ timeout_ms: int | None = None,
243
+ ) -> authorization_dot_v2_dot_authorization__pb2.GetDecisionResponse:
244
+ return self.execute_unary(
245
+ request=request,
246
+ method=MethodInfo(
247
+ name="GetDecision",
248
+ service_name="authorization.v2.AuthorizationService",
249
+ input=authorization_dot_v2_dot_authorization__pb2.GetDecisionRequest,
250
+ output=authorization_dot_v2_dot_authorization__pb2.GetDecisionResponse,
251
+ idempotency_level=IdempotencyLevel.UNKNOWN,
252
+ ),
253
+ headers=headers,
254
+ timeout_ms=timeout_ms,
255
+ )
256
+
257
+ def get_decision_multi_resource(
258
+ self,
259
+ request: authorization_dot_v2_dot_authorization__pb2.GetDecisionMultiResourceRequest,
260
+ *,
261
+ headers: Headers | Mapping[str, str] | None = None,
262
+ timeout_ms: int | None = None,
263
+ ) -> authorization_dot_v2_dot_authorization__pb2.GetDecisionMultiResourceResponse:
264
+ return self.execute_unary(
265
+ request=request,
266
+ method=MethodInfo(
267
+ name="GetDecisionMultiResource",
268
+ service_name="authorization.v2.AuthorizationService",
269
+ input=authorization_dot_v2_dot_authorization__pb2.GetDecisionMultiResourceRequest,
270
+ output=authorization_dot_v2_dot_authorization__pb2.GetDecisionMultiResourceResponse,
271
+ idempotency_level=IdempotencyLevel.UNKNOWN,
272
+ ),
273
+ headers=headers,
274
+ timeout_ms=timeout_ms,
275
+ )
276
+
277
+ def get_decision_bulk(
278
+ self,
279
+ request: authorization_dot_v2_dot_authorization__pb2.GetDecisionBulkRequest,
280
+ *,
281
+ headers: Headers | Mapping[str, str] | None = None,
282
+ timeout_ms: int | None = None,
283
+ ) -> authorization_dot_v2_dot_authorization__pb2.GetDecisionBulkResponse:
284
+ return self.execute_unary(
285
+ request=request,
286
+ method=MethodInfo(
287
+ name="GetDecisionBulk",
288
+ service_name="authorization.v2.AuthorizationService",
289
+ input=authorization_dot_v2_dot_authorization__pb2.GetDecisionBulkRequest,
290
+ output=authorization_dot_v2_dot_authorization__pb2.GetDecisionBulkResponse,
291
+ idempotency_level=IdempotencyLevel.UNKNOWN,
292
+ ),
293
+ headers=headers,
294
+ timeout_ms=timeout_ms,
295
+ )
296
+
297
+ def get_entitlements(
298
+ self,
299
+ request: authorization_dot_v2_dot_authorization__pb2.GetEntitlementsRequest,
300
+ *,
301
+ headers: Headers | Mapping[str, str] | None = None,
302
+ timeout_ms: int | None = None,
303
+ ) -> authorization_dot_v2_dot_authorization__pb2.GetEntitlementsResponse:
304
+ return self.execute_unary(
305
+ request=request,
306
+ method=MethodInfo(
307
+ name="GetEntitlements",
308
+ service_name="authorization.v2.AuthorizationService",
309
+ input=authorization_dot_v2_dot_authorization__pb2.GetEntitlementsRequest,
310
+ output=authorization_dot_v2_dot_authorization__pb2.GetEntitlementsResponse,
311
+ idempotency_level=IdempotencyLevel.UNKNOWN,
312
+ ),
313
+ headers=headers,
314
+ timeout_ms=timeout_ms,
315
+ )
@@ -1 +1,11 @@
1
1
  """entityresolution protobuf definitions."""
2
+
3
+ from .entity_resolution_connect import (
4
+ EntityResolutionClient,
5
+ EntityResolutionClientSync,
6
+ )
7
+
8
+ __all__ = [
9
+ "EntityResolutionClient",
10
+ "EntityResolutionClientSync",
11
+ ]