very minor bugfixes, really nothing too important
This commit is contained in:
parent
62da10b69c
commit
f2fd4c8d7c
20 changed files with 2099 additions and 170 deletions
33
src/random_access/settings.py
Normal file
33
src/random_access/settings.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
model_config = SettingsConfigDict(env_file='.env', env_file_encoding='utf-8', extra='ignore')
|
||||
airtable_pat: str
|
||||
airtable_base: str
|
||||
slack_signing_secret: str
|
||||
slack_client_id: str
|
||||
slack_client_secret: str
|
||||
app_base_url: str
|
||||
game_id_salt: str
|
||||
|
||||
# Security settings
|
||||
environment: str = "development" # development, staging, production
|
||||
max_request_size: int = 1048576 # 1MB default
|
||||
rate_limit_requests: int = 20 # requests per minute per IP
|
||||
allowed_origins: str = "*" # Comma-separated list or "*" for development
|
||||
|
||||
# Session security
|
||||
session_ttl_hours: int = 24 # Session expires after 24 hours
|
||||
|
||||
@property
|
||||
def is_production(self) -> bool:
|
||||
return self.environment == "production"
|
||||
|
||||
@property
|
||||
def origins_list(self) -> list[str]:
|
||||
if self.allowed_origins == "*":
|
||||
return ["*"]
|
||||
return [origin.strip() for origin in self.allowed_origins.split(",")]
|
||||
|
||||
settings = Settings() # type: ignore
|
||||
Loading…
Add table
Add a link
Reference in a new issue