Julia Ostheimer commited on
Commit
285d1cd
·
1 Parent(s): e4534d9

Add easy auth implementation with shared credentials via Secrets in HF Space

Browse files
Files changed (2) hide show
  1. app.py +9 -1
  2. config.py +2 -0
app.py CHANGED
@@ -148,4 +148,12 @@ with gr.Blocks() as demo:
148
  source_history.change(prettify_source_history, source_history, prettified_source_history_md)
149
 
150
  if __name__ == "__main__":
151
- demo.launch(share=False, server_name="0.0.0.0")
 
 
 
 
 
 
 
 
 
148
  source_history.change(prettify_source_history, source_history, prettified_source_history_md)
149
 
150
  if __name__ == "__main__":
151
+ demo.launch(
152
+ share=False,
153
+ server_name="0.0.0.0",
154
+ auth=(
155
+ app_settings.test_user_name,
156
+ app_settings.test_user_password
157
+ )
158
+ )
159
+
config.py CHANGED
@@ -42,6 +42,8 @@ class AppSettings(Settings):
42
  langfuse_public_api_key: str
43
  langfuse_secret_api_key: str
44
  langfuse_host: str
 
 
45
 
46
  model_config = SettingsConfigDict(
47
  pyproject_toml_table_header=("tool", "app_config"),
 
42
  langfuse_public_api_key: str
43
  langfuse_secret_api_key: str
44
  langfuse_host: str
45
+ test_user_name: str
46
+ test_user_password: str
47
 
48
  model_config = SettingsConfigDict(
49
  pyproject_toml_table_header=("tool", "app_config"),