maleo-foundation 0.1.87__py3-none-any.whl → 0.1.89__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.
- maleo_foundation/client/manager.py +4 -5
- maleo_foundation/managers/client/maleo.py +4 -9
- maleo_foundation/managers/service.py +10 -2
- {maleo_foundation-0.1.87.dist-info → maleo_foundation-0.1.89.dist-info}/METADATA +1 -1
- {maleo_foundation-0.1.87.dist-info → maleo_foundation-0.1.89.dist-info}/RECORD +7 -7
- {maleo_foundation-0.1.87.dist-info → maleo_foundation-0.1.89.dist-info}/WHEEL +0 -0
- {maleo_foundation-0.1.87.dist-info → maleo_foundation-0.1.89.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,5 @@
|
|
1
1
|
from __future__ import annotations
|
2
|
-
from maleo_foundation.managers.client.
|
3
|
-
from maleo_foundation.managers.service import ServiceManager
|
2
|
+
from maleo_foundation.managers.client.base import ClientManager
|
4
3
|
from maleo_foundation.types import BaseTypes
|
5
4
|
from maleo_foundation.utils.logging import SimpleConfig
|
6
5
|
from maleo_foundation.client.services.encryption import (
|
@@ -21,11 +20,11 @@ from maleo_foundation.client.services import (
|
|
21
20
|
MaleoFoundationServices
|
22
21
|
)
|
23
22
|
|
24
|
-
class MaleoFoundationClientManager(
|
25
|
-
def __init__(self,
|
23
|
+
class MaleoFoundationClientManager(ClientManager):
|
24
|
+
def __init__(self, log_config:SimpleConfig, service_key:BaseTypes.OptionalString=None):
|
26
25
|
key = "maleo-foundation"
|
27
26
|
name = "MaleoFoundation"
|
28
|
-
super().__init__(key, name,
|
27
|
+
super().__init__(key, name, log_config, service_key)
|
29
28
|
self._initialize_services()
|
30
29
|
self._logger.info("Client manager initialized successfully")
|
31
30
|
|
@@ -1,5 +1,4 @@
|
|
1
|
-
from pydantic import Field
|
2
|
-
from maleo_foundation.types import BaseTypes
|
1
|
+
from pydantic import BaseModel, Field
|
3
2
|
from maleo_foundation.managers.client.base import ClientManager, ClientHTTPControllerManager, ClientControllerManagers, ClientHTTPController, ClientServiceControllers, ClientControllers
|
4
3
|
from maleo_foundation.managers.service import ServiceManager
|
5
4
|
|
@@ -23,8 +22,8 @@ class MaleoClientManager(ClientManager):
|
|
23
22
|
self,
|
24
23
|
key:str,
|
25
24
|
name:str,
|
26
|
-
|
27
|
-
|
25
|
+
url:str,
|
26
|
+
service_manager:ServiceManager
|
28
27
|
):
|
29
28
|
self._url = url
|
30
29
|
self._service_manager = service_manager
|
@@ -35,8 +34,6 @@ class MaleoClientManager(ClientManager):
|
|
35
34
|
return self._service_manager
|
36
35
|
|
37
36
|
def _initialize_controllers(self) -> None:
|
38
|
-
if self._url is None:
|
39
|
-
raise ValueError("'URL' must not be None if initializing controllers")
|
40
37
|
#* Initialize managers
|
41
38
|
http_controller_manager = ClientHTTPControllerManager(url=self._url)
|
42
39
|
self._controller_managers = ClientControllerManagers(http=http_controller_manager)
|
@@ -50,7 +47,5 @@ class MaleoClientManager(ClientManager):
|
|
50
47
|
|
51
48
|
async def dispose(self) -> None:
|
52
49
|
self._logger.info("Disposing client manager")
|
53
|
-
|
54
|
-
if self._controller_managers.http is not None:
|
55
|
-
await self._controller_managers.http.dispose()
|
50
|
+
await self._controller_managers.http.dispose()
|
56
51
|
self._logger.info("Client manager disposed successfully")
|
@@ -134,6 +134,7 @@ class ServiceManager:
|
|
134
134
|
self._load_keys()
|
135
135
|
self._initialize_loggers()
|
136
136
|
self._initialize_db()
|
137
|
+
self._initialize_foundation()
|
137
138
|
|
138
139
|
@property
|
139
140
|
def log_config(self) -> SimpleConfig:
|
@@ -229,6 +230,13 @@ class ServiceManager:
|
|
229
230
|
def database(self) -> DatabaseManager:
|
230
231
|
return self._database
|
231
232
|
|
233
|
+
def _initialize_foundation(self) -> None:
|
234
|
+
self._foundation = MaleoFoundationClientManager(log_config=self._log_config, service_key=self._settings.SERVICE_KEY)
|
235
|
+
|
236
|
+
@property
|
237
|
+
def foundation(self) -> MaleoFoundationClientManager:
|
238
|
+
self._foundation
|
239
|
+
|
232
240
|
@property
|
233
241
|
def token(self) -> str:
|
234
242
|
payload = MaleoFoundationTokenGeneralTransfers.BaseEncodePayload(
|
@@ -238,7 +246,7 @@ class ServiceManager:
|
|
238
246
|
u_ut="service"
|
239
247
|
)
|
240
248
|
parameters = MaleoFoundationTokenParametersTransfers.Encode(key=self._keys.private, password=self._keys.password, payload=payload)
|
241
|
-
result = self.
|
249
|
+
result = self._foundation.services.token.encode(parameters=parameters)
|
242
250
|
if not result.success:
|
243
251
|
raise RuntimeError("Failed encoding payload into token")
|
244
252
|
return result.data.token
|
@@ -256,7 +264,7 @@ class ServiceManager:
|
|
256
264
|
configurations=self._configs.middleware,
|
257
265
|
keys=self._keys,
|
258
266
|
loggers=self._loggers.middleware,
|
259
|
-
maleo_foundation=self.
|
267
|
+
maleo_foundation=self._foundation
|
260
268
|
)
|
261
269
|
self._middleware.add_all()
|
262
270
|
self._loggers.application.info("Middlewares addedd successfully")
|
@@ -5,7 +5,7 @@ maleo_foundation/enums.py,sha256=uvwl3dl2r6BoJMEbtSETiLoyJubHup9Lc7VOg7w7zQo,294
|
|
5
5
|
maleo_foundation/extended_types.py,sha256=pIKt-_9tby4rmune3fmWcCW_mohaNRh_1lywBmdc-L4,301
|
6
6
|
maleo_foundation/types.py,sha256=aKXnIgEhYGSfFqNMGLc4qIKGkINBRpkOo9R9cb2CbwI,2414
|
7
7
|
maleo_foundation/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
|
-
maleo_foundation/client/manager.py,sha256=
|
8
|
+
maleo_foundation/client/manager.py,sha256=pFWLFYW4eE9MLyFmFS05IgnMBdqqUHbdyTkSbnBtm5E,2620
|
9
9
|
maleo_foundation/client/services/__init__.py,sha256=uIBnAeQ9a2otQbUAbKBQfYrkEUugXjxXoV8W5QYHuic,1051
|
10
10
|
maleo_foundation/client/services/key.py,sha256=Av8OFEJO8-Chlu-lRzR4or1qkJ0ahxtiHwkqF4ktDD4,5537
|
11
11
|
maleo_foundation/client/services/signature.py,sha256=brEnNPrkeChx0niDgAYCI2HeANQGHpPI6a0lARGCbZ4,4498
|
@@ -32,10 +32,10 @@ maleo_foundation/expanded_types/encryption/rsa.py,sha256=MuhB_DGrjnsl4t96W4pKuCt
|
|
32
32
|
maleo_foundation/managers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
33
33
|
maleo_foundation/managers/db.py,sha256=Pn5EZ-c1Hy6-BihN7KokHJWmBIt3Ty96fZ0zF-srtF4,5208
|
34
34
|
maleo_foundation/managers/middleware.py,sha256=ODIQU1Hpu-Xempjjo_VRbVtxiD5oi74mNuoWuDawRh0,4250
|
35
|
-
maleo_foundation/managers/service.py,sha256=
|
35
|
+
maleo_foundation/managers/service.py,sha256=HVw_6R-ThEghRt90etaXSINVr4vYYJdBeX0qnwJXR4M,15412
|
36
36
|
maleo_foundation/managers/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
37
|
maleo_foundation/managers/client/base.py,sha256=5z9l2GN4QASF0-Lft8o5QQ3SRPXqeNZNT1S1CgaE764,4384
|
38
|
-
maleo_foundation/managers/client/maleo.py,sha256
|
38
|
+
maleo_foundation/managers/client/maleo.py,sha256=iCM47TLL-RSQ2FkTmHVPdsb2JCd1LebMx6OJvIr4vCQ,2035
|
39
39
|
maleo_foundation/managers/client/google/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
40
40
|
maleo_foundation/managers/client/google/base.py,sha256=eIdd6C2BFIu4EyZ1j017VZaJn_nSTPGFftBwQmVAUDA,1366
|
41
41
|
maleo_foundation/managers/client/google/secret.py,sha256=Ski1CHYeA8vjSk2Oc2Pf4CfFrzT_RcA6NEZwza7gM7Y,4464
|
@@ -107,7 +107,7 @@ maleo_foundation/utils/loaders/credential/__init__.py,sha256=qopTKvcMVoTFwyRijeg
|
|
107
107
|
maleo_foundation/utils/loaders/credential/google.py,sha256=deksZXT5wPhEsSMHbZ3x05WHXxCjLDt76Ns-1Tmhp7g,948
|
108
108
|
maleo_foundation/utils/loaders/key/__init__.py,sha256=hVygcC2ImHc_aVrSrOmyedR8tMUZokWUKCKOSh5ctbo,106
|
109
109
|
maleo_foundation/utils/loaders/key/rsa.py,sha256=gDhyX6iTFtHiluuhFCozaZ3pOLKU2Y9TlrNMK_GVyGU,3796
|
110
|
-
maleo_foundation-0.1.
|
111
|
-
maleo_foundation-0.1.
|
112
|
-
maleo_foundation-0.1.
|
113
|
-
maleo_foundation-0.1.
|
110
|
+
maleo_foundation-0.1.89.dist-info/METADATA,sha256=WVmR4FL-wj1jvsj8m3s82tNXOwVr08Li8f3MIv1l-S8,3419
|
111
|
+
maleo_foundation-0.1.89.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
112
|
+
maleo_foundation-0.1.89.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
|
113
|
+
maleo_foundation-0.1.89.dist-info/RECORD,,
|
File without changes
|
File without changes
|