explicit global scope for remote user settings
This commit is contained in:
parent
7992e6d25f
commit
8b8e9442e5
@ -422,13 +422,9 @@ if AUTO_LOGIN_USERNAME:
|
|||||||
|
|
||||||
|
|
||||||
def _parse_remote_user_settings() -> str:
|
def _parse_remote_user_settings() -> str:
|
||||||
ENABLE_HTTP_REMOTE_USER = __get_boolean("PAPERLESS_ENABLE_HTTP_REMOTE_USER")
|
global MIDDLEWARE, AUTHENTICATION_BACKENDS, REST_FRAMEWORK
|
||||||
header_name = os.getenv(
|
enable = __get_boolean("PAPERLESS_ENABLE_HTTP_REMOTE_USER")
|
||||||
"PAPERLESS_HTTP_REMOTE_USER_HEADER_NAME",
|
if enable:
|
||||||
"HTTP_REMOTE_USER",
|
|
||||||
)
|
|
||||||
|
|
||||||
if ENABLE_HTTP_REMOTE_USER:
|
|
||||||
MIDDLEWARE.append("paperless.auth.HttpRemoteUserMiddleware")
|
MIDDLEWARE.append("paperless.auth.HttpRemoteUserMiddleware")
|
||||||
AUTHENTICATION_BACKENDS.insert(
|
AUTHENTICATION_BACKENDS.insert(
|
||||||
0,
|
0,
|
||||||
@ -439,6 +435,11 @@ def _parse_remote_user_settings() -> str:
|
|||||||
"paperless.auth.PaperlessRemoteUserAuthentication",
|
"paperless.auth.PaperlessRemoteUserAuthentication",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
header_name = os.getenv(
|
||||||
|
"PAPERLESS_HTTP_REMOTE_USER_HEADER_NAME",
|
||||||
|
"HTTP_REMOTE_USER",
|
||||||
|
)
|
||||||
|
|
||||||
return header_name
|
return header_name
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user