From b309d8be0ed074ef5e6e50fb8374555199e2ecd6 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 21 Aug 2023 16:34:23 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=92=20chore(auth.py):=20import=20neces?= =?UTF-8?q?sary=20modules=20and=20add=20password=20context=20and=20OAuth2?= =?UTF-8?q?=20password=20bearer=20scheme=20for=20authentication=20?= =?UTF-8?q?=F0=9F=94=92=20chore(auth.py):=20add=20password=20context=20usi?= =?UTF-8?q?ng=20bcrypt=20scheme=20and=20OAuth2=20password=20bearer=20schem?= =?UTF-8?q?e=20for=20authentication?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/services/settings/auth.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/backend/langflow/services/settings/auth.py b/src/backend/langflow/services/settings/auth.py index d144b4347..a00ebf31e 100644 --- a/src/backend/langflow/services/settings/auth.py +++ b/src/backend/langflow/services/settings/auth.py @@ -2,6 +2,8 @@ from typing import Optional import secrets from pydantic import BaseSettings +from passlib.context import CryptContext +from fastapi.security import OAuth2PasswordBearer class AuthSettings(BaseSettings): @@ -23,6 +25,9 @@ class AuthSettings(BaseSettings): FIRST_SUPERUSER: str = "langflow" FIRST_SUPERUSER_PASSWORD: str = "langflow" + pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto") + oauth2_scheme = OAuth2PasswordBearer(tokenUrl="login") + class Config: validate_assignment = True extra = "ignore"