Add imports and update settings in auth.py
This commit is contained in:
parent
229210d46e
commit
9483e9d28e
1 changed files with 8 additions and 8 deletions
|
|
@ -1,17 +1,18 @@
|
||||||
|
import secrets
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
import secrets
|
|
||||||
|
from loguru import logger
|
||||||
|
from passlib.context import CryptContext
|
||||||
|
from pydantic import Field, validator
|
||||||
|
from pydantic_settings import BaseSettings
|
||||||
|
|
||||||
from langflow.services.settings.constants import (
|
from langflow.services.settings.constants import (
|
||||||
DEFAULT_SUPERUSER,
|
DEFAULT_SUPERUSER,
|
||||||
DEFAULT_SUPERUSER_PASSWORD,
|
DEFAULT_SUPERUSER_PASSWORD,
|
||||||
)
|
)
|
||||||
from langflow.services.settings.utils import read_secret_from_file, write_secret_to_file
|
from langflow.services.settings.utils import read_secret_from_file, write_secret_to_file
|
||||||
|
|
||||||
from pydantic import Field, validator
|
|
||||||
from pydantic_settings import BaseSettings
|
|
||||||
from passlib.context import CryptContext
|
|
||||||
from loguru import logger
|
|
||||||
|
|
||||||
|
|
||||||
class AuthSettings(BaseSettings):
|
class AuthSettings(BaseSettings):
|
||||||
# Login settings
|
# Login settings
|
||||||
|
|
@ -19,8 +20,7 @@ class AuthSettings(BaseSettings):
|
||||||
SECRET_KEY: str = Field(
|
SECRET_KEY: str = Field(
|
||||||
default="",
|
default="",
|
||||||
description="Secret key for JWT. If not provided, a random one will be generated.",
|
description="Secret key for JWT. If not provided, a random one will be generated.",
|
||||||
env="LANGFLOW_SECRET_KEY",
|
frozen=False,
|
||||||
allow_mutation=False,
|
|
||||||
)
|
)
|
||||||
ALGORITHM: str = "HS256"
|
ALGORITHM: str = "HS256"
|
||||||
ACCESS_TOKEN_EXPIRE_MINUTES: int = 60
|
ACCESS_TOKEN_EXPIRE_MINUTES: int = 60
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue