maleo-foundation 0.3.3__py3-none-any.whl → 0.3.5__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.
Files changed (29) hide show
  1. maleo_foundation/constants.py +3 -3
  2. maleo_foundation/enums.py +18 -5
  3. maleo_foundation/managers/cache.py +9 -0
  4. maleo_foundation/managers/client/google/subscription.py +140 -0
  5. maleo_foundation/managers/configuration.py +100 -0
  6. maleo_foundation/managers/credential.py +82 -0
  7. maleo_foundation/managers/middleware.py +5 -37
  8. maleo_foundation/managers/service.py +62 -237
  9. maleo_foundation/middlewares/authentication.py +1 -7
  10. maleo_foundation/models/schemas/parameter.py +1 -1
  11. maleo_foundation/models/transfers/general/configurations/__init__.py +45 -0
  12. maleo_foundation/{managers → models/transfers/general/configurations}/cache/__init__.py +1 -8
  13. maleo_foundation/models/transfers/general/configurations/client/__init__.py +8 -0
  14. maleo_foundation/models/transfers/general/configurations/client/maleo.py +23 -0
  15. maleo_foundation/models/transfers/general/configurations/database.py +12 -0
  16. maleo_foundation/models/transfers/general/configurations/middleware.py +60 -0
  17. maleo_foundation/models/transfers/general/configurations/service.py +7 -0
  18. maleo_foundation/models/transfers/general/credentials.py +9 -0
  19. maleo_foundation/models/transfers/general/database.py +3 -2
  20. maleo_foundation/models/transfers/general/settings.py +19 -0
  21. maleo_foundation/utils/cache.py +27 -0
  22. maleo_foundation/utils/loaders/credential/google.py +134 -1
  23. maleo_foundation/utils/logging.py +1 -18
  24. {maleo_foundation-0.3.3.dist-info → maleo_foundation-0.3.5.dist-info}/METADATA +5 -2
  25. {maleo_foundation-0.3.3.dist-info → maleo_foundation-0.3.5.dist-info}/RECORD +28 -16
  26. maleo_foundation/managers/cache/base.py +0 -29
  27. /maleo_foundation/{managers → models/transfers/general/configurations}/cache/redis.py +0 -0
  28. {maleo_foundation-0.3.3.dist-info → maleo_foundation-0.3.5.dist-info}/WHEEL +0 -0
  29. {maleo_foundation-0.3.3.dist-info → maleo_foundation-0.3.5.dist-info}/top_level.txt +0 -0
@@ -4,6 +4,7 @@ from pydantic import BaseModel, Field
4
4
  from typing import Optional
5
5
  from .request import RequestContext
6
6
  from .token import MaleoFoundationTokenGeneralTransfers
7
+ from maleo_foundation.enums import BaseEnums
7
8
  from maleo_foundation.types import BaseTypes
8
9
 
9
10
  class DatabaseAccess(BaseModel):
@@ -14,7 +15,7 @@ class DatabaseAccess(BaseModel):
14
15
  user_id: int = Field(0, ge=0, description="User Id")
15
16
  token_string: BaseTypes.OptionalString = Field(None, description="Token string")
16
17
  token_payload: Optional[MaleoFoundationTokenGeneralTransfers.DecodePayload] = Field(None, description="Token payload")
17
- service: str = Field(..., description="Service key")
18
+ service: BaseEnums.Service = Field(..., description="Service key")
18
19
  table: str = Field(..., description="Table name")
19
20
  data_id: int = Field(..., ge=1, description="Data Id")
20
21
  data: BaseTypes.StringToAnyDict = Field(..., description="Data")
@@ -28,7 +29,7 @@ class DatabaseAccess(BaseModel):
28
29
  "user_id": self.user_id,
29
30
  "token_string": None if self.token_string is None else {"string": self.token_string},
30
31
  "token_payload": None if self.token_payload is None else {"TokenPayload": self.token_payload.to_google_pubsub_object()},
31
- "service": self.service,
32
+ "service": self.service.replace("-", "_"),
32
33
  "table": self.table,
33
34
  "data_id": self.data_id,
34
35
  "data": self.data
@@ -0,0 +1,19 @@
1
+ from pydantic_settings import BaseSettings
2
+ from pydantic import Field
3
+ from maleo_foundation.enums import BaseEnums
4
+
5
+ class Settings(BaseSettings):
6
+ ENVIRONMENT: BaseEnums.EnvironmentType = Field(..., description="Environment")
7
+ SERVICE_KEY: str = Field(..., description="Service's key")
8
+ GOOGLE_CREDENTIALS_PATH: str = Field(
9
+ "/credentials/maleo-google-service-account.json",
10
+ description="Internal credential's file path"
11
+ )
12
+ STATIC_CONFIGURATIONS_PATH: str = Field(
13
+ "configs/static.yaml",
14
+ description="Maleo's static configurations path"
15
+ )
16
+ RUNTIME_CONFIGURATIONS_PATH: str = Field(
17
+ "configs/runtime.yaml",
18
+ description="Service's runtime configurations path"
19
+ )
@@ -0,0 +1,27 @@
1
+ import json
2
+ from typing import Callable
3
+ from fastapi.encoders import jsonable_encoder
4
+
5
+ def build_key(
6
+ func: Callable,
7
+ *args,
8
+ **kwargs
9
+ ) -> str:
10
+ arg_values = []
11
+ for arg in args:
12
+ try:
13
+ arg_values.append(jsonable_encoder(arg))
14
+ except Exception:
15
+ arg_values.append(str(arg))
16
+
17
+ kwarg_values = {}
18
+ for k, v in kwargs.items():
19
+ try:
20
+ kwarg_values[k] = jsonable_encoder(v)
21
+ except Exception:
22
+ kwarg_values[k] = str(v)
23
+
24
+ serialized_args = json.dumps(arg_values, sort_keys=True)
25
+ serialized_kwargs = json.dumps(kwarg_values, sort_keys=True)
26
+
27
+ return f"{func.__module__}:{func.__qualname__}({serialized_args}|{serialized_kwargs})"
@@ -1,3 +1,4 @@
1
+ import json
1
2
  import os
2
3
  from google.auth import default
3
4
  from google.oauth2.service_account import Credentials
@@ -31,4 +32,136 @@ class GoogleCredentialsLoader:
31
32
  credentials, _ = default()
32
33
  return credentials
33
34
  except Exception as e:
34
- raise ValueError(f"Failed to load default credentials: {str(e)}")
35
+ raise ValueError(f"Failed to load default credentials: {str(e)}")
36
+
37
+ class GoogleCredentialsLoader:
38
+ @staticmethod
39
+ def load(
40
+ credentials_path: Optional[Union[Path, str]] = None
41
+ ) -> Credentials:
42
+ """
43
+ Load Google service account credentials with guaranteed project_id.
44
+ Priority:
45
+ 1. Explicit path argument
46
+ 2. GOOGLE_CREDENTIALS_PATH environment variable
47
+ 3. GOOGLE_APPLICATION_CREDENTIALS environment variable
48
+ 4. Service account from default credentials (if available)
49
+
50
+ Always returns google.oauth2.service_account.Credentials with project_id.
51
+ Raises ValueError if service account credentials cannot be loaded or project_id is missing.
52
+ """
53
+ # Try explicit path first
54
+ if credentials_path is not None:
55
+ credentials_path = Path(credentials_path)
56
+ if credentials_path.exists() and credentials_path.is_file():
57
+ return GoogleCredentialsLoader._load_from_file(credentials_path)
58
+
59
+ # Try GOOGLE_CREDENTIALS_PATH environment variable
60
+ env_credentials_path = os.getenv("GOOGLE_CREDENTIALS_PATH")
61
+ if env_credentials_path:
62
+ credentials_path = Path(env_credentials_path)
63
+ if credentials_path.exists() and credentials_path.is_file():
64
+ return GoogleCredentialsLoader._load_from_file(credentials_path)
65
+
66
+ # Try GOOGLE_APPLICATION_CREDENTIALS environment variable
67
+ app_credentials_path = os.getenv("GOOGLE_APPLICATION_CREDENTIALS")
68
+ if app_credentials_path:
69
+ credentials_path = Path(app_credentials_path)
70
+ if credentials_path.exists() and credentials_path.is_file():
71
+ return GoogleCredentialsLoader._load_from_file(credentials_path)
72
+
73
+ # Try to get service account from default credentials
74
+ return GoogleCredentialsLoader._load_from_default()
75
+
76
+ @staticmethod
77
+ def _load_from_file(credentials_path: Path) -> Credentials:
78
+ """Load credentials from a service account file."""
79
+ try:
80
+ # First, read and validate the service account file
81
+ with open(credentials_path, 'r') as f:
82
+ service_account_info = json.load(f)
83
+
84
+ # Ensure project_id is present in the file
85
+ if 'project_id' not in service_account_info or not service_account_info['project_id']:
86
+ raise ValueError(f"Service account file {credentials_path} does not contain project_id")
87
+
88
+ # Load credentials from the file
89
+ credentials = Credentials.from_service_account_file(str(credentials_path))
90
+
91
+ # Double-check that project_id is available in the credentials object
92
+ if not credentials.project_id:
93
+ raise ValueError(f"Loaded credentials from {credentials_path} do not have project_id")
94
+
95
+ return credentials
96
+
97
+ except json.JSONDecodeError as e:
98
+ raise ValueError(f"Invalid JSON in credentials file {credentials_path}: {str(e)}")
99
+ except Exception as e:
100
+ raise ValueError(f"Failed to load credentials from file {credentials_path}: {str(e)}")
101
+
102
+ @staticmethod
103
+ def _load_from_default() -> Credentials:
104
+ """Load service account credentials from default sources."""
105
+ try:
106
+ credentials, _ = default()
107
+
108
+ # Check if the default credentials are service account credentials
109
+ if isinstance(credentials, Credentials):
110
+ # Already service account credentials
111
+ if not credentials.project_id:
112
+ # For service account credentials, project_id should be available
113
+ # If not, the service account file is malformed
114
+ raise ValueError(
115
+ "Service account credentials loaded from default source do not have project_id. "
116
+ "Please ensure your service account key file contains the project_id field."
117
+ )
118
+
119
+ return credentials
120
+ else:
121
+ # Default credentials are not service account credentials
122
+ raise ValueError(
123
+ "Default credentials are not service account credentials. "
124
+ f"Found credentials of type: {type(credentials).__name__}. "
125
+ "Please provide a service account key file via GOOGLE_CREDENTIALS_PATH, "
126
+ "GOOGLE_APPLICATION_CREDENTIALS, or the credentials_path parameter."
127
+ )
128
+
129
+ except Exception as e:
130
+ if "service account" in str(e).lower() or "project_id" in str(e).lower():
131
+ raise
132
+ raise ValueError(
133
+ f"Failed to load service account credentials from default sources: {str(e)}. "
134
+ "Please provide a service account key file via GOOGLE_CREDENTIALS_PATH, "
135
+ "GOOGLE_APPLICATION_CREDENTIALS, or the credentials_path parameter."
136
+ )
137
+
138
+ @staticmethod
139
+ def _get_project_id_from_env() -> str:
140
+ """Get project_id from environment variables."""
141
+ project_id = (
142
+ os.getenv("GOOGLE_CLOUD_PROJECT") or
143
+ os.getenv("GCLOUD_PROJECT") or
144
+ os.getenv("GCP_PROJECT") or
145
+ os.getenv("PROJECT_ID")
146
+ )
147
+
148
+ if not project_id:
149
+ raise RuntimeError(
150
+ "project_id is required but not found. Please set one of the following environment variables: "
151
+ "GOOGLE_CLOUD_PROJECT, GCLOUD_PROJECT, GCP_PROJECT, or PROJECT_ID, "
152
+ "or ensure your service account key file contains the project_id field."
153
+ )
154
+
155
+ return project_id
156
+
157
+ @staticmethod
158
+ def validate_credentials(credentials: Credentials) -> None:
159
+ """Validate that credentials are service account credentials with project_id."""
160
+ if not isinstance(credentials, Credentials):
161
+ raise ValueError("Credentials must be google.oauth2.service_account.Credentials")
162
+
163
+ if not credentials.project_id:
164
+ raise ValueError("Service account credentials must have project_id")
165
+
166
+ if not credentials.service_account_email:
167
+ raise ValueError("Service account credentials must have service_account_email")
@@ -54,7 +54,6 @@ class BaseLogger(logging.Logger):
54
54
  dir: str,
55
55
  type: BaseEnums.LoggerType,
56
56
  service_key: BaseTypes.OptionalString = None,
57
- middleware_type: Optional[BaseEnums.MiddlewareLoggerType] = None,
58
57
  client_key: BaseTypes.OptionalString = None,
59
58
  level: BaseEnums.LoggerLevel = BaseEnums.LoggerLevel.INFO,
60
59
  google_cloud_logging: Optional[GoogleCloudLogging] = None
@@ -66,11 +65,6 @@ class BaseLogger(logging.Logger):
66
65
  if self._service_key is None:
67
66
  raise ValueError("SERVICE_KEY environment variable must be set if 'service_key' is set to None")
68
67
 
69
- self._middleware_type = middleware_type #* Declare middleware type
70
-
71
- if self._type == BaseEnums.LoggerType.MIDDLEWARE and self._middleware_type is None:
72
- raise ValueError("'middleware_type' parameter must be provided if 'logger_type' is 'middleware'")
73
-
74
68
  self._client_key = client_key #* Declare client key
75
69
 
76
70
  #* Ensure client_key is valid if logger type is a client
@@ -83,11 +77,6 @@ class BaseLogger(logging.Logger):
83
77
  if self._client_key is None:
84
78
  raise ValueError("'client_key' parameter must be provided if 'logger_type' is 'client'")
85
79
  self._name = f"{self._service_key} - {self._type} - {self._client_key}"
86
- elif self._type == BaseEnums.LoggerType.MIDDLEWARE:
87
- #* Ensure middleware_type is valid if logger type is middleware
88
- if self._middleware_type is None:
89
- raise ValueError("'middleware_type' parameter must be provided if 'logger_type' is 'middleware'")
90
- self._name = f"{self._service_key} - {self._type} - {self._middleware_type}"
91
80
  else:
92
81
  self._name = f"{self._service_key} - {self._type}"
93
82
 
@@ -114,9 +103,7 @@ class BaseLogger(logging.Logger):
114
103
  self.info("Cloud logging is not configured.")
115
104
 
116
105
  #* Define log directory
117
- if self._type == BaseEnums.LoggerType.MIDDLEWARE:
118
- log_dir = f"{self._type}/{self._middleware_type}"
119
- elif self._type == BaseEnums.LoggerType.CLIENT:
106
+ if self._type == BaseEnums.LoggerType.CLIENT:
120
107
  log_dir = f"{self._type}/{self._client_key}"
121
108
  else:
122
109
  log_dir = f"{self._type}"
@@ -164,7 +151,6 @@ class MiddlewareLogger(BaseLogger):
164
151
  self,
165
152
  dir: str,
166
153
  service_key: BaseTypes.OptionalString = None,
167
- middleware_type = None,
168
154
  level = BaseEnums.LoggerLevel.INFO,
169
155
  google_cloud_logging = None
170
156
  ):
@@ -172,7 +158,6 @@ class MiddlewareLogger(BaseLogger):
172
158
  dir=dir,
173
159
  type=BaseEnums.LoggerType.MIDDLEWARE,
174
160
  service_key=service_key,
175
- middleware_type=middleware_type,
176
161
  client_key=None,
177
162
  level=level,
178
163
  google_cloud_logging=google_cloud_logging
@@ -191,7 +176,6 @@ class ServiceLogger(BaseLogger):
191
176
  dir=dir,
192
177
  type=type,
193
178
  service_key=service_key,
194
- middleware_type=None,
195
179
  client_key=None,
196
180
  level=level,
197
181
  google_cloud_logging=google_cloud_logging
@@ -210,7 +194,6 @@ class ClientLogger(BaseLogger):
210
194
  dir=dir,
211
195
  type=BaseEnums.LoggerType.CLIENT,
212
196
  service_key=service_key,
213
- middleware_type=None,
214
197
  client_key=client_key,
215
198
  level=level,
216
199
  google_cloud_logging=google_cloud_logging
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.3.3
3
+ Version: 0.3.5
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -29,6 +29,7 @@ Requires-Dist: google-cloud-audit-log>=0.3.2
29
29
  Requires-Dist: google-cloud-core>=2.4.3
30
30
  Requires-Dist: google-cloud-logging>=3.12.0
31
31
  Requires-Dist: google-cloud-parametermanager>=0.1.3
32
+ Requires-Dist: google-cloud-pubsub>=2.30.0
32
33
  Requires-Dist: google-cloud-secret-manager>=2.23.3
33
34
  Requires-Dist: google-cloud-storage>=2.19.0
34
35
  Requires-Dist: google-crc32c>=1.7.1
@@ -53,7 +54,9 @@ Requires-Dist: markdown-it-py>=3.0.0
53
54
  Requires-Dist: mdurl>=0.1.2
54
55
  Requires-Dist: more-itertools>=10.6.0
55
56
  Requires-Dist: nh3>=0.2.21
56
- Requires-Dist: opentelemetry-api>=1.32.1
57
+ Requires-Dist: opentelemetry-api>=1.34.1
58
+ Requires-Dist: opentelemetry-sdk>=1.34.1
59
+ Requires-Dist: opentelemetry-semantic-conventions>=0.55b1
57
60
  Requires-Dist: packaging>=24.2
58
61
  Requires-Dist: proto-plus>=1.26.1
59
62
  Requires-Dist: protobuf>=5.29.4
@@ -1,8 +1,8 @@
1
1
  maleo_foundation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  maleo_foundation/authentication.py,sha256=6Kw-cl9PlxPNc2nD7Z4sYug2_MhRas6IfyVygQyTHlc,1584
3
3
  maleo_foundation/authorization.py,sha256=HGXCJ47AU1YFMDSmGhrMMmlHnAyghcFZVUiPa1FSvog,283
4
- maleo_foundation/constants.py,sha256=JLQNTY5LJ0gjsT2aicNTRyi9hcOtk31ffFS6ywZXbZM,1449
5
- maleo_foundation/enums.py,sha256=lcRHk5StON_yIVUzPY7KPJG40Nf2HeLouuL-3UKokjQ,4995
4
+ maleo_foundation/constants.py,sha256=LjMIy_Fcr6HLuhIuXs5lCtkyScZXXHOtBMPYx5lwg00,1446
5
+ maleo_foundation/enums.py,sha256=08rkuG3Y4-8kvd5BOBhhIS0UhzBT4kAPQX4L95GqnWQ,5316
6
6
  maleo_foundation/extended_types.py,sha256=pIKt-_9tby4rmune3fmWcCW_mohaNRh_1lywBmdc-L4,301
7
7
  maleo_foundation/rest_controller_result.py,sha256=4KbCmk70IEHj1L1bNJfFg1Y3ifnRSnmvK6dYyVJddok,2014
8
8
  maleo_foundation/types.py,sha256=bUcCR-qRlxxttMxJQnVmtBic3EXEd_urcC2P55evWPc,2451
@@ -32,12 +32,12 @@ maleo_foundation/expanded_types/encryption/__init__.py,sha256=yvqKW_VprQP_3YSL-A
32
32
  maleo_foundation/expanded_types/encryption/aes.py,sha256=1rj43qjIO0TePpr1mErT_NJnqFZSgMM9gybfFxsTams,488
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
+ maleo_foundation/managers/cache.py,sha256=91IvQGCXC3QkhB61m6qLDMaRykmMYOwzMgrSOodfY1A,257
36
+ maleo_foundation/managers/configuration.py,sha256=OOKutQ0OroSIoT7i2KlXLlUrbsVs4WYIfgekVRDuaas,3950
37
+ maleo_foundation/managers/credential.py,sha256=pTsd1sPFw64cOfSffqsdJFkVfsciqxjAvvt6RZJCkDY,3116
35
38
  maleo_foundation/managers/db.py,sha256=y5oP3bTXKeXYKqng-E_HZ-3wC0ZPtl5bls0AEEej6zM,6050
36
- maleo_foundation/managers/middleware.py,sha256=IjHPuOzXKEK44DqhJejJ6wXacAiUi9GwWAdeuwD0lI4,4271
37
- maleo_foundation/managers/service.py,sha256=LwkDW2U8NRiMrZxtlA9xYx2uj23PBayKqJIaO9NzGpM,19727
38
- maleo_foundation/managers/cache/__init__.py,sha256=CeY0oof2bVl_v5WS-FKXNwn2gf3xrEMfUsHK9cHo59s,471
39
- maleo_foundation/managers/cache/base.py,sha256=oXxeMjw4iptFwvdESeYF0mgmEzoAzzCAQbnYwTO5tZ4,867
40
- maleo_foundation/managers/cache/redis.py,sha256=LMxBNCmal6JjsAi7FTeN191PR1zFGw4jjfrJ9lJ_zu0,1162
39
+ maleo_foundation/managers/middleware.py,sha256=ecTNloglV67xoC_hqIEMIxhfQwzXRKHLI3ThJdd-lbY,2480
40
+ maleo_foundation/managers/service.py,sha256=KBbV9nSD1BGovxhM8bIano03lpCj4wCJdtSRlsb22wU,10831
41
41
  maleo_foundation/managers/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
42
  maleo_foundation/managers/client/base.py,sha256=j5_CsToA_7nn_2mP9TWWz7qKalXSWqxfKY_9gTNGJJA,4282
43
43
  maleo_foundation/managers/client/maleo.py,sha256=JCbuIWu5gW--o7H8xvWtSNb_Of3d05FKLRTcvDciLfE,2662
@@ -46,7 +46,8 @@ maleo_foundation/managers/client/google/base.py,sha256=sxALVZIyKUUbNamMrXSlyb3ft
46
46
  maleo_foundation/managers/client/google/parameter.py,sha256=Jy-rMz_xhepmxBI2rWPxdP8AENBbiApg04nO6cIGXN8,1429
47
47
  maleo_foundation/managers/client/google/secret.py,sha256=m-mjaLvYMLgAEn1OxmP0IVTYFQi1jSpDdutLxNA6t6g,4620
48
48
  maleo_foundation/managers/client/google/storage.py,sha256=lEPw4N07nV9r7KjvF2Pb3RM1ZQBK9Riqj7vh6XOEY5Q,5417
49
- maleo_foundation/middlewares/authentication.py,sha256=PkC1mtI1LwX6iBTNvpFf-kxFNt6YkshWupM_lt7CaCI,4851
49
+ maleo_foundation/managers/client/google/subscription.py,sha256=1kb9ftuzDNynXwEMh2gFwL3BUCcNp-cmo4AoHnJjNg8,5177
50
+ maleo_foundation/middlewares/authentication.py,sha256=OXtISL-blyWXn-bsFuWlo0Wn_Go3V-rQLCQZEGmvBNY,4658
50
51
  maleo_foundation/middlewares/base.py,sha256=IszulI930Fm4T4LQZJIyV8kebAlXt4joR6knB3QZUgA,16437
51
52
  maleo_foundation/middlewares/cors.py,sha256=9hLh_h253bvIn7-A7mUblyrJQ37XNpV7aLeHW6ZTHz8,2294
52
53
  maleo_foundation/models/__init__.py,sha256=AaKehO7c1HyKhoTGRmNHDddSeBXkW-_YNrpOGBu8Ms8,246
@@ -57,17 +58,27 @@ maleo_foundation/models/schemas/encryption.py,sha256=pS-dXfbuyv5Q_sEpzyOI372V-au
57
58
  maleo_foundation/models/schemas/general.py,sha256=3bn2IHAXIvk6udEb662hoVajI_Q-jbjZ2XZgtebonXM,3842
58
59
  maleo_foundation/models/schemas/hash.py,sha256=bvBDB9FEDWV_kHQDSDqwZeGs4X28YZ-eQVqTdHh-p1s,445
59
60
  maleo_foundation/models/schemas/key.py,sha256=rJku4HYNb7XeOefdcUENu2GouNrvGmoRXRk5NHkUM-0,598
60
- maleo_foundation/models/schemas/parameter.py,sha256=W86aorAli4Av_pV3_LjCe5o3eLDlZuroMl2BoibP0h8,3512
61
+ maleo_foundation/models/schemas/parameter.py,sha256=eXbWDdDDECegcNVhKXxZhF5KuUFY5UXfLgQ8_jPc7tk,3511
61
62
  maleo_foundation/models/schemas/result.py,sha256=Utpq7ZPb55Q08-j_P5GukcYnNxaIlHXCEgGlrBqhS_c,3983
62
63
  maleo_foundation/models/schemas/signature.py,sha256=pP78JZpoizQguVKXv4AXQmB8ebVy0BmcIfpEm9_YbRU,625
63
64
  maleo_foundation/models/schemas/token.py,sha256=Ay-ntAiKeBjCT4YYw0S3Zd4e-KvHSYvG_hzCMYzd5qY,567
64
65
  maleo_foundation/models/transfers/__init__.py,sha256=oJLJ3Geeme6vBw7R2Dhvdvg4ziVvzEYAGJaP-tm_90w,299
65
66
  maleo_foundation/models/transfers/general/__init__.py,sha256=rzHpxhyNphl5RVrsAlzEvuYEonmWgb69gJ8XOLMvFDc,4686
66
- maleo_foundation/models/transfers/general/database.py,sha256=LEMhHNmqoT7zhZisdI0ZEmFX8zENWUKfcQ4FJsAfr8E,1956
67
+ maleo_foundation/models/transfers/general/credentials.py,sha256=kLS0ymFipQmL3QaA2YFQepRfrQYlEm0jp1MiviAnfXM,345
68
+ maleo_foundation/models/transfers/general/database.py,sha256=E3bWaMlvxIRrEGUT29AN5k42FNI5MnrmLq9rnEh0igE,2033
67
69
  maleo_foundation/models/transfers/general/key.py,sha256=S37SqD3qwTbgMk7785hW7Kl9d4Kouh4uPZcGoyMQ_-Q,755
68
70
  maleo_foundation/models/transfers/general/request.py,sha256=NTYFOmucc4bMfoocBeHGNLs6mbRdqXyVtp1_yDiv_Gg,4849
71
+ maleo_foundation/models/transfers/general/settings.py,sha256=gR-IB-j137h2LkbHjjU43TWMtDt54VkvE75UPk9o590,734
69
72
  maleo_foundation/models/transfers/general/signature.py,sha256=J9xQy2HjpCQOnES7RJqsUnDgjFPuakQ1mxyfdTdstSE,297
70
73
  maleo_foundation/models/transfers/general/token.py,sha256=PU-_wLFaY2i8pwRi9-jlk4nh7XzoTKOk0BEsUCGbD80,4979
74
+ maleo_foundation/models/transfers/general/configurations/__init__.py,sha256=-23Mm8_i_NRMagdNvGaL25pcscnmrXO-R7kAEgACkEI,1981
75
+ maleo_foundation/models/transfers/general/configurations/database.py,sha256=7osPd5NTf8wYEevcPT_60yEAcC0W9-MrW4lSwLi8nqQ,544
76
+ maleo_foundation/models/transfers/general/configurations/middleware.py,sha256=1BulO00lb7Xe537--rD_11GFrUKS8YxWHx2RkWfHqtg,2292
77
+ maleo_foundation/models/transfers/general/configurations/service.py,sha256=8lag1KXkS43IwsMGWka7L-peQ9YT1-dmWeEhQ1hnnLU,304
78
+ maleo_foundation/models/transfers/general/configurations/cache/__init__.py,sha256=a7p5LWkQJlgcfKpdJrKnCfe1LUAnwltXwTOThANlR6s,286
79
+ maleo_foundation/models/transfers/general/configurations/cache/redis.py,sha256=LMxBNCmal6JjsAi7FTeN191PR1zFGw4jjfrJ9lJ_zu0,1162
80
+ maleo_foundation/models/transfers/general/configurations/client/__init__.py,sha256=XSJp-y7TzXaz_cD3AG_Cnt4YQFv3tYGfam4U0FqUrhE,275
81
+ maleo_foundation/models/transfers/general/configurations/client/maleo.py,sha256=p6NRPWL6eKZCVU_irBCS2iuTQl-QylYuHwV8Rht30GI,1560
71
82
  maleo_foundation/models/transfers/parameters/__init__.py,sha256=oKW4RPIEISISRjsJzD8lsCGY1HhZRTzshPpWHcJu86k,353
72
83
  maleo_foundation/models/transfers/parameters/client.py,sha256=wI2-ML99yn5HR0AciFg2C9EQixrWjbIR8x_bDbqKeDM,4069
73
84
  maleo_foundation/models/transfers/parameters/general.py,sha256=-nSIcn0thtodk-69Uwj6qdrX8zfe-PX-gWwD-_VCVyY,779
@@ -100,12 +111,13 @@ maleo_foundation/models/transfers/results/service/repository.py,sha256=djITRZh2j
100
111
  maleo_foundation/models/transfers/results/service/controllers/__init__.py,sha256=HZJWMy2dskzOCzLmp_UaL9rjbQ-sDMI7sd2bXb-4QOU,175
101
112
  maleo_foundation/models/transfers/results/service/controllers/rest.py,sha256=wCuFyOTQkuBs2cqjPsWnPy0XIsCfMqGByhrSy57qp7Y,1107
102
113
  maleo_foundation/utils/__init__.py,sha256=ZZv0NDcTdHsHl51EKfgrlCm8CQmgvyIndMcQABDudN0,391
114
+ maleo_foundation/utils/cache.py,sha256=0VglrEZL7K-5C4sXr0Kr20MjALt9e8JJhdaGSfPbZmE,732
103
115
  maleo_foundation/utils/cleaner.py,sha256=dv80jDd8uAXuqyB5_UPbT2JksJ-hsq286DB2WCjjAYs,696
104
116
  maleo_foundation/utils/client.py,sha256=CGwn8eH5WlwnE5tPMfMAH5V3BItBgVmYBZnXpLjTVSc,2826
105
117
  maleo_foundation/utils/controller.py,sha256=Ub1R-JN6spmXakYrOY7igwaNt4Sg8LASASdXymxZcCI,6954
106
118
  maleo_foundation/utils/exceptions.py,sha256=z24kzEP2geaAEElxXaEy7ln6KodebXvtlu-h1inZ_nw,6376
107
119
  maleo_foundation/utils/extractor.py,sha256=ZNX0sQKcUwwh7paUZpdR04a18s8Ru2xNXhWZl-XN3l4,2197
108
- maleo_foundation/utils/logging.py,sha256=yXo2ztzt5PBEtyPR8OtYhz5Ob5uwDVwa9wpbxnh_pys,7827
120
+ maleo_foundation/utils/logging.py,sha256=Gl9Vw73gi5PILXM2CMXvPE506wxedDTbdH6PeFcYR6A,6822
109
121
  maleo_foundation/utils/merger.py,sha256=MdocyCOtIhqjcmqx2mJ0V8vtwsrunRXqhRdrBCruh7Q,622
110
122
  maleo_foundation/utils/query.py,sha256=hhISpBAZ4SV_pGf7uGBC6fzLrs_yj5_8gj-kFFeeNrw,8060
111
123
  maleo_foundation/utils/repository.py,sha256=pxpws2PDyXwGACms_1azlabqzT6q1x41aYAQRablSnk,2860
@@ -119,10 +131,10 @@ maleo_foundation/utils/loaders/__init__.py,sha256=P_3ycGfeDXFjAi8bE4iLWHxBveqUId
119
131
  maleo_foundation/utils/loaders/json.py,sha256=Uw8v_nfkNMPvcpDYrFwqZBkACyxWzzd6M7klhHbo5JI,508
120
132
  maleo_foundation/utils/loaders/yaml.py,sha256=V2AMjkwoxi1awdahifjtEALvUZ11VL9pZWGtQ7qrNJs,503
121
133
  maleo_foundation/utils/loaders/credential/__init__.py,sha256=qopTKvcMVoTFwyRijeg7rejnG4I684FjUwh70tvhtVM,141
122
- maleo_foundation/utils/loaders/credential/google.py,sha256=yEL0DIVjiKSlZOxogC5pr_NAdWth9dj_ZatLjRsutIk,1269
134
+ maleo_foundation/utils/loaders/credential/google.py,sha256=Xd1OIlFN2MBrQKSkVj647SyZSuG6t95CE7Gd91NSZpM,7651
123
135
  maleo_foundation/utils/loaders/key/__init__.py,sha256=hVygcC2ImHc_aVrSrOmyedR8tMUZokWUKCKOSh5ctbo,106
124
136
  maleo_foundation/utils/loaders/key/rsa.py,sha256=gDhyX6iTFtHiluuhFCozaZ3pOLKU2Y9TlrNMK_GVyGU,3796
125
- maleo_foundation-0.3.3.dist-info/METADATA,sha256=XlKD-rUCKO3sMc5y0swsCq0Xj453qU-e9MSMWZZkXog,3597
126
- maleo_foundation-0.3.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
127
- maleo_foundation-0.3.3.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
128
- maleo_foundation-0.3.3.dist-info/RECORD,,
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,,
@@ -1,29 +0,0 @@
1
- import json
2
- from typing import Callable
3
- from fastapi.encoders import jsonable_encoder
4
-
5
- class BaseCacheConfigurations:
6
- @staticmethod
7
- def key_builder(
8
- func: Callable,
9
- *args,
10
- **kwargs
11
- ) -> str:
12
- arg_values = []
13
- for arg in args:
14
- try:
15
- arg_values.append(jsonable_encoder(arg))
16
- except Exception:
17
- arg_values.append(str(arg))
18
-
19
- kwarg_values = {}
20
- for k, v in kwargs.items():
21
- try:
22
- kwarg_values[k] = jsonable_encoder(v)
23
- except Exception:
24
- kwarg_values[k] = str(v)
25
-
26
- serialized_args = json.dumps(arg_values, sort_keys=True)
27
- serialized_kwargs = json.dumps(kwarg_values, sort_keys=True)
28
-
29
- return f"{func.__module__}:{func.__qualname__}({serialized_args}|{serialized_kwargs})"