zephyrdark 1dae2945c3
All checks were successful
Deploy to Production / deploy (push) Successful in 1m31s
feat: client-side password hashing and admin user auto-seeding
- Hash passwords with SHA-256 on frontend before transmission to prevent
  raw password exposure in network traffic and server logs
- Switch login endpoint from OAuth2 form-data to JSON body
- Auto-create admin user on startup from ADMIN_USERNAME/ADMIN_PASSWORD
  env vars, solving login failure after registration was disabled
- Update auth tests to match new SHA-256 + JSON login flow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 22:21:36 +09:00

43 lines
980 B
Python

"""
Application configuration using Pydantic Settings.
"""
from pydantic_settings import BaseSettings
from functools import lru_cache
class Settings(BaseSettings):
# Application
app_name: str = "Galaxis-Po"
debug: bool = False
# Database
database_url: str = "postgresql://galaxy:devpassword@localhost:5432/galaxy_po"
# JWT
jwt_secret: str = "dev-jwt-secret-change-in-production"
jwt_algorithm: str = "HS256"
access_token_expire_minutes: int = 60 * 24 # 24 hours
# CORS
cors_origins: str = "http://localhost:3000"
# Admin user (auto-created on startup if not exists)
admin_username: str = ""
admin_email: str = ""
admin_password: str = ""
# External APIs
kis_app_key: str = ""
kis_app_secret: str = ""
kis_account_no: str = ""
dart_api_key: str = ""
class Config:
env_file = ".env"
case_sensitive = False
@lru_cache
def get_settings() -> Settings:
return Settings()