maleo-foundation 0.1.32__tar.gz → 0.1.33__tar.gz
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-0.1.32 → maleo_foundation-0.1.33}/PKG-INFO +1 -1
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/managers/service.py +11 -2
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/middlewares/authentication.py +4 -4
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation.egg-info/PKG-INFO +1 -1
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/pyproject.toml +1 -1
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/README.md +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/authentication.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/general/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/general/http.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/google/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/google/base.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/google/cloud/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/google/cloud/base.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/google/cloud/logging.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/google/cloud/secret.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/google/cloud/storage.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/google/secret.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/google/storage.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/utils/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/utils/logger.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/constants.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/db/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/db/engine.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/db/manager.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/db/session.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/db/table.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/enums.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/expanded_types/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/expanded_types/client.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/expanded_types/general.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/expanded_types/query.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/expanded_types/service.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/expanded_types/token.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/extended_types.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/managers/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/managers/client/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/managers/client/base.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/managers/client/google/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/managers/client/google/base.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/managers/client/google/secret.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/managers/client/google/storage.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/managers/client/http.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/managers/client/maleo.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/managers/db.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/managers/middleware.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/middlewares/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/middlewares/base.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/middlewares/cors.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/responses.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/schemas/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/schemas/general.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/schemas/parameter.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/schemas/result.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/schemas/token.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/general/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/general/token.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/parameters/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/parameters/client.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/parameters/general.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/parameters/service.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/parameters/token.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/results/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/results/client/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/results/client/controllers/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/results/client/controllers/http.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/results/client/service.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/results/service/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/results/service/controllers/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/results/service/controllers/rest.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/results/service/general.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/results/service/query.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/results/token.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/services/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/services/token.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/types.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/utils/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/utils/controller.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/utils/exceptions.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/utils/extractor.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/utils/formatter/__init__.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/utils/formatter/case.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/utils/keyloader.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/utils/logger.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/utils/logging.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/utils/query.py +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation.egg-info/SOURCES.txt +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation.egg-info/dependency_links.txt +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation.egg-info/requires.txt +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation.egg-info/top_level.txt +0 -0
- {maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/setup.cfg +0 -0
@@ -40,7 +40,6 @@ class Settings(BaseSettings):
|
|
40
40
|
PUBLIC_KEY_PATH:str = Field("/keys/maleo-public-key.pem", description="Maleo's public key path")
|
41
41
|
KEY_PASSWORD:str = Field(..., description="Maleo key's password")
|
42
42
|
CONFIGURATIONS_PATH:str = Field(..., description="Service's configuration file path")
|
43
|
-
GCS_BUCKET_NAME:str = Field(..., description="Google cloud storage (GCS)'s bucket name")
|
44
43
|
|
45
44
|
class Keys(BaseModel):
|
46
45
|
password:str = Field(..., description="Key's password")
|
@@ -90,6 +89,12 @@ class DatabaseConfigurations(BaseModel):
|
|
90
89
|
def url(self) -> str:
|
91
90
|
return f"postgresql://{self.username}:{self.password}@{self.host}:{self.port}/{self.database}"
|
92
91
|
|
92
|
+
class GoogleCloudStorageConfigurations(BaseModel):
|
93
|
+
bucket_name:str = Field(..., description="Bucket's name")
|
94
|
+
|
95
|
+
class GoogleClientConfigurations(BaseModel):
|
96
|
+
storage:GoogleCloudStorageConfigurations = Field(..., description="Google cloud storage client configurations")
|
97
|
+
|
93
98
|
class MaleoClientConfiguration(BaseModel):
|
94
99
|
key:str = Field(..., description="Client's key")
|
95
100
|
name:str = Field(..., description="Client's name")
|
@@ -113,8 +118,12 @@ class MaleoClientConfigurations(BaseModel):
|
|
113
118
|
arbitrary_types_allowed=True
|
114
119
|
|
115
120
|
class ClientConfigurations(BaseModel):
|
121
|
+
google:GoogleClientConfigurations = Field(..., description="Google client's configurations")
|
116
122
|
maleo:MaleoClientConfigurations = Field(..., description="Maleo client's configurations")
|
117
123
|
|
124
|
+
class Config:
|
125
|
+
arbitrary_types_allowed=True
|
126
|
+
|
118
127
|
class Configurations(BaseModel):
|
119
128
|
service:ServiceConfigurations = Field(..., description="Service's configurations")
|
120
129
|
middleware:MiddlewareConfigurations = Field(..., description="Middleware's configurations")
|
@@ -315,7 +324,7 @@ class ServiceManager:
|
|
315
324
|
def _initialize_clients(self) -> None:
|
316
325
|
#* Initialize google clients
|
317
326
|
secret = GoogleSecretManager(**self._log_config.model_dump())
|
318
|
-
storage = GoogleCloudStorage(**self._log_config.model_dump())
|
327
|
+
storage = GoogleCloudStorage(**self._log_config.model_dump(), bucket_name=self._configs.client.google.storage.bucket_name)
|
319
328
|
self._google_clients = GoogleClientManagers(secret=secret, storage=storage)
|
320
329
|
#* Initialize http clients
|
321
330
|
self._http_client = HTTPClientManager
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/middlewares/authentication.py
RENAMED
@@ -18,22 +18,22 @@ class Backend(AuthenticationBackend):
|
|
18
18
|
async def authenticate(self, conn:HTTPConnection) -> Tuple[Credentials, User]:
|
19
19
|
client_ip = extract_client_ip(conn)
|
20
20
|
if "Authorization" not in conn.headers:
|
21
|
-
self._logger.info(f"
|
21
|
+
self._logger.info(f"Request | IP: {client_ip} | URL: {conn.url.path} - Result | General: Header did not contain authorization")
|
22
22
|
return Credentials(), User(authenticated=False)
|
23
23
|
|
24
24
|
auth = conn.headers["Authorization"]
|
25
25
|
scheme, token = auth.split()
|
26
26
|
if scheme != 'Bearer':
|
27
|
-
self._logger.info(f"
|
27
|
+
self._logger.info(f"Request | IP: {client_ip} | URL: {conn.url.path} - Result | General: Authorization scheme is not Bearer")
|
28
28
|
return Credentials(), User(authenticated=False)
|
29
29
|
|
30
30
|
decode_token_parameters = BaseTokenParametersTransfers.Decode(key=self._key, token=token)
|
31
31
|
decode_token_result = BaseTokenService.decode(parameters=decode_token_parameters)
|
32
32
|
if not decode_token_result.success:
|
33
|
-
self._logger.error(f"
|
33
|
+
self._logger.error(f"Request | IP: {client_ip} | URL: {conn.url.path} - Result | General: Failed decoding authorization token")
|
34
34
|
return Credentials(token=token), User(authenticated=False)
|
35
35
|
|
36
|
-
self._logger.info(f"
|
36
|
+
self._logger.info(f"Request | IP: {client_ip} | URL: {conn.url.path} - Result | Username: {decode_token_result.data.u_u} | Email: {decode_token_result.data.u_e}")
|
37
37
|
return Credentials(token=token), User(authenticated=True, username=decode_token_result.data.u_u, email=decode_token_result.data.u_e)
|
38
38
|
|
39
39
|
def add_authentication_middleware(app:FastAPI, logger:MiddlewareLogger, key:str) -> None:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/general/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/general/http.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/google/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/google/cloud/base.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/google/cloud/logging.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/google/cloud/secret.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/google/cloud/storage.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/google/secret.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/google/storage.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/utils/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/clients/utils/logger.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/expanded_types/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/expanded_types/client.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/expanded_types/general.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/expanded_types/query.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/expanded_types/service.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/expanded_types/token.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/managers/client/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/managers/client/base.py
RENAMED
File without changes
|
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/managers/client/google/base.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/managers/client/http.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/managers/client/maleo.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/middlewares/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/schemas/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/schemas/general.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/schemas/parameter.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/schemas/result.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/schemas/token.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/models/transfers/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/utils/formatter/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation/utils/formatter/case.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.1.32 → maleo_foundation-0.1.33}/maleo_foundation.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|