maleo-identity 0.0.8__tar.gz → 0.0.10__tar.gz
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-0.0.8 → maleo_identity-0.0.10}/PKG-INFO +3 -3
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/client/controllers/http/user.py +34 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/client/services/organization.py +3 -2
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/client/services/user.py +76 -2
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/parameters/client/user_system_role.py +6 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity.egg-info/PKG-INFO +3 -3
- maleo_identity-0.0.10/maleo_identity.egg-info/requires.txt +2 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/pyproject.toml +3 -3
- maleo_identity-0.0.8/maleo_identity.egg-info/requires.txt +0 -2
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/README.md +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/client/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/client/controllers/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/client/controllers/http/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/client/controllers/http/organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/client/manager.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/client/services/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/constants/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/constants/organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/constants/user.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/constants/user_organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/constants/user_profile.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/constants/user_system_role.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/db.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/enums/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/enums/general.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/enums/organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/enums/user.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/enums/user_organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/enums/user_profile.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/enums/user_system_role.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/responses/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/responses/organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/responses/user.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/responses/user_organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/responses/user_profile.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/responses/user_system_role.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/general/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/general/organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/general/user.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/general/user_organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/general/user_profile.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/general/user_system_role.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/parameters/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/parameters/organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/parameters/user.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/parameters/user_organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/parameters/user_profile.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/parameters/user_system_role.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/results/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/results/organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/results/user.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/results/user_organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/results/user_profile.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/results/user_system_role.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/tables/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/tables/organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/tables/user.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/tables/user_organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/tables/user_profile.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/tables/user_system_role.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/general/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/general/organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/general/user.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/general/user_organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/general/user_profile.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/general/user_system_role.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/parameters/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/parameters/client/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/parameters/client/organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/parameters/client/user.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/parameters/client/user_organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/parameters/client/user_profile.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/parameters/general/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/parameters/general/organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/parameters/general/user.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/parameters/general/user_organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/parameters/general/user_profile.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/parameters/general/user_system_role.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/parameters/service/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/parameters/service/organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/parameters/service/user.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/parameters/service/user_organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/parameters/service/user_profile.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/parameters/service/user_system_role.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/results/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/results/general/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/results/general/organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/results/general/user.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/results/general/user_organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/results/general/user_profile.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/results/general/user_system_role.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/results/query/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/results/query/organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/results/query/user.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/results/query/user_organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/results/query/user_profile.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/results/query/user_system_role.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/results/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/results/general/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/results/general/organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/results/general/user.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/results/general/user_organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/results/general/user_profile.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/results/general/user_system_role.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/results/query/__init__.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/results/query/organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/results/query/user.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/results/query/user_organization.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/results/query/user_profile.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/results/query/user_system_role.py +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity.egg-info/SOURCES.txt +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity.egg-info/dependency_links.txt +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity.egg-info/top_level.txt +0 -0
- {maleo_identity-0.0.8 → maleo_identity-0.0.10}/setup.cfg +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maleo-identity
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.10
|
|
4
4
|
Summary: MaleoIdentity service package
|
|
5
5
|
Author-email: Agra Bima Yuda <agra@nexmedis.com>
|
|
6
6
|
License: MIT
|
|
7
7
|
Requires-Python: >=3.7
|
|
8
8
|
Description-Content-Type: text/markdown
|
|
9
|
-
Requires-Dist: maleo_foundation>=0.1.
|
|
10
|
-
Requires-Dist: maleo_metadata>=0.0.
|
|
9
|
+
Requires-Dist: maleo_foundation>=0.1.92
|
|
10
|
+
Requires-Dist: maleo_metadata>=0.0.64
|
|
11
11
|
|
|
12
12
|
# README #
|
|
13
13
|
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/client/controllers/http/user.py
RENAMED
|
@@ -2,7 +2,9 @@ from maleo_foundation.managers.client.base import BearerAuth
|
|
|
2
2
|
from maleo_foundation.managers.client.maleo import MaleoClientHTTPController
|
|
3
3
|
from maleo_foundation.models.transfers.results.client.controllers.http import BaseClientHTTPControllerResults
|
|
4
4
|
from maleo_identity.models.transfers.parameters.general.user import MaleoIdentityUserGeneralParametersTransfers
|
|
5
|
+
from maleo_identity.models.transfers.parameters.general.user_system_role import MaleoIdentityUserSystemRoleGeneralParametersTransfers
|
|
5
6
|
from maleo_identity.models.transfers.parameters.client.user import MaleoIdentityUserClientParametersTransfers
|
|
7
|
+
from maleo_identity.models.transfers.parameters.client.user_system_role import MaleoIdentityUserSystemRoleClientParametersTransfers
|
|
6
8
|
|
|
7
9
|
class MaleoIdentityUserHTTPController(MaleoClientHTTPController):
|
|
8
10
|
async def get_users(self, parameters:MaleoIdentityUserClientParametersTransfers.GetMultiple) -> BaseClientHTTPControllerResults:
|
|
@@ -86,4 +88,36 @@ class MaleoIdentityUserHTTPController(MaleoClientHTTPController):
|
|
|
86
88
|
|
|
87
89
|
#* Send request and wait for response
|
|
88
90
|
response = await client.get(url=url, auth=auth)
|
|
91
|
+
return BaseClientHTTPControllerResults(response=response)
|
|
92
|
+
|
|
93
|
+
async def get_user_system_roles(self, parameters:MaleoIdentityUserSystemRoleClientParametersTransfers.GetMultipleFromUser) -> BaseClientHTTPControllerResults:
|
|
94
|
+
"""Get user's system roles from MaleoIdentity"""
|
|
95
|
+
async with self._manager.get_client() as client:
|
|
96
|
+
#* Define URL
|
|
97
|
+
url = f"{self._manager.url.api}/v1/users/{parameters.user_id}/system-roles/"
|
|
98
|
+
|
|
99
|
+
#* Parse parameters to query params
|
|
100
|
+
params = MaleoIdentityUserSystemRoleClientParametersTransfers.GetMultipleFromUserQuery.model_validate(parameters.model_dump()).model_dump(exclude_none=True)
|
|
101
|
+
|
|
102
|
+
#* Create auth
|
|
103
|
+
auth = BearerAuth(token=self._service_manager.token)
|
|
104
|
+
|
|
105
|
+
#* Send request and wait for response
|
|
106
|
+
response = await client.get(url=url, params=params, auth=auth)
|
|
107
|
+
return BaseClientHTTPControllerResults(response=response)
|
|
108
|
+
|
|
109
|
+
async def get_user_system_role(self, parameters:MaleoIdentityUserSystemRoleGeneralParametersTransfers.GetSingle) -> BaseClientHTTPControllerResults:
|
|
110
|
+
"""Get user's system role from MaleoIdentity"""
|
|
111
|
+
async with self._manager.get_client() as client:
|
|
112
|
+
#* Define URL
|
|
113
|
+
url = f"{self._manager.url.api}/v1/users/{parameters.user_id}/system-roles/{parameters.system_role}"
|
|
114
|
+
|
|
115
|
+
#* Parse parameters to query params
|
|
116
|
+
params = MaleoIdentityUserSystemRoleGeneralParametersTransfers.GetSingleQuery.model_validate(parameters.model_dump()).model_dump(exclude_none=True)
|
|
117
|
+
|
|
118
|
+
#* Create auth
|
|
119
|
+
auth = BearerAuth(token=self._service_manager.token)
|
|
120
|
+
|
|
121
|
+
#* Send request and wait for response
|
|
122
|
+
response = await client.get(url=url, params=params, auth=auth)
|
|
89
123
|
return BaseClientHTTPControllerResults(response=response)
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/client/services/organization.py
RENAMED
|
@@ -80,6 +80,7 @@ class MaleoIdentityOrganizationClientService(ClientService):
|
|
|
80
80
|
if controller_result.status_code != status.HTTP_404_NOT_FOUND:
|
|
81
81
|
return MaleoIdentityOrganizationGeneralResultsTransfers.Fail.model_validate(controller_result.content)
|
|
82
82
|
else:
|
|
83
|
+
controller_result.content["success"] = True
|
|
83
84
|
return MaleoIdentityOrganizationGeneralResultsTransfers.NoData.model_validate(controller_result.content)
|
|
84
85
|
else:
|
|
85
86
|
return MaleoIdentityOrganizationGeneralResultsTransfers.SingleData.model_validate(controller_result.content)
|
|
@@ -111,7 +112,7 @@ class MaleoIdentityOrganizationClientService(ClientService):
|
|
|
111
112
|
return MaleoIdentityOrganizationGeneralResultsTransfers.Fail(message=message, description=description)
|
|
112
113
|
#* Return proper response
|
|
113
114
|
if not controller_result.success:
|
|
114
|
-
return MaleoIdentityOrganizationGeneralResultsTransfers.
|
|
115
|
+
return MaleoIdentityOrganizationGeneralResultsTransfers.Fail.model_validate(controller_result.content)
|
|
115
116
|
else:
|
|
116
117
|
return MaleoIdentityOrganizationGeneralResultsTransfers.SingleData.model_validate(controller_result.content)
|
|
117
118
|
return await _impl()
|
|
@@ -142,7 +143,7 @@ class MaleoIdentityOrganizationClientService(ClientService):
|
|
|
142
143
|
return MaleoIdentityOrganizationGeneralResultsTransfers.Fail(message=message, description=description)
|
|
143
144
|
#* Return proper response
|
|
144
145
|
if not controller_result.success:
|
|
145
|
-
return MaleoIdentityOrganizationGeneralResultsTransfers.
|
|
146
|
+
return MaleoIdentityOrganizationGeneralResultsTransfers.Fail.model_validate(controller_result.content)
|
|
146
147
|
else:
|
|
147
148
|
return MaleoIdentityOrganizationGeneralResultsTransfers.SingleData.model_validate(controller_result.content)
|
|
148
149
|
return await _impl()
|
|
@@ -4,9 +4,13 @@ from maleo_foundation.utils.exceptions import BaseExceptions
|
|
|
4
4
|
from maleo_identity.client.controllers import MaleoIdentityUserControllers
|
|
5
5
|
from maleo_identity.enums.general import MaleoIdentityGeneralEnums
|
|
6
6
|
from maleo_identity.models.transfers.parameters.general.user import MaleoIdentityUserGeneralParametersTransfers
|
|
7
|
+
from maleo_identity.models.transfers.parameters.general.user_system_role import MaleoIdentityUserSystemRoleGeneralParametersTransfers
|
|
7
8
|
from maleo_identity.models.transfers.parameters.client.user import MaleoIdentityUserClientParametersTransfers
|
|
9
|
+
from maleo_identity.models.transfers.parameters.client.user_system_role import MaleoIdentityUserSystemRoleClientParametersTransfers
|
|
8
10
|
from maleo_identity.models.transfers.results.general.user import MaleoIdentityUserGeneralResultsTransfers
|
|
11
|
+
from maleo_identity.models.transfers.results.general.user_system_role import MaleoIdentityUserSystemRoleGeneralResultsTransfers
|
|
9
12
|
from maleo_identity.types.results.general.user import MaleoIdentityUserGeneralResultsTypes
|
|
13
|
+
from maleo_identity.types.results.general.user_system_role import MaleoIdentityUserSystemRoleGeneralResultsTypes
|
|
10
14
|
|
|
11
15
|
class MaleoIdentityUserClientService(ClientService):
|
|
12
16
|
def __init__(self, logger, controllers:MaleoIdentityUserControllers):
|
|
@@ -80,6 +84,7 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
80
84
|
if controller_result.status_code != status.HTTP_404_NOT_FOUND:
|
|
81
85
|
return MaleoIdentityUserGeneralResultsTransfers.Fail.model_validate(controller_result.content)
|
|
82
86
|
else:
|
|
87
|
+
controller_result.content["success"] = True
|
|
83
88
|
return MaleoIdentityUserGeneralResultsTransfers.NoData.model_validate(controller_result.content)
|
|
84
89
|
else:
|
|
85
90
|
return MaleoIdentityUserGeneralResultsTransfers.SingleData.model_validate(controller_result.content)
|
|
@@ -111,7 +116,7 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
111
116
|
return MaleoIdentityUserGeneralResultsTransfers.Fail(message=message, description=description)
|
|
112
117
|
#* Return proper response
|
|
113
118
|
if not controller_result.success:
|
|
114
|
-
return MaleoIdentityUserGeneralResultsTransfers.
|
|
119
|
+
return MaleoIdentityUserGeneralResultsTransfers.Fail.model_validate(controller_result.content)
|
|
115
120
|
else:
|
|
116
121
|
return MaleoIdentityUserGeneralResultsTransfers.SingleData.model_validate(controller_result.content)
|
|
117
122
|
return await _impl()
|
|
@@ -142,7 +147,7 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
142
147
|
return MaleoIdentityUserGeneralResultsTransfers.Fail(message=message, description=description)
|
|
143
148
|
#* Return proper response
|
|
144
149
|
if not controller_result.success:
|
|
145
|
-
return MaleoIdentityUserGeneralResultsTransfers.
|
|
150
|
+
return MaleoIdentityUserGeneralResultsTransfers.Fail.model_validate(controller_result.content)
|
|
146
151
|
else:
|
|
147
152
|
return MaleoIdentityUserGeneralResultsTransfers.SingleData.model_validate(controller_result.content)
|
|
148
153
|
return await _impl()
|
|
@@ -176,4 +181,73 @@ class MaleoIdentityUserClientService(ClientService):
|
|
|
176
181
|
return MaleoIdentityUserGeneralResultsTransfers.Fail.model_validate(controller_result.content)
|
|
177
182
|
else:
|
|
178
183
|
return MaleoIdentityUserGeneralResultsTransfers.SinglePassword.model_validate(controller_result.content)
|
|
184
|
+
return await _impl()
|
|
185
|
+
|
|
186
|
+
async def get_user_system_roles(
|
|
187
|
+
self,
|
|
188
|
+
parameters:MaleoIdentityUserSystemRoleClientParametersTransfers.GetMultipleFromUser,
|
|
189
|
+
controller_type:MaleoIdentityGeneralEnums.ClientControllerType = MaleoIdentityGeneralEnums.ClientControllerType.HTTP
|
|
190
|
+
) -> MaleoIdentityUserSystemRoleGeneralResultsTypes.GetMultiple:
|
|
191
|
+
"""Retrieve user's system roles from MaleoIdentity"""
|
|
192
|
+
@BaseExceptions.service_exception_handler(
|
|
193
|
+
operation="retrieving user's system roles",
|
|
194
|
+
logger=self._logger,
|
|
195
|
+
fail_result_class=MaleoIdentityUserSystemRoleGeneralResultsTransfers.Fail
|
|
196
|
+
)
|
|
197
|
+
async def _impl():
|
|
198
|
+
#* Validate chosen controller type
|
|
199
|
+
if not isinstance(controller_type, MaleoIdentityGeneralEnums.ClientControllerType):
|
|
200
|
+
message = "Invalid controller type"
|
|
201
|
+
description = "The provided controller type did not exists"
|
|
202
|
+
return MaleoIdentityUserSystemRoleGeneralResultsTransfers.Fail(message=message, description=description)
|
|
203
|
+
#* Retrieve users using chosen controller
|
|
204
|
+
if controller_type == MaleoIdentityGeneralEnums.ClientControllerType.HTTP:
|
|
205
|
+
controller_result = await self._controllers.http.get_user_system_roles(parameters=parameters)
|
|
206
|
+
else:
|
|
207
|
+
message = "Invalid controller type"
|
|
208
|
+
description = "The provided controller type has not been implemented"
|
|
209
|
+
return MaleoIdentityUserSystemRoleGeneralResultsTransfers.Fail(message=message, description=description)
|
|
210
|
+
#* Return proper response
|
|
211
|
+
if not controller_result.success:
|
|
212
|
+
return MaleoIdentityUserSystemRoleGeneralResultsTransfers.Fail.model_validate(controller_result.content)
|
|
213
|
+
else:
|
|
214
|
+
if controller_result.content["data"] is None:
|
|
215
|
+
return MaleoIdentityUserSystemRoleGeneralResultsTransfers.NoData.model_validate(controller_result.content)
|
|
216
|
+
else:
|
|
217
|
+
return MaleoIdentityUserSystemRoleGeneralResultsTransfers.MultipleData.model_validate(controller_result.content)
|
|
218
|
+
return await _impl()
|
|
219
|
+
|
|
220
|
+
async def get_user_system_role(
|
|
221
|
+
self,
|
|
222
|
+
parameters:MaleoIdentityUserSystemRoleGeneralParametersTransfers.GetSingle,
|
|
223
|
+
controller_type:MaleoIdentityGeneralEnums.ClientControllerType = MaleoIdentityGeneralEnums.ClientControllerType.HTTP
|
|
224
|
+
) -> MaleoIdentityUserSystemRoleGeneralResultsTypes.GetSingle:
|
|
225
|
+
"""Retrieve user's system role from MaleoIdentity"""
|
|
226
|
+
@BaseExceptions.service_exception_handler(
|
|
227
|
+
operation="retrieving user's system role",
|
|
228
|
+
logger=self._logger,
|
|
229
|
+
fail_result_class=MaleoIdentityUserSystemRoleGeneralResultsTransfers.Fail
|
|
230
|
+
)
|
|
231
|
+
async def _impl():
|
|
232
|
+
#* Validate chosen controller type
|
|
233
|
+
if not isinstance(controller_type, MaleoIdentityGeneralEnums.ClientControllerType):
|
|
234
|
+
message = "Invalid controller type"
|
|
235
|
+
description = "The provided controller type did not exists"
|
|
236
|
+
return MaleoIdentityUserSystemRoleGeneralResultsTransfers.Fail(message=message, description=description)
|
|
237
|
+
#* Retrieve user using chosen controller
|
|
238
|
+
if controller_type == MaleoIdentityGeneralEnums.ClientControllerType.HTTP:
|
|
239
|
+
controller_result = await self._controllers.http.get_user_system_role(parameters=parameters)
|
|
240
|
+
else:
|
|
241
|
+
message = "Invalid controller type"
|
|
242
|
+
description = "The provided controller type has not been implemented"
|
|
243
|
+
return MaleoIdentityUserSystemRoleGeneralResultsTransfers.Fail(message=message, description=description)
|
|
244
|
+
#* Return proper response
|
|
245
|
+
if not controller_result.success:
|
|
246
|
+
if controller_result.status_code != status.HTTP_404_NOT_FOUND:
|
|
247
|
+
return MaleoIdentityUserSystemRoleGeneralResultsTransfers.Fail.model_validate(controller_result.content)
|
|
248
|
+
else:
|
|
249
|
+
controller_result.content["success"] = True
|
|
250
|
+
return MaleoIdentityUserSystemRoleGeneralResultsTransfers.NoData.model_validate(controller_result.content)
|
|
251
|
+
else:
|
|
252
|
+
return MaleoIdentityUserSystemRoleGeneralResultsTransfers.SingleData.model_validate(controller_result.content)
|
|
179
253
|
return await _impl()
|
|
@@ -18,6 +18,12 @@ class MaleoIdentityUserSystemRoleClientParametersTransfers:
|
|
|
18
18
|
BaseClientParametersTransfers.GetPaginatedMultiple
|
|
19
19
|
): pass
|
|
20
20
|
|
|
21
|
+
class GetMultipleFromUserQuery(
|
|
22
|
+
MaleoIdentityUserSystemRoleGeneralSchemas.Expand,
|
|
23
|
+
MaleoMetadataSystemRoleExpandedSchemas.OptionalListOfSimpleSystemRole,
|
|
24
|
+
BaseClientParametersTransfers.GetPaginatedMultipleQuery
|
|
25
|
+
): pass
|
|
26
|
+
|
|
21
27
|
class GetMultipleQuery(
|
|
22
28
|
MaleoIdentityUserSystemRoleGeneralSchemas.Expand,
|
|
23
29
|
MaleoMetadataSystemRoleExpandedSchemas.OptionalListOfSimpleSystemRole,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maleo-identity
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.10
|
|
4
4
|
Summary: MaleoIdentity service package
|
|
5
5
|
Author-email: Agra Bima Yuda <agra@nexmedis.com>
|
|
6
6
|
License: MIT
|
|
7
7
|
Requires-Python: >=3.7
|
|
8
8
|
Description-Content-Type: text/markdown
|
|
9
|
-
Requires-Dist: maleo_foundation>=0.1.
|
|
10
|
-
Requires-Dist: maleo_metadata>=0.0.
|
|
9
|
+
Requires-Dist: maleo_foundation>=0.1.92
|
|
10
|
+
Requires-Dist: maleo_metadata>=0.0.64
|
|
11
11
|
|
|
12
12
|
# README #
|
|
13
13
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "maleo-identity" # PyPI package name
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.10"
|
|
8
8
|
description = "MaleoIdentity service package"
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "Agra Bima Yuda", email = "agra@nexmedis.com" }
|
|
@@ -13,8 +13,8 @@ license = { text = "MIT" }
|
|
|
13
13
|
readme = "README.md"
|
|
14
14
|
requires-python = ">=3.7"
|
|
15
15
|
dependencies = [
|
|
16
|
-
"maleo_foundation>=0.1.
|
|
17
|
-
"maleo_metadata>=0.0.
|
|
16
|
+
"maleo_foundation>=0.1.92",
|
|
17
|
+
"maleo_metadata>=0.0.64",
|
|
18
18
|
]
|
|
19
19
|
|
|
20
20
|
[tool.setuptools.packages.find]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/client/controllers/__init__.py
RENAMED
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/client/controllers/http/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/constants/user_organization.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/responses/organization.py
RENAMED
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/responses/user_organization.py
RENAMED
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/responses/user_profile.py
RENAMED
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/responses/user_system_role.py
RENAMED
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/general/__init__.py
RENAMED
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/general/organization.py
RENAMED
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/general/user.py
RENAMED
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/general/user_profile.py
RENAMED
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/parameters/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/parameters/user.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/results/__init__.py
RENAMED
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/results/organization.py
RENAMED
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/results/user.py
RENAMED
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/schemas/results/user_profile.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/tables/user_organization.py
RENAMED
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/tables/user_system_role.py
RENAMED
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/general/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/general/user.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/results/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/models/transfers/results/query/user.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/results/general/__init__.py
RENAMED
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/results/general/organization.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/results/general/user_profile.py
RENAMED
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/results/query/__init__.py
RENAMED
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/results/query/organization.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{maleo_identity-0.0.8 → maleo_identity-0.0.10}/maleo_identity/types/results/query/user_profile.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|