maleo-foundation 0.2.3__py3-none-any.whl → 0.2.4__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.
@@ -36,9 +36,9 @@ class Settings(BaseSettings):
36
36
  GOOGLE_CREDENTIALS_PATH:str = Field("credentials/maleo-google-service-account.json", description="Internal credential's file path")
37
37
  STATIC_CONFIGURATIONS_PATH:str = Field("configs/static.yaml", description="Maleo's static configurations path")
38
38
  RUNTIME_CONFIGURATIONS_PATH:str = Field("configs/runtime.yaml", description="Service's runtime configurations path")
39
- TOKEN_MANAGER_URL:str = Field(..., description="Maleo Token's manager")
40
39
 
41
40
  class MaleoCredentials(BaseModel):
41
+ id:int = Field(..., description="ID")
42
42
  username:str = Field(..., description="Username")
43
43
  email:str = Field(..., description="Email")
44
44
  password:str = Field(..., description="Password")
@@ -176,10 +176,12 @@ class ServiceManager:
176
176
  return self._cloud_storage
177
177
 
178
178
  def _load_maleo_credentials(self) -> None:
179
+ environment = BaseEnums.EnvironmentType.STAGING if self._settings.ENVIRONMENT == BaseEnums.EnvironmentType.LOCAL else self._settings.ENVIRONMENT
180
+ id = int(self._secret_manager.get(f"maleo-service-account-id-{environment}"))
179
181
  email = self._secret_manager.get("maleo-service-account-email")
180
182
  username = self._secret_manager.get("maleo-service-account-username")
181
183
  password = self._secret_manager.get("maleo-service-account-password")
182
- self._maleo_credentials = MaleoCredentials(username=username, email=email, password=password)
184
+ self._maleo_credentials = MaleoCredentials(id=id, username=username, email=email, password=password)
183
185
 
184
186
  @property
185
187
  def maleo_credentials(self) -> MaleoCredentials:
@@ -262,7 +264,7 @@ class ServiceManager:
262
264
  def token(self) -> str:
263
265
  payload = MaleoFoundationTokenGeneralTransfers.BaseEncodePayload(
264
266
  iss=None,
265
- sub=None,
267
+ sub=str(self._maleo_credentials.id),
266
268
  sr="administrator",
267
269
  u_u=self._maleo_credentials.username,
268
270
  u_e=self._maleo_credentials.email,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -32,7 +32,7 @@ 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=B2wPRfqPyaZBHiRa5zv5PhxzHZpmWdCEM_Kvgjejxmc,16001
35
+ maleo_foundation/managers/service.py,sha256=VggsQUS_i80_fGZYrErBALYXLLFx1JnE4prGJ0L6HjU,16240
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
38
  maleo_foundation/managers/client/maleo.py,sha256=iCM47TLL-RSQ2FkTmHVPdsb2JCd1LebMx6OJvIr4vCQ,2035
@@ -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.2.3.dist-info/METADATA,sha256=jy6MN-Z2m-UMu6siPDessr81cXuXwfSuXTATJQVqHik,3418
111
- maleo_foundation-0.2.3.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
112
- maleo_foundation-0.2.3.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
113
- maleo_foundation-0.2.3.dist-info/RECORD,,
110
+ maleo_foundation-0.2.4.dist-info/METADATA,sha256=x_39L6UXFNyvmLxpFW2aqL9dX5A_OC8AK-De7K58Kr0,3418
111
+ maleo_foundation-0.2.4.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
112
+ maleo_foundation-0.2.4.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
113
+ maleo_foundation-0.2.4.dist-info/RECORD,,