maleo-foundation 0.2.68__py3-none-any.whl → 0.2.70__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.
@@ -91,11 +91,10 @@ class MaleoClientConfiguration(BaseModel):
91
91
 
92
92
  class MaleoClientConfigurations(BaseModel):
93
93
  metadata:MaleoClientConfiguration = Field(..., description="MaleoMetadata client's configuration")
94
- security:MaleoClientConfiguration = Field(..., description="MaleoSecurity client's configuration")
95
- storage:MaleoClientConfiguration = Field(..., description="MaleoStorage client's configuration")
96
94
  identity:MaleoClientConfiguration = Field(..., description="MaleoIdentity client's configuration")
97
95
  access:MaleoClientConfiguration = Field(..., description="MaleoAccess client's configuration")
98
- soapie:MaleoClientConfiguration = Field(..., description="MaleoSOAPIE client's configuration")
96
+ workshop:MaleoClientConfiguration = Field(..., description="MaleoWorkshop client's configuration")
97
+ medix:MaleoClientConfiguration = Field(..., description="MaleoMedix client's configuration")
99
98
  fhir:MaleoClientConfiguration = Field(..., description="MaleoFHIR client's configuration")
100
99
  dicom:MaleoClientConfiguration = Field(..., description="MaleoDICOM client's configuration")
101
100
  scribe:MaleoClientConfiguration = Field(..., description="MaleoScribe client's configuration")
@@ -6,20 +6,27 @@ from typing import Optional, Union
6
6
 
7
7
  class GoogleCredentialsLoader:
8
8
  @staticmethod
9
- def load(credentials_path:Optional[Union[Path, str]] = None) -> Credentials:
9
+ def load(credentials_path: Optional[Union[Path, str]] = None) -> Credentials:
10
+ """
11
+ Load Google credentials either from a service account file or from the default credentials.
12
+ Priority:
13
+ 1. Explicit path argument
14
+ 2. GOOGLE_CREDENTIALS_PATH environment variable
15
+ 3. google.auth.default()
16
+ """
10
17
  if credentials_path is None:
11
18
  credentials_path = os.getenv("GOOGLE_CREDENTIALS_PATH")
12
- else:
13
- credentials_path = credentials_path
19
+
20
+ if credentials_path is not None:
21
+ credentials_path = Path(credentials_path)
22
+ if credentials_path.exists() and credentials_path.is_file():
23
+ try:
24
+ return Credentials.from_service_account_file(str(credentials_path))
25
+ except Exception as e:
26
+ raise ValueError(f"Failed to load credentials from file: {str(e)}")
27
+
14
28
  try:
15
- if credentials_path is not None:
16
- credentials_path = Path(credentials_path)
17
- if credentials_path.exists() or credentials_path.is_file():
18
- credentials = Credentials.from_service_account_file(
19
- filename=str(credentials_path)
20
- )
21
- else:
22
- credentials, _ = default()
29
+ credentials, _ = default()
23
30
  return credentials
24
31
  except Exception as e:
25
- raise ValueError(f"Failed to initialize credentials: {str(e)}")
32
+ raise ValueError(f"Failed to load default credentials: {str(e)}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.2.68
3
+ Version: 0.2.70
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -34,7 +34,7 @@ maleo_foundation/expanded_types/encryption/rsa.py,sha256=Esf_H8nMz2kOLAWa3M7dlD-
34
34
  maleo_foundation/managers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
35
  maleo_foundation/managers/db.py,sha256=cpY1IOiUytT9XXYtzS0E9OSYOuB7jBKo0XHe__uI1Jg,5340
36
36
  maleo_foundation/managers/middleware.py,sha256=77wRCC_CWc22nSDL-UJanO3rXmSB7wLzaAIXEFjXq6M,4249
37
- maleo_foundation/managers/service.py,sha256=CB6JI_jMWrVQo32jJ3oCGRgSdOfsdBehCu1pVhAJzBo,19251
37
+ maleo_foundation/managers/service.py,sha256=3POmJNxxdBxU6mvHdCyMTV7zFSp6_H8tWM2pvj-HqGk,19148
38
38
  maleo_foundation/managers/cache/__init__.py,sha256=CeY0oof2bVl_v5WS-FKXNwn2gf3xrEMfUsHK9cHo59s,471
39
39
  maleo_foundation/managers/cache/base.py,sha256=YyPjde4KTsp2IHV6NdFMysa0ev-1GX1rtX-0jQPuIBU,837
40
40
  maleo_foundation/managers/cache/redis.py,sha256=xLa8QfXdNtghs0eBxIqc04H3XTYmxLEzrqJZAFCigvM,1150
@@ -115,10 +115,10 @@ maleo_foundation/utils/loaders/__init__.py,sha256=P_3ycGfeDXFjAi8bE4iLWHxBveqUId
115
115
  maleo_foundation/utils/loaders/json.py,sha256=8e3qe1TyL-jaJVuiQJpVHKDBS2n_CGJPGv8Ci6cK42Y,506
116
116
  maleo_foundation/utils/loaders/yaml.py,sha256=8cZWOYuDTAFNrLsUlz7IGyOrtR4oL-tk-jc7q_7nq8Q,501
117
117
  maleo_foundation/utils/loaders/credential/__init__.py,sha256=qopTKvcMVoTFwyRijeg7rejnG4I684FjUwh70tvhtVM,141
118
- maleo_foundation/utils/loaders/credential/google.py,sha256=SKsqPuFnAiCcYLf24CxKnMybhVHpgqnq1gGSlThqjts,994
118
+ maleo_foundation/utils/loaders/credential/google.py,sha256=HUcuHD4tXHPt0eHInlFYxA_MDrGSOtbenpd0PX156OM,1255
119
119
  maleo_foundation/utils/loaders/key/__init__.py,sha256=hVygcC2ImHc_aVrSrOmyedR8tMUZokWUKCKOSh5ctbo,106
120
120
  maleo_foundation/utils/loaders/key/rsa.py,sha256=gDhyX6iTFtHiluuhFCozaZ3pOLKU2Y9TlrNMK_GVyGU,3796
121
- maleo_foundation-0.2.68.dist-info/METADATA,sha256=So5IYXyl2wFd4nmK_7NKNTrXvNQ6rXFlYXdufF3C5eI,3598
122
- maleo_foundation-0.2.68.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
123
- maleo_foundation-0.2.68.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
124
- maleo_foundation-0.2.68.dist-info/RECORD,,
121
+ maleo_foundation-0.2.70.dist-info/METADATA,sha256=AfgM-gi1MSoGPdCQjAVKP9xJxLJdD-ZfSDV_2xeDB-c,3598
122
+ maleo_foundation-0.2.70.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
123
+ maleo_foundation-0.2.70.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
124
+ maleo_foundation-0.2.70.dist-info/RECORD,,