feat: add authentication requirement toggle in environment configuration
This commit is contained in:
parent
1b643c8355
commit
10364382eb
2 changed files with 7 additions and 1 deletions
|
|
@ -124,6 +124,9 @@ ALLOW_HTTP_REQUESTS=True
|
||||||
# When set to False errors during data processing will be returned as info but not raised to allow handling of faulty documents
|
# When set to False errors during data processing will be returned as info but not raised to allow handling of faulty documents
|
||||||
RAISE_INCREMENTAL_LOADING_ERRORS=True
|
RAISE_INCREMENTAL_LOADING_ERRORS=True
|
||||||
|
|
||||||
|
# When set to True, the Cognee backend will require authentication for requests to the API.
|
||||||
|
REQUIRE_AUTHENTICATION=False
|
||||||
|
|
||||||
# Set this variable to True to enforce usage of backend access control for Cognee
|
# Set this variable to True to enforce usage of backend access control for Cognee
|
||||||
# Note: This is only currently supported by the following databases:
|
# Note: This is only currently supported by the following databases:
|
||||||
# Relational: SQLite, Postgres
|
# Relational: SQLite, Postgres
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,10 @@ from ..get_fastapi_users import get_fastapi_users
|
||||||
from .get_default_user import get_default_user
|
from .get_default_user import get_default_user
|
||||||
|
|
||||||
# Check environment variable to determine authentication requirement
|
# Check environment variable to determine authentication requirement
|
||||||
REQUIRE_AUTHENTICATION = os.getenv("REQUIRE_AUTHENTICATION", "false").lower() == "true"
|
REQUIRE_AUTHENTICATION = (
|
||||||
|
os.getenv("REQUIRE_AUTHENTICATION", "false").lower() == "true"
|
||||||
|
or os.getenv("ENABLE_BACKEND_ACCESS_CONTROL", "false").lower() == "true"
|
||||||
|
)
|
||||||
|
|
||||||
fastapi_users = get_fastapi_users()
|
fastapi_users = get_fastapi_users()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue