Add base kubernetes support

This commit is contained in:
Urtzi Alfaro
2025-09-27 11:18:13 +02:00
parent a27f159e24
commit 63a3f9c77a
63 changed files with 5826 additions and 170 deletions

View File

@@ -19,9 +19,23 @@ class AuthSettings(BaseServiceSettings):
SERVICE_NAME: str = "auth-service"
DESCRIPTION: str = "User authentication and authorization service"
# Database Configuration
DATABASE_URL: str = os.getenv("AUTH_DATABASE_URL",
"postgresql+asyncpg://auth_user:auth_pass123@auth-db:5432/auth_db")
# Database configuration (secure approach - build from components)
@property
def DATABASE_URL(self) -> str:
"""Build database URL from secure components"""
# Try complete URL first (for backward compatibility)
complete_url = os.getenv("AUTH_DATABASE_URL")
if complete_url:
return complete_url
# Build from components (secure approach)
user = os.getenv("AUTH_DB_USER", "auth_user")
password = os.getenv("AUTH_DB_PASSWORD", "auth_pass123")
host = os.getenv("AUTH_DB_HOST", "localhost")
port = os.getenv("AUTH_DB_PORT", "5432")
name = os.getenv("AUTH_DB_NAME", "auth_db")
return f"postgresql+asyncpg://{user}:{password}@{host}:{port}/{name}"
# Redis Database (dedicated for auth)
REDIS_DB: int = 0