🔒 chore(auth.py): import necessary modules and add password context and OAuth2 password bearer scheme for authentication
🔒 chore(auth.py): add password context using bcrypt scheme and OAuth2 password bearer scheme for authentication
This commit is contained in:
parent
244a967517
commit
b309d8be0e
1 changed files with 5 additions and 0 deletions
|
|
@ -2,6 +2,8 @@ from typing import Optional
|
||||||
import secrets
|
import secrets
|
||||||
|
|
||||||
from pydantic import BaseSettings
|
from pydantic import BaseSettings
|
||||||
|
from passlib.context import CryptContext
|
||||||
|
from fastapi.security import OAuth2PasswordBearer
|
||||||
|
|
||||||
|
|
||||||
class AuthSettings(BaseSettings):
|
class AuthSettings(BaseSettings):
|
||||||
|
|
@ -23,6 +25,9 @@ class AuthSettings(BaseSettings):
|
||||||
FIRST_SUPERUSER: str = "langflow"
|
FIRST_SUPERUSER: str = "langflow"
|
||||||
FIRST_SUPERUSER_PASSWORD: str = "langflow"
|
FIRST_SUPERUSER_PASSWORD: str = "langflow"
|
||||||
|
|
||||||
|
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
|
||||||
|
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="login")
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
validate_assignment = True
|
validate_assignment = True
|
||||||
extra = "ignore"
|
extra = "ignore"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue