feat(config): mask sensitive credentials with SecretStr type
This commit is contained in:
10
config.py
10
config.py
@@ -1,5 +1,5 @@
|
|||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from pydantic import Field
|
from pydantic import Field, SecretStr
|
||||||
from pydantic_settings import BaseSettings
|
from pydantic_settings import BaseSettings
|
||||||
|
|
||||||
load_dotenv(override=True)
|
load_dotenv(override=True)
|
||||||
@@ -10,11 +10,11 @@ class Settings(BaseSettings):
|
|||||||
"postgresql+asyncpg://malenia:skibidi@localhost:5432/malenia_db", alias="POSTGRES_URL"
|
"postgresql+asyncpg://malenia:skibidi@localhost:5432/malenia_db", alias="POSTGRES_URL"
|
||||||
)
|
)
|
||||||
|
|
||||||
bot_token: str = Field(alias="BOT_TOKEN")
|
bot_token: SecretStr = Field(alias="BOT_TOKEN")
|
||||||
admins: list[int] = Field(alias="ADMINS")
|
admins: list[int] = Field(alias="ADMINS")
|
||||||
|
|
||||||
pally_shop_id: str = Field(alias="PALLY_SHOP_ID")
|
pally_shop_id: SecretStr = Field(alias="PALLY_SHOP_ID")
|
||||||
pally_token: str = Field(alias="PALLY_TOKEN")
|
pally_token: SecretStr = Field(alias="PALLY_TOKEN")
|
||||||
|
|
||||||
referal_bonus: int = Field(10, alias="REFERAL_BONUS")
|
referal_bonus: int = Field(10, alias="REFERAL_BONUS")
|
||||||
deposit_threshold: int = Field(50)
|
deposit_threshold: int = Field(50)
|
||||||
@@ -23,7 +23,7 @@ class Settings(BaseSettings):
|
|||||||
|
|
||||||
remnawave_url: str = Field(alias="REMNAWAVE_URL")
|
remnawave_url: str = Field(alias="REMNAWAVE_URL")
|
||||||
subscription_url: str = Field(alias="SUBSCRIPTION_URL")
|
subscription_url: str = Field(alias="SUBSCRIPTION_URL")
|
||||||
remnawave_token: str = Field(alias="REMNAWAVE_TOKEN")
|
remnawave_token: SecretStr = Field(alias="REMNAWAVE_TOKEN")
|
||||||
|
|
||||||
min_devices: int = Field(3, alias="MIN_DEVICES")
|
min_devices: int = Field(3, alias="MIN_DEVICES")
|
||||||
max_devices: int = Field(12, alias="MAX_DEVICES")
|
max_devices: int = Field(12, alias="MAX_DEVICES")
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
from pydantic import BaseModel
|
||||||
|
|
||||||
|
class NewUserDTO(BaseModel):
|
||||||
@dataclass
|
|
||||||
class NewUserDTO:
|
|
||||||
id: int
|
id: int
|
||||||
referal: int | None = None
|
referal: int | None = None
|
||||||
link: str | None = None
|
link: str | None = None
|
||||||
|
|||||||
Reference in New Issue
Block a user