vectorplasticity commited on
Commit
872828f
·
verified ·
1 Parent(s): bda3756

Add authentication settings (APP_PASSWORD, SESSION_SECRET_KEY) to config

Browse files
Files changed (1) hide show
  1. app/config.py +10 -0
app/config.py CHANGED
@@ -93,6 +93,16 @@ class Settings(BaseSettings):
93
  WANDB_API_KEY: Optional[str] = None
94
  WANDB_PROJECT: str = "universal-model-trainer"
95
 
 
 
 
 
 
 
 
 
 
 
96
  # Security
97
  API_KEY_HEADER: str = "X-API-Key"
98
  ENABLE_AUTH: bool = False
 
93
  WANDB_API_KEY: Optional[str] = None
94
  WANDB_PROJECT: str = "universal-model-trainer"
95
 
96
+ # Authentication (set via HF Space secrets)
97
+ APP_PASSWORD: str = "" # Set via APP_PASSWORD env var / HF secret
98
+ SESSION_SECRET_KEY: str = "change-this-in-production-use-random-32-chars"
99
+ SESSION_EXPIRE_HOURS: int = 24
100
+
101
+ @property
102
+ def is_auth_configured(self) -> bool:
103
+ """Check if authentication is configured"""
104
+ return bool(self.APP_PASSWORD)
105
+
106
  # Security
107
  API_KEY_HEADER: str = "X-API-Key"
108
  ENABLE_AUTH: bool = False