Files
microdao-daarion/services/auth-service/config.py
Apple 6bd769ef40 feat(city-map): Add 2D City Map with coordinates and agent presence
- Add migration 013_city_map_coordinates.sql with map coordinates, zones, and agents table
- Add /city/map API endpoint in city-service
- Add /city/agents and /city/agents/online endpoints
- Extend presence aggregator to include agents[] in snapshot
- Add AgentsSource for fetching agent data from DB
- Create CityMap component with interactive room tiles
- Add useCityMap hook for fetching map data
- Update useGlobalPresence to include agents
- Add map/list view toggle on /city page
- Add agent badges to room cards and map tiles
2025-11-27 07:00:47 -08:00

73 lines
2.0 KiB
Python

"""
Auth Service Configuration
"""
from functools import lru_cache
from pydantic import AliasChoices, Field
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
"""
Settings loader that supports both the new AUTH_* env vars and the legacy
ones used in docker-compose files (e.g. DATABASE_URL, JWT_SECRET).
"""
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
# Service
service_name: str = Field(
default="auth-service",
validation_alias=AliasChoices("AUTH_SERVICE_NAME", "SERVICE_NAME"),
)
service_version: str = Field(
default="1.0.0",
validation_alias=AliasChoices("AUTH_SERVICE_VERSION", "SERVICE_VERSION"),
)
port: int = Field(
default=7020,
validation_alias=AliasChoices("AUTH_PORT", "PORT", "AUTH_SERVICE_PORT"),
)
debug: bool = Field(
default=False,
validation_alias=AliasChoices("AUTH_DEBUG", "DEBUG"),
)
# Database
database_url: str = Field(
default="postgresql://postgres:postgres@localhost:5432/daarion",
validation_alias=AliasChoices("AUTH_DATABASE_URL", "DATABASE_URL"),
)
# JWT
jwt_secret: str = Field(
default="your-very-long-secret-key-change-in-production",
validation_alias=AliasChoices("AUTH_JWT_SECRET", "JWT_SECRET"),
)
jwt_algorithm: str = Field(
default="HS256",
validation_alias=AliasChoices(
"AUTH_JWT_ALGORITHM", "JWT_ALGO", "JWT_ALGORITHM"
),
)
access_token_ttl: int = Field(
default=1800,
validation_alias=AliasChoices("AUTH_ACCESS_TOKEN_TTL", "ACCESS_TOKEN_TTL"),
)
refresh_token_ttl: int = Field(
default=604800,
validation_alias=AliasChoices("AUTH_REFRESH_TOKEN_TTL", "REFRESH_TOKEN_TTL"),
)
# Security
bcrypt_rounds: int = Field(
default=12,
validation_alias=AliasChoices("AUTH_BCRYPT_ROUNDS", "BCRYPT_ROUNDS"),
)
@lru_cache()
def get_settings() -> Settings:
return Settings()