maleo-foundation 0.3.5__py3-none-any.whl → 0.3.7__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.
@@ -26,6 +26,8 @@ class ConfigurationManager:
26
26
  self.settings = settings
27
27
  self.credential_manager = credential_manager
28
28
 
29
+ self._load_configs()
30
+
29
31
  def _load_static_configurations(self) -> StaticConfigurations:
30
32
  config_path = Path(self.settings.STATIC_CONFIGURATIONS_PATH)
31
33
 
@@ -2,7 +2,7 @@ import json
2
2
  from typing import Callable
3
3
  from fastapi.encoders import jsonable_encoder
4
4
 
5
- def build_key(
5
+ def key_builder(
6
6
  func: Callable,
7
7
  *args,
8
8
  **kwargs
@@ -5,35 +5,6 @@ from google.oauth2.service_account import Credentials
5
5
  from pathlib import Path
6
6
  from typing import Optional, Union
7
7
 
8
- class GoogleCredentialsLoader:
9
- @staticmethod
10
- def load(
11
- credentials_path: Optional[Union[Path, str]] = None
12
- ) -> Credentials:
13
- """
14
- Load Google credentials either from a service account file or from the default credentials.
15
- Priority:
16
- 1. Explicit path argument
17
- 2. GOOGLE_CREDENTIALS_PATH environment variable
18
- 3. google.auth.default()
19
- """
20
- if credentials_path is None:
21
- credentials_path = os.getenv("GOOGLE_CREDENTIALS_PATH")
22
-
23
- if credentials_path is not None:
24
- credentials_path = Path(credentials_path)
25
- if credentials_path.exists() and credentials_path.is_file():
26
- try:
27
- return Credentials.from_service_account_file(str(credentials_path))
28
- except Exception as e:
29
- raise ValueError(f"Failed to load credentials from file: {str(e)}")
30
-
31
- try:
32
- credentials, _ = default()
33
- return credentials
34
- except Exception as e:
35
- raise ValueError(f"Failed to load default credentials: {str(e)}")
36
-
37
8
  class GoogleCredentialsLoader:
38
9
  @staticmethod
39
10
  def load(
@@ -121,7 +92,7 @@ class GoogleCredentialsLoader:
121
92
  # Default credentials are not service account credentials
122
93
  raise ValueError(
123
94
  "Default credentials are not service account credentials. "
124
- f"Found credentials of type: {type(credentials).__name__}. "
95
+ f"Found credentials of type: {type(credentials)}. "
125
96
  "Please provide a service account key file via GOOGLE_CREDENTIALS_PATH, "
126
97
  "GOOGLE_APPLICATION_CREDENTIALS, or the credentials_path parameter."
127
98
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.3.5
3
+ Version: 0.3.7
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -33,7 +33,7 @@ maleo_foundation/expanded_types/encryption/aes.py,sha256=1rj43qjIO0TePpr1mErT_NJ
33
33
  maleo_foundation/expanded_types/encryption/rsa.py,sha256=Esf_H8nMz2kOLAWa3M7dlD-sFdFIZylNjB_qB20Yaww,488
34
34
  maleo_foundation/managers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
35
  maleo_foundation/managers/cache.py,sha256=91IvQGCXC3QkhB61m6qLDMaRykmMYOwzMgrSOodfY1A,257
36
- maleo_foundation/managers/configuration.py,sha256=OOKutQ0OroSIoT7i2KlXLlUrbsVs4WYIfgekVRDuaas,3950
36
+ maleo_foundation/managers/configuration.py,sha256=hffeNqAuqRTPVv7ZBT7jOC95blfgn5fNCxFPZnl-WSQ,3980
37
37
  maleo_foundation/managers/credential.py,sha256=pTsd1sPFw64cOfSffqsdJFkVfsciqxjAvvt6RZJCkDY,3116
38
38
  maleo_foundation/managers/db.py,sha256=y5oP3bTXKeXYKqng-E_HZ-3wC0ZPtl5bls0AEEej6zM,6050
39
39
  maleo_foundation/managers/middleware.py,sha256=ecTNloglV67xoC_hqIEMIxhfQwzXRKHLI3ThJdd-lbY,2480
@@ -111,7 +111,7 @@ maleo_foundation/models/transfers/results/service/repository.py,sha256=djITRZh2j
111
111
  maleo_foundation/models/transfers/results/service/controllers/__init__.py,sha256=HZJWMy2dskzOCzLmp_UaL9rjbQ-sDMI7sd2bXb-4QOU,175
112
112
  maleo_foundation/models/transfers/results/service/controllers/rest.py,sha256=wCuFyOTQkuBs2cqjPsWnPy0XIsCfMqGByhrSy57qp7Y,1107
113
113
  maleo_foundation/utils/__init__.py,sha256=ZZv0NDcTdHsHl51EKfgrlCm8CQmgvyIndMcQABDudN0,391
114
- maleo_foundation/utils/cache.py,sha256=0VglrEZL7K-5C4sXr0Kr20MjALt9e8JJhdaGSfPbZmE,732
114
+ maleo_foundation/utils/cache.py,sha256=2EtXXN4Yl7P98Jc-C9P6FaBU5NOh1hFqeThRXkf99rg,734
115
115
  maleo_foundation/utils/cleaner.py,sha256=dv80jDd8uAXuqyB5_UPbT2JksJ-hsq286DB2WCjjAYs,696
116
116
  maleo_foundation/utils/client.py,sha256=CGwn8eH5WlwnE5tPMfMAH5V3BItBgVmYBZnXpLjTVSc,2826
117
117
  maleo_foundation/utils/controller.py,sha256=Ub1R-JN6spmXakYrOY7igwaNt4Sg8LASASdXymxZcCI,6954
@@ -131,10 +131,10 @@ maleo_foundation/utils/loaders/__init__.py,sha256=P_3ycGfeDXFjAi8bE4iLWHxBveqUId
131
131
  maleo_foundation/utils/loaders/json.py,sha256=Uw8v_nfkNMPvcpDYrFwqZBkACyxWzzd6M7klhHbo5JI,508
132
132
  maleo_foundation/utils/loaders/yaml.py,sha256=V2AMjkwoxi1awdahifjtEALvUZ11VL9pZWGtQ7qrNJs,503
133
133
  maleo_foundation/utils/loaders/credential/__init__.py,sha256=qopTKvcMVoTFwyRijeg7rejnG4I684FjUwh70tvhtVM,141
134
- maleo_foundation/utils/loaders/credential/google.py,sha256=Xd1OIlFN2MBrQKSkVj647SyZSuG6t95CE7Gd91NSZpM,7651
134
+ maleo_foundation/utils/loaders/credential/google.py,sha256=vmVObdAyXehb3L6ASOuUJ63mNvGPb9fiXSpdRndN-4A,6528
135
135
  maleo_foundation/utils/loaders/key/__init__.py,sha256=hVygcC2ImHc_aVrSrOmyedR8tMUZokWUKCKOSh5ctbo,106
136
136
  maleo_foundation/utils/loaders/key/rsa.py,sha256=gDhyX6iTFtHiluuhFCozaZ3pOLKU2Y9TlrNMK_GVyGU,3796
137
- maleo_foundation-0.3.5.dist-info/METADATA,sha256=vPknjsgO_kZnjz8FlGOtmAJIAhR7V_lDD2MhIa5cSuU,3739
138
- maleo_foundation-0.3.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
139
- maleo_foundation-0.3.5.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
140
- maleo_foundation-0.3.5.dist-info/RECORD,,
137
+ maleo_foundation-0.3.7.dist-info/METADATA,sha256=8-hzEt1UaFBcl_bo80TFdLKCrQyMn06p9rKRLizyA4E,3739
138
+ maleo_foundation-0.3.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
139
+ maleo_foundation-0.3.7.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
140
+ maleo_foundation-0.3.7.dist-info/RECORD,,