feat: add WEBUI_AUTH_TRUSTED_EMAIL_HEADER for authenticating users by a trusted header

This is very yolo code, use at your own risk
This commit is contained in:
Jun Siang Cheah 2024-03-26 21:30:53 +00:00 committed by Jun Siang Cheah
parent 7d45d2762f
commit 29f13f34d3
8 changed files with 58 additions and 13 deletions

View file

@ -20,6 +20,7 @@ from config import (
ENABLE_SIGNUP,
USER_PERMISSIONS,
WEBHOOK_URL,
WEBUI_AUTH_TRUSTED_EMAIL_HEADER,
)
app = FastAPI()
@ -34,7 +35,7 @@ app.state.DEFAULT_PROMPT_SUGGESTIONS = DEFAULT_PROMPT_SUGGESTIONS
app.state.DEFAULT_USER_ROLE = DEFAULT_USER_ROLE
app.state.USER_PERMISSIONS = USER_PERMISSIONS
app.state.WEBHOOK_URL = WEBHOOK_URL
app.state.AUTH_TRUSTED_EMAIL_HEADER = WEBUI_AUTH_TRUSTED_EMAIL_HEADER
app.add_middleware(
CORSMiddleware,