maleo-foundation 0.3.35__tar.gz → 0.3.37__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.3.35 → maleo_foundation-0.3.37}/PKG-INFO +1 -1
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/enums.py +7 -26
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/db.py +3 -3
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/service.py +26 -17
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/general/configurations/__init__.py +14 -5
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/logging.py +74 -10
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation.egg-info/PKG-INFO +1 -1
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/pyproject.toml +1 -1
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/README.md +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/authentication.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/authorization.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/client/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/client/manager.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/client/services/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/client/services/encryption/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/client/services/encryption/aes.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/client/services/encryption/rsa.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/client/services/hash/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/client/services/hash/bcrypt.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/client/services/hash/hmac.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/client/services/hash/sha256.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/client/services/key.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/client/services/signature.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/client/services/token.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/constants.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/expanded_types/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/expanded_types/client.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/expanded_types/encryption/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/expanded_types/encryption/aes.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/expanded_types/encryption/rsa.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/expanded_types/general.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/expanded_types/hash.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/expanded_types/key.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/expanded_types/repository.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/expanded_types/service.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/expanded_types/signature.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/expanded_types/token.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/extended_types.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/cache.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/client/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/client/base.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/client/google/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/client/google/base.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/client/google/parameter.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/client/google/secret.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/client/google/storage.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/client/google/subscription.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/client/maleo.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/configuration.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/credential.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/middleware.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/middlewares/authentication.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/middlewares/base.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/middlewares/cors.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/responses.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/schemas/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/schemas/encryption.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/schemas/general.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/schemas/hash.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/schemas/key.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/schemas/parameter.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/schemas/result.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/schemas/signature.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/schemas/token.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/table.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/general/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/general/configurations/cache/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/general/configurations/cache/redis.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/general/configurations/client/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/general/configurations/client/maleo.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/general/configurations/database.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/general/configurations/middleware.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/general/configurations/service.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/general/credentials.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/general/database.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/general/key.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/general/request.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/general/settings.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/general/signature.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/general/token.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/parameters/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/parameters/client.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/parameters/encryption/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/parameters/encryption/aes.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/parameters/encryption/rsa.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/parameters/general.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/parameters/hash/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/parameters/hash/bcrypt.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/parameters/hash/hmac.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/parameters/hash/sha256.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/parameters/key.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/parameters/service.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/parameters/signature.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/parameters/token.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/results/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/results/client/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/results/client/controllers/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/results/client/controllers/http.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/results/client/service.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/results/encryption/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/results/encryption/aes.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/results/encryption/rsa.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/results/hash.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/results/key.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/results/service/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/results/service/controllers/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/results/service/controllers/rest.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/results/service/general.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/results/service/repository.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/results/signature.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/results/token.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/rest_controller_result.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/types.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/cache.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/client.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/controller.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/dependencies/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/dependencies/auth.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/dependencies/context.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/exceptions.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/extractor.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/formatter/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/formatter/case.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/loaders/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/loaders/credential/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/loaders/credential/google.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/loaders/json.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/loaders/key/__init__.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/loaders/key/rsa.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/loaders/yaml.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/merger.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/query.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/repository.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/searcher.py +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation.egg-info/SOURCES.txt +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation.egg-info/dependency_links.txt +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation.egg-info/requires.txt +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation.egg-info/top_level.txt +0 -0
- {maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/setup.cfg +0 -0
@@ -126,17 +126,14 @@ class BaseEnums:
|
|
126
126
|
BaseEnums.RESTControllerResponseType.FILE: responses.FileResponse,
|
127
127
|
}.get(self, responses.Response)
|
128
128
|
|
129
|
-
class ServiceLoggerType(StrEnum):
|
130
|
-
REPOSITORY = "repository"
|
131
|
-
DATABASE = "database"
|
132
|
-
APPLICATION = "application"
|
133
|
-
|
134
129
|
class LoggerType(StrEnum):
|
135
|
-
MIDDLEWARE = "middleware"
|
136
|
-
REPOSITORY = "repository"
|
137
|
-
DATABASE = "database"
|
138
130
|
APPLICATION = "application"
|
131
|
+
CACHE = "cache"
|
139
132
|
CLIENT = "client"
|
133
|
+
DATABASE = "database"
|
134
|
+
MIDDLEWARE = "middleware"
|
135
|
+
REPOSITORY = "repository"
|
136
|
+
SERVICE = "service"
|
140
137
|
|
141
138
|
class LoggerLevel(IntEnum):
|
142
139
|
CRITICAL = logging.CRITICAL
|
@@ -148,26 +145,10 @@ class BaseEnums:
|
|
148
145
|
DEBUG = logging.DEBUG
|
149
146
|
NOTSET = logging.NOTSET
|
150
147
|
|
151
|
-
class
|
148
|
+
class CacheLayer(StrEnum):
|
149
|
+
CLIENT = "client"
|
152
150
|
REPOSITORY = "repository"
|
153
151
|
ROUTER = "router"
|
154
|
-
CLIENT = "client"
|
155
|
-
|
156
|
-
class CacheTTL(IntEnum):
|
157
|
-
TTL_15SC = int(15)
|
158
|
-
TTL_30SC = int(30)
|
159
|
-
TTL_1MN = int(1*60)
|
160
|
-
TTL_5MN = int(5*60)
|
161
|
-
TTL_10MN = int(10*60)
|
162
|
-
TTL_30MN = int(30*60)
|
163
|
-
TTL_1HR = int(1*60*60)
|
164
|
-
TTL_6HR = int(6*60*60)
|
165
|
-
TTL_12HR = int(12*60*60)
|
166
|
-
TTL_1DY = int(1*24*60*60)
|
167
|
-
TTL_3DY = int(3*24*60*60)
|
168
|
-
TTL_1WK = int(1*7*24*60*60)
|
169
|
-
TTL_2WK = int(2*7*24*60*60)
|
170
|
-
TTL_1MO = int(1*30*24*60*60)
|
171
152
|
|
172
153
|
class Expiration(IntEnum):
|
173
154
|
EXP_15SC = int(15)
|
@@ -8,7 +8,7 @@ from sqlalchemy.ext.declarative import DeclarativeMeta
|
|
8
8
|
from sqlalchemy.orm import sessionmaker, Session, declarative_base
|
9
9
|
from typing import Generator
|
10
10
|
from maleo_foundation.types import BaseTypes
|
11
|
-
from maleo_foundation.utils.logging import
|
11
|
+
from maleo_foundation.utils.logging import DatabaseLogger
|
12
12
|
|
13
13
|
class MetadataManager:
|
14
14
|
Base: DeclarativeMeta = declarative_base()
|
@@ -17,7 +17,7 @@ class MetadataManager:
|
|
17
17
|
class SessionManager:
|
18
18
|
def __init__(
|
19
19
|
self,
|
20
|
-
logger:
|
20
|
+
logger: DatabaseLogger,
|
21
21
|
engine: Engine
|
22
22
|
):
|
23
23
|
self._logger = logger
|
@@ -80,7 +80,7 @@ class DatabaseManager:
|
|
80
80
|
def __init__(
|
81
81
|
self,
|
82
82
|
metadata: MetaData,
|
83
|
-
logger:
|
83
|
+
logger: DatabaseLogger,
|
84
84
|
url: BaseTypes.OptionalString = None
|
85
85
|
):
|
86
86
|
self._metadata = metadata #* Define database metadata
|
@@ -30,8 +30,12 @@ from maleo_foundation.types import BaseTypes
|
|
30
30
|
from maleo_foundation.utils.exceptions import BaseExceptions
|
31
31
|
from maleo_foundation.utils.logging import (
|
32
32
|
SimpleConfig,
|
33
|
-
|
34
|
-
|
33
|
+
ApplicationLogger,
|
34
|
+
CacheLogger,
|
35
|
+
DatabaseLogger,
|
36
|
+
MiddlewareLogger,
|
37
|
+
RepositoryLogger,
|
38
|
+
ServiceLogger
|
35
39
|
)
|
36
40
|
from .credential import CredentialManager
|
37
41
|
from .configuration import ConfigurationManager
|
@@ -119,32 +123,37 @@ class ServiceManager:
|
|
119
123
|
return self._keys
|
120
124
|
|
121
125
|
def _initialize_loggers(self) -> None:
|
122
|
-
|
123
|
-
application = ServiceLogger(
|
124
|
-
type=BaseEnums.LoggerType.APPLICATION,
|
126
|
+
application = ApplicationLogger(
|
125
127
|
service_key=self.configurations.service.key,
|
126
128
|
**self._log_config.model_dump()
|
127
129
|
)
|
128
|
-
|
129
|
-
type=BaseEnums.LoggerType.DATABASE,
|
130
|
+
cache = CacheLogger(
|
130
131
|
service_key=self.configurations.service.key,
|
131
132
|
**self._log_config.model_dump()
|
132
133
|
)
|
133
|
-
|
134
|
-
type=BaseEnums.LoggerType.REPOSITORY,
|
134
|
+
database = DatabaseLogger(
|
135
135
|
service_key=self.configurations.service.key,
|
136
136
|
**self._log_config.model_dump()
|
137
137
|
)
|
138
|
-
#* Middleware's logger
|
139
138
|
middleware = MiddlewareLogger(
|
140
139
|
service_key=self.configurations.service.key,
|
141
140
|
**self._log_config.model_dump()
|
142
141
|
)
|
142
|
+
repository = RepositoryLogger(
|
143
|
+
service_key=self.configurations.service.key,
|
144
|
+
**self._log_config.model_dump()
|
145
|
+
)
|
146
|
+
service = ServiceLogger(
|
147
|
+
service_key=self.configurations.service.key,
|
148
|
+
**self._log_config.model_dump()
|
149
|
+
)
|
143
150
|
self._loggers = Loggers(
|
144
151
|
application=application,
|
145
|
-
|
152
|
+
cache=cache,
|
146
153
|
database=database,
|
147
|
-
middleware=middleware
|
154
|
+
middleware=middleware,
|
155
|
+
repository=repository,
|
156
|
+
service=service
|
148
157
|
)
|
149
158
|
|
150
159
|
@property
|
@@ -160,13 +169,13 @@ class ServiceManager:
|
|
160
169
|
async for key in self._redis.scan_iter(f"{prefix}*"):
|
161
170
|
await self._redis.delete(key)
|
162
171
|
|
163
|
-
def check_redis_connection(self) -> bool:
|
172
|
+
async def check_redis_connection(self) -> bool:
|
164
173
|
try:
|
165
|
-
self._redis.ping()
|
166
|
-
self._loggers.
|
174
|
+
await self._redis.ping()
|
175
|
+
self._loggers.cache.info("Redis connection check successful.")
|
167
176
|
return True
|
168
177
|
except RedisError as e:
|
169
|
-
self._loggers.
|
178
|
+
self._loggers.cache.error(f"Redis connection check failed: {e}", exc_info=True)
|
170
179
|
return False
|
171
180
|
|
172
181
|
async def initialize_cache(self) -> None:
|
@@ -178,7 +187,7 @@ class ServiceManager:
|
|
178
187
|
decode_responses=self.configurations.cache.redis.decode_responses,
|
179
188
|
health_check_interval=self.configurations.cache.redis.health_check_interval
|
180
189
|
)
|
181
|
-
self.check_redis_connection()
|
190
|
+
await self.check_redis_connection()
|
182
191
|
self._cache = CacheManagers(redis=self._redis)
|
183
192
|
await self._clear_cache()
|
184
193
|
|
@@ -1,5 +1,12 @@
|
|
1
1
|
from pydantic import BaseModel, ConfigDict, Field
|
2
|
-
from maleo_foundation.utils.logging import
|
2
|
+
from maleo_foundation.utils.logging import (
|
3
|
+
ApplicationLogger,
|
4
|
+
CacheLogger,
|
5
|
+
DatabaseLogger,
|
6
|
+
MiddlewareLogger,
|
7
|
+
RepositoryLogger,
|
8
|
+
ServiceLogger
|
9
|
+
)
|
3
10
|
from .cache import CacheConfigurations
|
4
11
|
from .client import ClientConfigurations
|
5
12
|
from .database import DatabaseConfigurations
|
@@ -18,7 +25,9 @@ class Configurations(BaseModel):
|
|
18
25
|
class Loggers(BaseModel):
|
19
26
|
model_config = ConfigDict(arbitrary_types_allowed=True)
|
20
27
|
|
21
|
-
application:
|
22
|
-
|
23
|
-
database:
|
24
|
-
middleware: MiddlewareLogger = Field(..., description="Middleware logger")
|
28
|
+
application: ApplicationLogger = Field(..., description="Application logger")
|
29
|
+
cache: CacheLogger = Field(..., description="Cache logger")
|
30
|
+
database: DatabaseLogger = Field(..., description="Database logger")
|
31
|
+
middleware: MiddlewareLogger = Field(..., description="Middleware logger")
|
32
|
+
repository: RepositoryLogger = Field(..., description="Repository logger")
|
33
|
+
service: ServiceLogger = Field(..., description="Service logger")
|
@@ -72,9 +72,6 @@ class BaseLogger(logging.Logger):
|
|
72
72
|
|
73
73
|
#* Define logger name
|
74
74
|
if self._type == BaseEnums.LoggerType.CLIENT:
|
75
|
-
#* Ensure client_key is valid if logger type is client
|
76
|
-
if self._client_key is None:
|
77
|
-
raise ValueError("'client_key' parameter must be provided if 'logger_type' is 'client'")
|
78
75
|
self._name = f"{self._service_key} - {self._type} - {self._client_key}"
|
79
76
|
else:
|
80
77
|
self._name = f"{self._service_key} - {self._type}"
|
@@ -145,35 +142,34 @@ class BaseLogger(logging.Logger):
|
|
145
142
|
handler.close()
|
146
143
|
self.handlers.clear()
|
147
144
|
|
148
|
-
class
|
145
|
+
class ApplicationLogger(BaseLogger):
|
149
146
|
def __init__(
|
150
147
|
self,
|
151
148
|
dir: str,
|
152
149
|
service_key: BaseTypes.OptionalString = None,
|
153
|
-
level = BaseEnums.LoggerLevel.INFO,
|
154
|
-
google_cloud_logging = None
|
150
|
+
level: BaseEnums.LoggerLevel = BaseEnums.LoggerLevel.INFO,
|
151
|
+
google_cloud_logging: Optional[GoogleCloudLogging] = None
|
155
152
|
):
|
156
153
|
super().__init__(
|
157
154
|
dir=dir,
|
158
|
-
type=BaseEnums.LoggerType.
|
155
|
+
type=BaseEnums.LoggerType.APPLICATION,
|
159
156
|
service_key=service_key,
|
160
157
|
client_key=None,
|
161
158
|
level=level,
|
162
159
|
google_cloud_logging=google_cloud_logging
|
163
160
|
)
|
164
161
|
|
165
|
-
class
|
162
|
+
class CacheLogger(BaseLogger):
|
166
163
|
def __init__(
|
167
164
|
self,
|
168
165
|
dir: str,
|
169
|
-
type: BaseEnums.ServiceLoggerType,
|
170
166
|
service_key: BaseTypes.OptionalString = None,
|
171
167
|
level: BaseEnums.LoggerLevel = BaseEnums.LoggerLevel.INFO,
|
172
168
|
google_cloud_logging: Optional[GoogleCloudLogging] = None
|
173
169
|
):
|
174
170
|
super().__init__(
|
175
171
|
dir=dir,
|
176
|
-
type=
|
172
|
+
type=BaseEnums.LoggerType.CACHE,
|
177
173
|
service_key=service_key,
|
178
174
|
client_key=None,
|
179
175
|
level=level,
|
@@ -196,4 +192,72 @@ class ClientLogger(BaseLogger):
|
|
196
192
|
client_key=client_key,
|
197
193
|
level=level,
|
198
194
|
google_cloud_logging=google_cloud_logging
|
195
|
+
)
|
196
|
+
|
197
|
+
class DatabaseLogger(BaseLogger):
|
198
|
+
def __init__(
|
199
|
+
self,
|
200
|
+
dir: str,
|
201
|
+
service_key: BaseTypes.OptionalString = None,
|
202
|
+
level = BaseEnums.LoggerLevel.INFO,
|
203
|
+
google_cloud_logging = None
|
204
|
+
):
|
205
|
+
super().__init__(
|
206
|
+
dir=dir,
|
207
|
+
type=BaseEnums.LoggerType.DATABASE,
|
208
|
+
service_key=service_key,
|
209
|
+
client_key=None,
|
210
|
+
level=level,
|
211
|
+
google_cloud_logging=google_cloud_logging
|
212
|
+
)
|
213
|
+
|
214
|
+
class MiddlewareLogger(BaseLogger):
|
215
|
+
def __init__(
|
216
|
+
self,
|
217
|
+
dir: str,
|
218
|
+
service_key: BaseTypes.OptionalString = None,
|
219
|
+
level = BaseEnums.LoggerLevel.INFO,
|
220
|
+
google_cloud_logging = None
|
221
|
+
):
|
222
|
+
super().__init__(
|
223
|
+
dir=dir,
|
224
|
+
type=BaseEnums.LoggerType.MIDDLEWARE,
|
225
|
+
service_key=service_key,
|
226
|
+
client_key=None,
|
227
|
+
level=level,
|
228
|
+
google_cloud_logging=google_cloud_logging
|
229
|
+
)
|
230
|
+
|
231
|
+
class RepositoryLogger(BaseLogger):
|
232
|
+
def __init__(
|
233
|
+
self,
|
234
|
+
dir: str,
|
235
|
+
service_key: BaseTypes.OptionalString = None,
|
236
|
+
level: BaseEnums.LoggerLevel = BaseEnums.LoggerLevel.INFO,
|
237
|
+
google_cloud_logging: Optional[GoogleCloudLogging] = None
|
238
|
+
):
|
239
|
+
super().__init__(
|
240
|
+
dir=dir,
|
241
|
+
type=BaseEnums.LoggerType.REPOSITORY,
|
242
|
+
service_key=service_key,
|
243
|
+
client_key=None,
|
244
|
+
level=level,
|
245
|
+
google_cloud_logging=google_cloud_logging
|
246
|
+
)
|
247
|
+
|
248
|
+
class ServiceLogger(BaseLogger):
|
249
|
+
def __init__(
|
250
|
+
self,
|
251
|
+
dir: str,
|
252
|
+
service_key: BaseTypes.OptionalString = None,
|
253
|
+
level: BaseEnums.LoggerLevel = BaseEnums.LoggerLevel.INFO,
|
254
|
+
google_cloud_logging: Optional[GoogleCloudLogging] = None
|
255
|
+
):
|
256
|
+
super().__init__(
|
257
|
+
dir=dir,
|
258
|
+
type=BaseEnums.LoggerType.SERVICE,
|
259
|
+
service_key=service_key,
|
260
|
+
client_key=None,
|
261
|
+
level=level,
|
262
|
+
google_cloud_logging=google_cloud_logging
|
199
263
|
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/client/services/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/client/services/hash/bcrypt.py
RENAMED
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/client/services/hash/hmac.py
RENAMED
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/client/services/hash/sha256.py
RENAMED
File without changes
|
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/client/services/signature.py
RENAMED
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/client/services/token.py
RENAMED
File without changes
|
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/expanded_types/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/expanded_types/client.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/expanded_types/general.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/expanded_types/repository.py
RENAMED
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/expanded_types/service.py
RENAMED
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/expanded_types/signature.py
RENAMED
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/expanded_types/token.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/client/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/client/base.py
RENAMED
File without changes
|
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/client/google/base.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/client/maleo.py
RENAMED
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/managers/configuration.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/middlewares/authentication.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/schemas/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/schemas/encryption.py
RENAMED
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/schemas/general.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/schemas/parameter.py
RENAMED
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/schemas/result.py
RENAMED
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/schemas/signature.py
RENAMED
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/schemas/token.py
RENAMED
File without changes
|
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/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
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/general/key.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
|
File without changes
|
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/models/transfers/results/key.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.3.35 → maleo_foundation-0.3.37}/maleo_foundation/rest_controller_result.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/dependencies/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/dependencies/auth.py
RENAMED
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/dependencies/context.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/formatter/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/formatter/case.py
RENAMED
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/loaders/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/loaders/key/__init__.py
RENAMED
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation/utils/loaders/key/rsa.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{maleo_foundation-0.3.35 → maleo_foundation-0.3.37}/maleo_foundation.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|