maleo-foundation 0.1.38__py3-none-any.whl → 0.1.40__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.
- maleo_foundation/managers/service.py +12 -4
- {maleo_foundation-0.1.38.dist-info → maleo_foundation-0.1.40.dist-info}/METADATA +1 -1
- {maleo_foundation-0.1.38.dist-info → maleo_foundation-0.1.40.dist-info}/RECORD +5 -5
- {maleo_foundation-0.1.38.dist-info → maleo_foundation-0.1.40.dist-info}/WHEEL +0 -0
- {maleo_foundation-0.1.38.dist-info → maleo_foundation-0.1.40.dist-info}/top_level.txt +0 -0
@@ -5,9 +5,9 @@ from fastapi.exceptions import RequestValidationError
|
|
5
5
|
from starlette.exceptions import HTTPException
|
6
6
|
from starlette.types import Lifespan, AppType
|
7
7
|
from pydantic_settings import BaseSettings
|
8
|
-
from pydantic import BaseModel, Field
|
8
|
+
from pydantic import BaseModel, Field, model_validator
|
9
9
|
from sqlalchemy import MetaData
|
10
|
-
from typing import Optional, Type
|
10
|
+
from typing import Dict, Optional, Type
|
11
11
|
from maleo_foundation.enums import BaseEnums
|
12
12
|
from maleo_foundation.models.transfers.general.token import BaseTokenGeneralTransfers
|
13
13
|
from maleo_foundation.models.transfers.parameters.token import BaseTokenParametersTransfers
|
@@ -80,12 +80,20 @@ class ServiceConfigurations(BaseModel):
|
|
80
80
|
|
81
81
|
class DatabaseConfigurations(BaseModel):
|
82
82
|
username:str = Field("postgres", description="Database user's username")
|
83
|
-
|
84
|
-
password:str = Field(os.getenv(password_env), description="Database user's password")
|
83
|
+
password:str = Field(..., description="Database user's password")
|
85
84
|
host:str = Field(..., description="Database's host")
|
86
85
|
port:int = Field(5432, description="Database's port")
|
87
86
|
database:str = Field(..., description="Database")
|
88
87
|
|
88
|
+
@model_validator(mode='before')
|
89
|
+
@classmethod
|
90
|
+
def populate_password(cls, values:Dict):
|
91
|
+
env_value = os.getenv("DB_PASSWORD")
|
92
|
+
if env_value is None:
|
93
|
+
raise ValueError("'DB_PASSWORD' environmet variable must be set.")
|
94
|
+
values["password"] = env_value
|
95
|
+
return values
|
96
|
+
|
89
97
|
@property
|
90
98
|
def url(self) -> str:
|
91
99
|
return f"postgresql://{self.username}:{self.password}@{self.host}:{self.port}/{self.database}"
|
@@ -13,7 +13,7 @@ maleo_foundation/expanded_types/token.py,sha256=4fRTJw6W5MYq71NksNrWNi7qYHQ4_lQw
|
|
13
13
|
maleo_foundation/managers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
14
|
maleo_foundation/managers/db.py,sha256=ZN0b43OgqQtk2WHKMJQ0E2TeaSEyVJ0-l4FEkrSG0Qo,4645
|
15
15
|
maleo_foundation/managers/middleware.py,sha256=7CDXPMb28AR7J72TWOeKFxOlMypKezEtO9mr53a88B0,4032
|
16
|
-
maleo_foundation/managers/service.py,sha256=
|
16
|
+
maleo_foundation/managers/service.py,sha256=kz1xMClvT5oqCgtS-yywhzFgt5GzXl3boG5hBNDpMBo,20777
|
17
17
|
maleo_foundation/managers/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
18
18
|
maleo_foundation/managers/client/base.py,sha256=lYREmEoTLShlPPXOKKiAopjefJ8nIWHCi7IvWkXXKeY,1465
|
19
19
|
maleo_foundation/managers/client/maleo.py,sha256=NibYGdiN3EXUw5nx-tL48QAZym14GcA4BDZihGJNQ-g,4254
|
@@ -66,7 +66,7 @@ maleo_foundation/utils/loaders/__init__.py,sha256=Dnuv7BWyglSddnbsFb96s-b3KaW7UK
|
|
66
66
|
maleo_foundation/utils/loaders/json.py,sha256=NsXLq3VZSgzmEf99tV1VtrmiudWdQ8Pzh_hI4Rm0cM8,397
|
67
67
|
maleo_foundation/utils/loaders/key.py,sha256=GZ4h1ONfp6Xx8-E8AWoGP4ajAZrwPhZRtidjn_u82Qg,2562
|
68
68
|
maleo_foundation/utils/loaders/yaml.py,sha256=jr8v3BlgmRCMTzdNgKhIYt1tnubaJXcDSSGkKVR8pbw,362
|
69
|
-
maleo_foundation-0.1.
|
70
|
-
maleo_foundation-0.1.
|
71
|
-
maleo_foundation-0.1.
|
72
|
-
maleo_foundation-0.1.
|
69
|
+
maleo_foundation-0.1.40.dist-info/METADATA,sha256=8yAyauzZ4r9LjO3WcqxlqMEPoYNhmeCPntKP51s7psc,3190
|
70
|
+
maleo_foundation-0.1.40.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
71
|
+
maleo_foundation-0.1.40.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
|
72
|
+
maleo_foundation-0.1.40.dist-info/RECORD,,
|
File without changes
|
File without changes
|