maleo-identity 0.0.30__py3-none-any.whl → 0.0.32__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.
Potentially problematic release.
This version of maleo-identity might be problematic. Click here for more details.
- maleo_identity/client/services/organization.py +266 -23
- maleo_identity/client/services/user.py +293 -27
- maleo_identity/models/transfers/results/__init__.py +2 -2
- maleo_identity/models/transfers/results/repository/__init__.py +17 -0
- maleo_identity/models/transfers/results/repository/organization.py +19 -0
- maleo_identity/models/transfers/results/repository/organization_role.py +19 -0
- maleo_identity/models/transfers/results/repository/user.py +28 -0
- maleo_identity/models/transfers/results/repository/user_organization.py +19 -0
- maleo_identity/models/transfers/results/repository/user_organization_role.py +19 -0
- maleo_identity/models/transfers/results/repository/user_profile.py +19 -0
- maleo_identity/models/transfers/results/repository/user_system_role.py +19 -0
- maleo_identity/types/results/__init__.py +2 -2
- maleo_identity/types/results/repository/__init__.py +17 -0
- maleo_identity/types/results/repository/organization.py +20 -0
- maleo_identity/types/results/repository/organization_role.py +15 -0
- maleo_identity/types/results/repository/user.py +25 -0
- maleo_identity/types/results/repository/user_organization.py +20 -0
- maleo_identity/types/results/repository/user_organization_role.py +15 -0
- maleo_identity/types/results/repository/user_profile.py +20 -0
- maleo_identity/types/results/repository/user_system_role.py +20 -0
- {maleo_identity-0.0.30.dist-info → maleo_identity-0.0.32.dist-info}/METADATA +3 -3
- {maleo_identity-0.0.30.dist-info → maleo_identity-0.0.32.dist-info}/RECORD +24 -24
- maleo_identity/models/transfers/results/query/__init__.py +0 -17
- maleo_identity/models/transfers/results/query/organization.py +0 -19
- maleo_identity/models/transfers/results/query/organization_role.py +0 -19
- maleo_identity/models/transfers/results/query/user.py +0 -28
- maleo_identity/models/transfers/results/query/user_organization.py +0 -19
- maleo_identity/models/transfers/results/query/user_organization_role.py +0 -19
- maleo_identity/models/transfers/results/query/user_profile.py +0 -19
- maleo_identity/models/transfers/results/query/user_system_role.py +0 -19
- maleo_identity/types/results/query/__init__.py +0 -17
- maleo_identity/types/results/query/organization.py +0 -20
- maleo_identity/types/results/query/organization_role.py +0 -15
- maleo_identity/types/results/query/user.py +0 -25
- maleo_identity/types/results/query/user_organization.py +0 -20
- maleo_identity/types/results/query/user_organization_role.py +0 -15
- maleo_identity/types/results/query/user_profile.py +0 -20
- maleo_identity/types/results/query/user_system_role.py +0 -20
- {maleo_identity-0.0.30.dist-info → maleo_identity-0.0.32.dist-info}/WHEEL +0 -0
- {maleo_identity-0.0.30.dist-info → maleo_identity-0.0.32.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
from
|
|
2
|
-
from
|
|
1
|
+
from aiocache import cached, Cache
|
|
2
|
+
from aiocache.serializers import JsonSerializer
|
|
3
|
+
from maleo_foundation.enums import BaseEnums
|
|
4
|
+
from maleo_foundation.managers.cache.base import BaseCacheConfigurations
|
|
5
|
+
from maleo_foundation.managers.client.maleo import MaleoClientService
|
|
6
|
+
from maleo_foundation.utils.client import BaseClientUtils
|
|
3
7
|
from maleo_foundation.utils.exceptions import BaseExceptions
|
|
4
8
|
from maleo_identity.client.controllers import MaleoIdentityUserControllers
|
|
5
9
|
from maleo_identity.enums.general import MaleoIdentityGeneralEnums
|
|
@@ -36,13 +40,15 @@ from maleo_identity.types.results.client.user_system_role \
|
|
|
36
40
|
from maleo_identity.types.results.client.user_organization_role \
|
|
37
41
|
import MaleoIdentityUserOrganizationRoleClientResultsTypes
|
|
38
42
|
|
|
39
|
-
class MaleoIdentityUserClientService(
|
|
43
|
+
class MaleoIdentityUserClientService(MaleoClientService):
|
|
40
44
|
def __init__(
|
|
41
45
|
self,
|
|
46
|
+
key,
|
|
42
47
|
logger,
|
|
48
|
+
service_manager,
|
|
43
49
|
controllers:MaleoIdentityUserControllers
|
|
44
50
|
):
|
|
45
|
-
super().__init__(logger)
|
|
51
|
+
super().__init__(key, logger, service_manager)
|
|
46
52
|
self._controllers = controllers
|
|
47
53
|
|
|
48
54
|
@property
|
|
@@ -60,7 +66,30 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
60
66
|
logger=self._logger,
|
|
61
67
|
fail_result_class=MaleoIdentityUserClientResultsTransfers.Fail
|
|
62
68
|
)
|
|
63
|
-
|
|
69
|
+
@BaseClientUtils.result_processor(
|
|
70
|
+
fail_class=MaleoIdentityUserClientResultsTransfers.Fail,
|
|
71
|
+
data_found_class=MaleoIdentityUserClientResultsTransfers.MultipleData,
|
|
72
|
+
no_data_class=MaleoIdentityUserClientResultsTransfers.NoData
|
|
73
|
+
)
|
|
74
|
+
@cached(
|
|
75
|
+
ttl=int(BaseEnums.CacheTTL.TTL_1DY),
|
|
76
|
+
namespace=self.service_manager.configs.cache.redis.namespaces.create(
|
|
77
|
+
"user",
|
|
78
|
+
type=BaseEnums.CacheType.CLIENT,
|
|
79
|
+
base_override=self.key
|
|
80
|
+
),
|
|
81
|
+
key_builder=BaseCacheConfigurations.key_builder,
|
|
82
|
+
cache=Cache.REDIS,
|
|
83
|
+
serializer=JsonSerializer(),
|
|
84
|
+
endpoint=self.service_manager.configs.cache.redis.host,
|
|
85
|
+
port=self.service_manager.configs.cache.redis.port,
|
|
86
|
+
password=self.service_manager.configs.cache.redis.password,
|
|
87
|
+
db=self.service_manager.configs.cache.redis.db
|
|
88
|
+
)
|
|
89
|
+
async def _impl(
|
|
90
|
+
parameters:MaleoIdentityUserClientParametersTransfers.GetMultiple,
|
|
91
|
+
controller_type:MaleoIdentityGeneralEnums.ClientControllerType = MaleoIdentityGeneralEnums.ClientControllerType.HTTP
|
|
92
|
+
):
|
|
64
93
|
#* Validate chosen controller type
|
|
65
94
|
if not isinstance(
|
|
66
95
|
controller_type,
|
|
@@ -91,6 +120,7 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
91
120
|
MaleoIdentityUserClientResultsTransfers
|
|
92
121
|
.Fail
|
|
93
122
|
.model_validate(controller_result.content)
|
|
123
|
+
.model_dump(mode="json")
|
|
94
124
|
)
|
|
95
125
|
else:
|
|
96
126
|
if controller_result.content["data"] is None:
|
|
@@ -98,14 +128,19 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
98
128
|
MaleoIdentityUserClientResultsTransfers
|
|
99
129
|
.NoData
|
|
100
130
|
.model_validate(controller_result.content)
|
|
131
|
+
.model_dump(mode="json")
|
|
101
132
|
)
|
|
102
133
|
else:
|
|
103
134
|
return (
|
|
104
135
|
MaleoIdentityUserClientResultsTransfers
|
|
105
136
|
.MultipleData
|
|
106
137
|
.model_validate(controller_result.content)
|
|
138
|
+
.model_dump(mode="json")
|
|
107
139
|
)
|
|
108
|
-
return await _impl(
|
|
140
|
+
return await _impl(
|
|
141
|
+
parameters=parameters,
|
|
142
|
+
controller_type=controller_type
|
|
143
|
+
)
|
|
109
144
|
|
|
110
145
|
async def get_user(
|
|
111
146
|
self,
|
|
@@ -118,7 +153,29 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
118
153
|
logger=self._logger,
|
|
119
154
|
fail_result_class=MaleoIdentityUserClientResultsTransfers.Fail
|
|
120
155
|
)
|
|
121
|
-
|
|
156
|
+
@BaseClientUtils.result_processor(
|
|
157
|
+
fail_class=MaleoIdentityUserClientResultsTransfers.Fail,
|
|
158
|
+
data_found_class=MaleoIdentityUserClientResultsTransfers.SingleData
|
|
159
|
+
)
|
|
160
|
+
@cached(
|
|
161
|
+
ttl=int(BaseEnums.CacheTTL.TTL_1DY),
|
|
162
|
+
namespace=self.service_manager.configs.cache.redis.namespaces.create(
|
|
163
|
+
"user",
|
|
164
|
+
type=BaseEnums.CacheType.CLIENT,
|
|
165
|
+
base_override=self.key
|
|
166
|
+
),
|
|
167
|
+
key_builder=BaseCacheConfigurations.key_builder,
|
|
168
|
+
cache=Cache.REDIS,
|
|
169
|
+
serializer=JsonSerializer(),
|
|
170
|
+
endpoint=self.service_manager.configs.cache.redis.host,
|
|
171
|
+
port=self.service_manager.configs.cache.redis.port,
|
|
172
|
+
password=self.service_manager.configs.cache.redis.password,
|
|
173
|
+
db=self.service_manager.configs.cache.redis.db
|
|
174
|
+
)
|
|
175
|
+
async def _impl(
|
|
176
|
+
parameters:MaleoIdentityUserGeneralParametersTransfers.GetSingle,
|
|
177
|
+
controller_type:MaleoIdentityGeneralEnums.ClientControllerType = MaleoIdentityGeneralEnums.ClientControllerType.HTTP
|
|
178
|
+
):
|
|
122
179
|
#* Validate chosen controller type
|
|
123
180
|
if not isinstance(
|
|
124
181
|
controller_type,
|
|
@@ -149,14 +206,19 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
149
206
|
MaleoIdentityUserClientResultsTransfers
|
|
150
207
|
.Fail
|
|
151
208
|
.model_validate(controller_result.content)
|
|
209
|
+
.model_dump(mode="json")
|
|
152
210
|
)
|
|
153
211
|
else:
|
|
154
212
|
return (
|
|
155
213
|
MaleoIdentityUserClientResultsTransfers
|
|
156
214
|
.SingleData
|
|
157
215
|
.model_validate(controller_result.content)
|
|
216
|
+
.model_dump(mode="json")
|
|
158
217
|
)
|
|
159
|
-
return await _impl(
|
|
218
|
+
return await _impl(
|
|
219
|
+
parameters=parameters,
|
|
220
|
+
controller_type=controller_type
|
|
221
|
+
)
|
|
160
222
|
|
|
161
223
|
async def create(
|
|
162
224
|
self,
|
|
@@ -169,7 +231,10 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
169
231
|
logger=self._logger,
|
|
170
232
|
fail_result_class=MaleoIdentityUserClientResultsTransfers.Fail
|
|
171
233
|
)
|
|
172
|
-
async def _impl(
|
|
234
|
+
async def _impl(
|
|
235
|
+
parameters:MaleoIdentityUserGeneralParametersTransfers.Create,
|
|
236
|
+
controller_type:MaleoIdentityGeneralEnums.ClientControllerType = MaleoIdentityGeneralEnums.ClientControllerType.HTTP
|
|
237
|
+
):
|
|
173
238
|
#* Validate chosen controller type
|
|
174
239
|
if not isinstance(
|
|
175
240
|
controller_type,
|
|
@@ -207,7 +272,10 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
207
272
|
.SingleData
|
|
208
273
|
.model_validate(controller_result.content)
|
|
209
274
|
)
|
|
210
|
-
return await _impl(
|
|
275
|
+
return await _impl(
|
|
276
|
+
parameters=parameters,
|
|
277
|
+
controller_type=controller_type
|
|
278
|
+
)
|
|
211
279
|
|
|
212
280
|
async def update(
|
|
213
281
|
self,
|
|
@@ -220,7 +288,10 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
220
288
|
logger=self._logger,
|
|
221
289
|
fail_result_class=MaleoIdentityUserClientResultsTransfers.Fail
|
|
222
290
|
)
|
|
223
|
-
async def _impl(
|
|
291
|
+
async def _impl(
|
|
292
|
+
parameters:MaleoIdentityUserGeneralParametersTransfers.Update,
|
|
293
|
+
controller_type:MaleoIdentityGeneralEnums.ClientControllerType = MaleoIdentityGeneralEnums.ClientControllerType.HTTP
|
|
294
|
+
):
|
|
224
295
|
#* Validate chosen controller type
|
|
225
296
|
if not isinstance(
|
|
226
297
|
controller_type,
|
|
@@ -258,7 +329,10 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
258
329
|
.SingleData
|
|
259
330
|
.model_validate(controller_result.content)
|
|
260
331
|
)
|
|
261
|
-
return await _impl(
|
|
332
|
+
return await _impl(
|
|
333
|
+
parameters=parameters,
|
|
334
|
+
controller_type=controller_type
|
|
335
|
+
)
|
|
262
336
|
|
|
263
337
|
async def get_password(
|
|
264
338
|
self,
|
|
@@ -271,7 +345,29 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
271
345
|
logger=self._logger,
|
|
272
346
|
fail_result_class=MaleoIdentityUserClientResultsTransfers.Fail
|
|
273
347
|
)
|
|
274
|
-
|
|
348
|
+
@BaseClientUtils.result_processor(
|
|
349
|
+
fail_class=MaleoIdentityUserClientResultsTransfers.Fail,
|
|
350
|
+
data_found_class=MaleoIdentityUserClientResultsTransfers.SinglePassword
|
|
351
|
+
)
|
|
352
|
+
@cached(
|
|
353
|
+
ttl=int(BaseEnums.CacheTTL.TTL_1DY),
|
|
354
|
+
namespace=self.service_manager.configs.cache.redis.namespaces.create(
|
|
355
|
+
"user",
|
|
356
|
+
type=BaseEnums.CacheType.CLIENT,
|
|
357
|
+
base_override=self.key
|
|
358
|
+
),
|
|
359
|
+
key_builder=BaseCacheConfigurations.key_builder,
|
|
360
|
+
cache=Cache.REDIS,
|
|
361
|
+
serializer=JsonSerializer(),
|
|
362
|
+
endpoint=self.service_manager.configs.cache.redis.host,
|
|
363
|
+
port=self.service_manager.configs.cache.redis.port,
|
|
364
|
+
password=self.service_manager.configs.cache.redis.password,
|
|
365
|
+
db=self.service_manager.configs.cache.redis.db
|
|
366
|
+
)
|
|
367
|
+
async def _impl(
|
|
368
|
+
parameters:MaleoIdentityUserGeneralParametersTransfers.GetSinglePassword,
|
|
369
|
+
controller_type:MaleoIdentityGeneralEnums.ClientControllerType = MaleoIdentityGeneralEnums.ClientControllerType.HTTP
|
|
370
|
+
):
|
|
275
371
|
#* Validate chosen controller type
|
|
276
372
|
if not isinstance(
|
|
277
373
|
controller_type,
|
|
@@ -302,14 +398,19 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
302
398
|
MaleoIdentityUserClientResultsTransfers
|
|
303
399
|
.Fail
|
|
304
400
|
.model_validate(controller_result.content)
|
|
401
|
+
.model_dump(mode="json")
|
|
305
402
|
)
|
|
306
403
|
else:
|
|
307
404
|
return (
|
|
308
405
|
MaleoIdentityUserClientResultsTransfers
|
|
309
406
|
.SinglePassword
|
|
310
407
|
.model_validate(controller_result.content)
|
|
408
|
+
.model_dump(mode="json")
|
|
311
409
|
)
|
|
312
|
-
return await _impl(
|
|
410
|
+
return await _impl(
|
|
411
|
+
parameters=parameters,
|
|
412
|
+
controller_type=controller_type
|
|
413
|
+
)
|
|
313
414
|
|
|
314
415
|
async def get_user_organizations(
|
|
315
416
|
self,
|
|
@@ -322,7 +423,30 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
322
423
|
logger=self._logger,
|
|
323
424
|
fail_result_class=MaleoIdentityUserOrganizationClientResultsTransfers.Fail
|
|
324
425
|
)
|
|
325
|
-
|
|
426
|
+
@BaseClientUtils.result_processor(
|
|
427
|
+
fail_class=MaleoIdentityUserOrganizationClientResultsTransfers.Fail,
|
|
428
|
+
data_found_class=MaleoIdentityUserOrganizationClientResultsTransfers.MultipleData,
|
|
429
|
+
no_data_class=MaleoIdentityUserOrganizationClientResultsTransfers.NoData
|
|
430
|
+
)
|
|
431
|
+
@cached(
|
|
432
|
+
ttl=int(BaseEnums.CacheTTL.TTL_1DY),
|
|
433
|
+
namespace=self.service_manager.configs.cache.redis.namespaces.create(
|
|
434
|
+
"user_organization",
|
|
435
|
+
type=BaseEnums.CacheType.CLIENT,
|
|
436
|
+
base_override=self.key
|
|
437
|
+
),
|
|
438
|
+
key_builder=BaseCacheConfigurations.key_builder,
|
|
439
|
+
cache=Cache.REDIS,
|
|
440
|
+
serializer=JsonSerializer(),
|
|
441
|
+
endpoint=self.service_manager.configs.cache.redis.host,
|
|
442
|
+
port=self.service_manager.configs.cache.redis.port,
|
|
443
|
+
password=self.service_manager.configs.cache.redis.password,
|
|
444
|
+
db=self.service_manager.configs.cache.redis.db
|
|
445
|
+
)
|
|
446
|
+
async def _impl(
|
|
447
|
+
parameters:MaleoIdentityUserOrganizationClientParametersTransfers.GetMultipleFromUser,
|
|
448
|
+
controller_type:MaleoIdentityGeneralEnums.ClientControllerType = MaleoIdentityGeneralEnums.ClientControllerType.HTTP
|
|
449
|
+
):
|
|
326
450
|
#* Validate chosen controller type
|
|
327
451
|
if not isinstance(
|
|
328
452
|
controller_type,
|
|
@@ -353,6 +477,7 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
353
477
|
MaleoIdentityUserOrganizationClientResultsTransfers
|
|
354
478
|
.Fail
|
|
355
479
|
.model_validate(controller_result.content)
|
|
480
|
+
.model_dump(mode="json")
|
|
356
481
|
)
|
|
357
482
|
else:
|
|
358
483
|
if controller_result.content["data"] is None:
|
|
@@ -360,14 +485,19 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
360
485
|
MaleoIdentityUserOrganizationClientResultsTransfers
|
|
361
486
|
.NoData
|
|
362
487
|
.model_validate(controller_result.content)
|
|
488
|
+
.model_dump(mode="json")
|
|
363
489
|
)
|
|
364
490
|
else:
|
|
365
491
|
return (
|
|
366
492
|
MaleoIdentityUserOrganizationClientResultsTransfers
|
|
367
|
-
.MultipleData
|
|
368
|
-
model_validate(controller_result.content)
|
|
493
|
+
.MultipleData
|
|
494
|
+
.model_validate(controller_result.content)
|
|
495
|
+
.model_dump(mode="json")
|
|
369
496
|
)
|
|
370
|
-
return await _impl(
|
|
497
|
+
return await _impl(
|
|
498
|
+
parameters=parameters,
|
|
499
|
+
controller_type=controller_type
|
|
500
|
+
)
|
|
371
501
|
|
|
372
502
|
async def get_user_organization(
|
|
373
503
|
self,
|
|
@@ -380,7 +510,29 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
380
510
|
logger=self._logger,
|
|
381
511
|
fail_result_class=MaleoIdentityUserOrganizationClientResultsTransfers.Fail
|
|
382
512
|
)
|
|
383
|
-
|
|
513
|
+
@BaseClientUtils.result_processor(
|
|
514
|
+
fail_class=MaleoIdentityUserOrganizationClientResultsTransfers.Fail,
|
|
515
|
+
data_found_class=MaleoIdentityUserOrganizationClientResultsTransfers.SingleData
|
|
516
|
+
)
|
|
517
|
+
@cached(
|
|
518
|
+
ttl=int(BaseEnums.CacheTTL.TTL_1DY),
|
|
519
|
+
namespace=self.service_manager.configs.cache.redis.namespaces.create(
|
|
520
|
+
"user_organization",
|
|
521
|
+
type=BaseEnums.CacheType.CLIENT,
|
|
522
|
+
base_override=self.key
|
|
523
|
+
),
|
|
524
|
+
key_builder=BaseCacheConfigurations.key_builder,
|
|
525
|
+
cache=Cache.REDIS,
|
|
526
|
+
serializer=JsonSerializer(),
|
|
527
|
+
endpoint=self.service_manager.configs.cache.redis.host,
|
|
528
|
+
port=self.service_manager.configs.cache.redis.port,
|
|
529
|
+
password=self.service_manager.configs.cache.redis.password,
|
|
530
|
+
db=self.service_manager.configs.cache.redis.db
|
|
531
|
+
)
|
|
532
|
+
async def _impl(
|
|
533
|
+
parameters:MaleoIdentityUserOrganizationGeneralParametersTransfers.GetSingle,
|
|
534
|
+
controller_type:MaleoIdentityGeneralEnums.ClientControllerType = MaleoIdentityGeneralEnums.ClientControllerType.HTTP
|
|
535
|
+
):
|
|
384
536
|
#* Validate chosen controller type
|
|
385
537
|
if not isinstance(
|
|
386
538
|
controller_type,
|
|
@@ -411,14 +563,19 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
411
563
|
MaleoIdentityUserOrganizationClientResultsTransfers
|
|
412
564
|
.Fail
|
|
413
565
|
.model_validate(controller_result.content)
|
|
566
|
+
.model_dump(mode="json")
|
|
414
567
|
)
|
|
415
568
|
else:
|
|
416
569
|
return (
|
|
417
570
|
MaleoIdentityUserOrganizationClientResultsTransfers
|
|
418
571
|
.SingleData
|
|
419
572
|
.model_validate(controller_result.content)
|
|
573
|
+
.model_dump(mode="json")
|
|
420
574
|
)
|
|
421
|
-
return await _impl(
|
|
575
|
+
return await _impl(
|
|
576
|
+
parameters=parameters,
|
|
577
|
+
controller_type=controller_type
|
|
578
|
+
)
|
|
422
579
|
|
|
423
580
|
async def get_user_system_roles(
|
|
424
581
|
self,
|
|
@@ -431,6 +588,26 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
431
588
|
logger=self._logger,
|
|
432
589
|
fail_result_class=MaleoIdentityUserSystemRoleClientResultsTransfers.Fail
|
|
433
590
|
)
|
|
591
|
+
@BaseClientUtils.result_processor(
|
|
592
|
+
fail_class=MaleoIdentityUserSystemRoleClientResultsTransfers.Fail,
|
|
593
|
+
data_found_class=MaleoIdentityUserSystemRoleClientResultsTransfers.MultipleData,
|
|
594
|
+
no_data_class=MaleoIdentityUserSystemRoleClientResultsTransfers.NoData
|
|
595
|
+
)
|
|
596
|
+
@cached(
|
|
597
|
+
ttl=int(BaseEnums.CacheTTL.TTL_1DY),
|
|
598
|
+
namespace=self.service_manager.configs.cache.redis.namespaces.create(
|
|
599
|
+
"user_system_role",
|
|
600
|
+
type=BaseEnums.CacheType.CLIENT,
|
|
601
|
+
base_override=self.key
|
|
602
|
+
),
|
|
603
|
+
key_builder=BaseCacheConfigurations.key_builder,
|
|
604
|
+
cache=Cache.REDIS,
|
|
605
|
+
serializer=JsonSerializer(),
|
|
606
|
+
endpoint=self.service_manager.configs.cache.redis.host,
|
|
607
|
+
port=self.service_manager.configs.cache.redis.port,
|
|
608
|
+
password=self.service_manager.configs.cache.redis.password,
|
|
609
|
+
db=self.service_manager.configs.cache.redis.db
|
|
610
|
+
)
|
|
434
611
|
async def _impl():
|
|
435
612
|
#* Validate chosen controller type
|
|
436
613
|
if not isinstance(
|
|
@@ -462,6 +639,7 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
462
639
|
MaleoIdentityUserSystemRoleClientResultsTransfers
|
|
463
640
|
.Fail
|
|
464
641
|
.model_validate(controller_result.content)
|
|
642
|
+
.model_dump(mode="json")
|
|
465
643
|
)
|
|
466
644
|
else:
|
|
467
645
|
if controller_result.content["data"] is None:
|
|
@@ -469,14 +647,19 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
469
647
|
MaleoIdentityUserSystemRoleClientResultsTransfers
|
|
470
648
|
.NoData
|
|
471
649
|
.model_validate(controller_result.content)
|
|
650
|
+
.model_dump(mode="json")
|
|
472
651
|
)
|
|
473
652
|
else:
|
|
474
653
|
return (
|
|
475
654
|
MaleoIdentityUserSystemRoleClientResultsTransfers
|
|
476
655
|
.MultipleData
|
|
477
656
|
.model_validate(controller_result.content)
|
|
657
|
+
.model_dump(mode="json")
|
|
478
658
|
)
|
|
479
|
-
return await _impl(
|
|
659
|
+
return await _impl(
|
|
660
|
+
parameters=parameters,
|
|
661
|
+
controller_type=controller_type
|
|
662
|
+
)
|
|
480
663
|
|
|
481
664
|
async def get_user_system_role(
|
|
482
665
|
self,
|
|
@@ -489,7 +672,29 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
489
672
|
logger=self._logger,
|
|
490
673
|
fail_result_class=MaleoIdentityUserSystemRoleClientResultsTransfers.Fail
|
|
491
674
|
)
|
|
492
|
-
|
|
675
|
+
@BaseClientUtils.result_processor(
|
|
676
|
+
fail_class=MaleoIdentityUserSystemRoleClientResultsTransfers.Fail,
|
|
677
|
+
data_found_class=MaleoIdentityUserSystemRoleClientResultsTransfers.SingleData
|
|
678
|
+
)
|
|
679
|
+
@cached(
|
|
680
|
+
ttl=int(BaseEnums.CacheTTL.TTL_1DY),
|
|
681
|
+
namespace=self.service_manager.configs.cache.redis.namespaces.create(
|
|
682
|
+
"user_system_role",
|
|
683
|
+
type=BaseEnums.CacheType.CLIENT,
|
|
684
|
+
base_override=self.key
|
|
685
|
+
),
|
|
686
|
+
key_builder=BaseCacheConfigurations.key_builder,
|
|
687
|
+
cache=Cache.REDIS,
|
|
688
|
+
serializer=JsonSerializer(),
|
|
689
|
+
endpoint=self.service_manager.configs.cache.redis.host,
|
|
690
|
+
port=self.service_manager.configs.cache.redis.port,
|
|
691
|
+
password=self.service_manager.configs.cache.redis.password,
|
|
692
|
+
db=self.service_manager.configs.cache.redis.db
|
|
693
|
+
)
|
|
694
|
+
async def _impl(
|
|
695
|
+
parameters:MaleoIdentityUserSystemRoleClientParametersTransfers.GetMultipleFromUser,
|
|
696
|
+
controller_type:MaleoIdentityGeneralEnums.ClientControllerType = MaleoIdentityGeneralEnums.ClientControllerType.HTTP
|
|
697
|
+
):
|
|
493
698
|
#* Validate chosen controller type
|
|
494
699
|
if not isinstance(
|
|
495
700
|
controller_type,
|
|
@@ -519,14 +724,19 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
519
724
|
MaleoIdentityUserSystemRoleClientResultsTransfers
|
|
520
725
|
.Fail
|
|
521
726
|
.model_validate(controller_result.content)
|
|
727
|
+
.model_dump(mode="json")
|
|
522
728
|
)
|
|
523
729
|
else:
|
|
524
730
|
return (
|
|
525
731
|
MaleoIdentityUserSystemRoleClientResultsTransfers
|
|
526
732
|
.SingleData
|
|
527
733
|
.model_validate(controller_result.content)
|
|
734
|
+
.model_dump(mode="json")
|
|
528
735
|
)
|
|
529
|
-
return await _impl(
|
|
736
|
+
return await _impl(
|
|
737
|
+
parameters=parameters,
|
|
738
|
+
controller_type=controller_type
|
|
739
|
+
)
|
|
530
740
|
|
|
531
741
|
async def get_user_organization_roles(
|
|
532
742
|
self,
|
|
@@ -539,7 +749,30 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
539
749
|
logger=self._logger,
|
|
540
750
|
fail_result_class=MaleoIdentityUserOrganizationRoleClientResultsTransfers.Fail
|
|
541
751
|
)
|
|
542
|
-
|
|
752
|
+
@BaseClientUtils.result_processor(
|
|
753
|
+
fail_class=MaleoIdentityUserOrganizationRoleClientResultsTransfers.Fail,
|
|
754
|
+
data_found_class=MaleoIdentityUserOrganizationRoleClientResultsTransfers.MultipleData,
|
|
755
|
+
no_data_class=MaleoIdentityUserOrganizationRoleClientResultsTransfers.NoData
|
|
756
|
+
)
|
|
757
|
+
@cached(
|
|
758
|
+
ttl=int(BaseEnums.CacheTTL.TTL_1DY),
|
|
759
|
+
namespace=self.service_manager.configs.cache.redis.namespaces.create(
|
|
760
|
+
"user_organization_role",
|
|
761
|
+
type=BaseEnums.CacheType.CLIENT,
|
|
762
|
+
base_override=self.key
|
|
763
|
+
),
|
|
764
|
+
key_builder=BaseCacheConfigurations.key_builder,
|
|
765
|
+
cache=Cache.REDIS,
|
|
766
|
+
serializer=JsonSerializer(),
|
|
767
|
+
endpoint=self.service_manager.configs.cache.redis.host,
|
|
768
|
+
port=self.service_manager.configs.cache.redis.port,
|
|
769
|
+
password=self.service_manager.configs.cache.redis.password,
|
|
770
|
+
db=self.service_manager.configs.cache.redis.db
|
|
771
|
+
)
|
|
772
|
+
async def _impl(
|
|
773
|
+
parameters:MaleoIdentityUserOrganizationRoleClientParametersTransfers.GetMultipleFromUserOrOrganization,
|
|
774
|
+
controller_type:MaleoIdentityGeneralEnums.ClientControllerType = MaleoIdentityGeneralEnums.ClientControllerType.HTTP
|
|
775
|
+
):
|
|
543
776
|
#* Validate chosen controller type
|
|
544
777
|
if not isinstance(
|
|
545
778
|
controller_type,
|
|
@@ -570,6 +803,7 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
570
803
|
MaleoIdentityUserOrganizationRoleClientResultsTransfers
|
|
571
804
|
.Fail
|
|
572
805
|
.model_validate(controller_result.content)
|
|
806
|
+
.model_dump(mode="json")
|
|
573
807
|
)
|
|
574
808
|
else:
|
|
575
809
|
if controller_result.content["data"] is None:
|
|
@@ -577,14 +811,19 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
577
811
|
MaleoIdentityUserOrganizationRoleClientResultsTransfers
|
|
578
812
|
.NoData
|
|
579
813
|
.model_validate(controller_result.content)
|
|
814
|
+
.model_dump(mode="json")
|
|
580
815
|
)
|
|
581
816
|
else:
|
|
582
817
|
return (
|
|
583
818
|
MaleoIdentityUserOrganizationRoleClientResultsTransfers
|
|
584
819
|
.MultipleData
|
|
585
820
|
.model_validate(controller_result.content)
|
|
821
|
+
.model_dump(mode="json")
|
|
586
822
|
)
|
|
587
|
-
return await _impl(
|
|
823
|
+
return await _impl(
|
|
824
|
+
parameters=parameters,
|
|
825
|
+
controller_type=controller_type
|
|
826
|
+
)
|
|
588
827
|
|
|
589
828
|
async def get_user_organization_role(
|
|
590
829
|
self,
|
|
@@ -597,7 +836,29 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
597
836
|
logger=self._logger,
|
|
598
837
|
fail_result_class=MaleoIdentityUserOrganizationRoleClientResultsTransfers.Fail
|
|
599
838
|
)
|
|
600
|
-
|
|
839
|
+
@BaseClientUtils.result_processor(
|
|
840
|
+
fail_class=MaleoIdentityUserOrganizationRoleClientResultsTransfers.Fail,
|
|
841
|
+
data_found_class=MaleoIdentityUserOrganizationRoleClientResultsTransfers.SingleData
|
|
842
|
+
)
|
|
843
|
+
@cached(
|
|
844
|
+
ttl=int(BaseEnums.CacheTTL.TTL_1DY),
|
|
845
|
+
namespace=self.service_manager.configs.cache.redis.namespaces.create(
|
|
846
|
+
"user_organization_role",
|
|
847
|
+
type=BaseEnums.CacheType.CLIENT,
|
|
848
|
+
base_override=self.key
|
|
849
|
+
),
|
|
850
|
+
key_builder=BaseCacheConfigurations.key_builder,
|
|
851
|
+
cache=Cache.REDIS,
|
|
852
|
+
serializer=JsonSerializer(),
|
|
853
|
+
endpoint=self.service_manager.configs.cache.redis.host,
|
|
854
|
+
port=self.service_manager.configs.cache.redis.port,
|
|
855
|
+
password=self.service_manager.configs.cache.redis.password,
|
|
856
|
+
db=self.service_manager.configs.cache.redis.db
|
|
857
|
+
)
|
|
858
|
+
async def _impl(
|
|
859
|
+
parameters:MaleoIdentityUserOrganizationRoleGeneralParametersTransfers.GetSingle,
|
|
860
|
+
controller_type:MaleoIdentityGeneralEnums.ClientControllerType = MaleoIdentityGeneralEnums.ClientControllerType.HTTP
|
|
861
|
+
):
|
|
601
862
|
#* Validate chosen controller type
|
|
602
863
|
if not isinstance(
|
|
603
864
|
controller_type,
|
|
@@ -628,11 +889,16 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
628
889
|
MaleoIdentityUserOrganizationRoleClientResultsTransfers
|
|
629
890
|
.Fail
|
|
630
891
|
.model_validate(controller_result.content)
|
|
892
|
+
.model_dump(mode="json")
|
|
631
893
|
)
|
|
632
894
|
else:
|
|
633
895
|
return (
|
|
634
896
|
MaleoIdentityUserOrganizationRoleClientResultsTransfers
|
|
635
897
|
.SingleData
|
|
636
898
|
.model_validate(controller_result.content)
|
|
899
|
+
.model_dump(mode="json")
|
|
637
900
|
)
|
|
638
|
-
return await _impl(
|
|
901
|
+
return await _impl(
|
|
902
|
+
parameters=parameters,
|
|
903
|
+
controller_type=controller_type
|
|
904
|
+
)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
from .client import MaleoIdentityClientResultsTransfers
|
|
3
3
|
from .general import MaleoIdentityGeneralResultsTransfers
|
|
4
|
-
from .
|
|
4
|
+
from .repository import MaleoIdentityRepositoryResultsTransfers
|
|
5
5
|
|
|
6
6
|
class MaleoIdentityResultsTransfers:
|
|
7
7
|
Client = MaleoIdentityClientResultsTransfers
|
|
8
8
|
General = MaleoIdentityGeneralResultsTransfers
|
|
9
|
-
Query =
|
|
9
|
+
Query = MaleoIdentityRepositoryResultsTransfers
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from .organization_role import MaleoIdentityOrganizationRoleRepositoryResultsTransfers
|
|
3
|
+
from .organization import MaleoIdentityOrganizationRepositoryResultsTransfers
|
|
4
|
+
from .user_organization_role import MaleoIdentityUserOrganizationRoleRepositoryResultsTransfers
|
|
5
|
+
from .user_organization import MaleoIdentityUserOrganizationRepositoryResultsTransfers
|
|
6
|
+
from .user_profile import MaleoIdentityUserProfileRepositoryResultsTransfers
|
|
7
|
+
from .user_system_role import MaleoIdentityUserSystemRoleRepositoryResultsTransfers
|
|
8
|
+
from .user import MaleoIdentityUserRepositoryResultsTransfers
|
|
9
|
+
|
|
10
|
+
class MaleoIdentityRepositoryResultsTransfers:
|
|
11
|
+
OrganizationRole = MaleoIdentityOrganizationRoleRepositoryResultsTransfers
|
|
12
|
+
Organization = MaleoIdentityOrganizationRepositoryResultsTransfers
|
|
13
|
+
UserOrganizationRole = MaleoIdentityUserOrganizationRoleRepositoryResultsTransfers
|
|
14
|
+
UserOrganization = MaleoIdentityUserOrganizationRepositoryResultsTransfers
|
|
15
|
+
UserProfile = MaleoIdentityUserProfileRepositoryResultsTransfers
|
|
16
|
+
UserSystemRole = MaleoIdentityUserSystemRoleRepositoryResultsTransfers
|
|
17
|
+
User = MaleoIdentityUserRepositoryResultsTransfers
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from maleo_foundation.models.transfers.results.service.repository import BaseServiceRepositoryResultsTransfers
|
|
3
|
+
from maleo_identity.models.schemas.results.organization import MaleoIdentityOrganizationResultsSchemas
|
|
4
|
+
|
|
5
|
+
class MaleoIdentityOrganizationRepositoryResultsTransfers:
|
|
6
|
+
class Row(
|
|
7
|
+
MaleoIdentityOrganizationResultsSchemas.Query,
|
|
8
|
+
BaseServiceRepositoryResultsTransfers.Row
|
|
9
|
+
): pass
|
|
10
|
+
|
|
11
|
+
class Fail(BaseServiceRepositoryResultsTransfers.Fail): pass
|
|
12
|
+
|
|
13
|
+
class NoData(BaseServiceRepositoryResultsTransfers.NoData): pass
|
|
14
|
+
|
|
15
|
+
class SingleData(BaseServiceRepositoryResultsTransfers.SingleData):
|
|
16
|
+
data:MaleoIdentityOrganizationRepositoryResultsTransfers.Row
|
|
17
|
+
|
|
18
|
+
class MultipleData(BaseServiceRepositoryResultsTransfers.PaginatedMultipleData):
|
|
19
|
+
data:list[MaleoIdentityOrganizationRepositoryResultsTransfers.Row]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from maleo_foundation.models.transfers.results.service.repository import BaseServiceRepositoryResultsTransfers
|
|
3
|
+
from maleo_identity.models.schemas.results.organization_role import MaleoIdentityOrganizationRoleResultsSchemas
|
|
4
|
+
|
|
5
|
+
class MaleoIdentityOrganizationRoleRepositoryResultsTransfers:
|
|
6
|
+
class Row(
|
|
7
|
+
MaleoIdentityOrganizationRoleResultsSchemas.Base,
|
|
8
|
+
BaseServiceRepositoryResultsTransfers.Row
|
|
9
|
+
): pass
|
|
10
|
+
|
|
11
|
+
class Fail(BaseServiceRepositoryResultsTransfers.Fail): pass
|
|
12
|
+
|
|
13
|
+
class NoData(BaseServiceRepositoryResultsTransfers.NoData): pass
|
|
14
|
+
|
|
15
|
+
class SingleData(BaseServiceRepositoryResultsTransfers.SingleData):
|
|
16
|
+
data:MaleoIdentityOrganizationRoleRepositoryResultsTransfers.Row
|
|
17
|
+
|
|
18
|
+
class MultipleData(BaseServiceRepositoryResultsTransfers.PaginatedMultipleData):
|
|
19
|
+
data:list[MaleoIdentityOrganizationRoleRepositoryResultsTransfers.Row]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from maleo_foundation.models.schemas.result import BaseResultSchemas
|
|
3
|
+
from maleo_foundation.models.transfers.results.service.repository import BaseServiceRepositoryResultsTransfers
|
|
4
|
+
from maleo_identity.models.schemas.results.user import MaleoIdentityUserResultsSchemas
|
|
5
|
+
|
|
6
|
+
class MaleoIdentityUserRepositoryResultsTransfers:
|
|
7
|
+
class Row(
|
|
8
|
+
MaleoIdentityUserResultsSchemas.Query,
|
|
9
|
+
BaseServiceRepositoryResultsTransfers.Row
|
|
10
|
+
): pass
|
|
11
|
+
|
|
12
|
+
class Fail(BaseServiceRepositoryResultsTransfers.Fail): pass
|
|
13
|
+
|
|
14
|
+
class NoData(BaseServiceRepositoryResultsTransfers.NoData): pass
|
|
15
|
+
|
|
16
|
+
class SingleData(BaseServiceRepositoryResultsTransfers.SingleData):
|
|
17
|
+
data:MaleoIdentityUserRepositoryResultsTransfers.Row
|
|
18
|
+
|
|
19
|
+
class MultipleData(BaseServiceRepositoryResultsTransfers.PaginatedMultipleData):
|
|
20
|
+
data:list[MaleoIdentityUserRepositoryResultsTransfers.Row]
|
|
21
|
+
|
|
22
|
+
class PasswordRow(
|
|
23
|
+
MaleoIdentityUserResultsSchemas.PasswordQuery,
|
|
24
|
+
BaseResultSchemas.BaseRow
|
|
25
|
+
): pass
|
|
26
|
+
|
|
27
|
+
class SinglePassword(BaseServiceRepositoryResultsTransfers.SingleData):
|
|
28
|
+
data:MaleoIdentityUserRepositoryResultsTransfers.PasswordRow
|