mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-23 16:26:17 +00:00
Display basic auth warning only for web server process (#13251)
Reduces logs for other system calls
This commit is contained in:
1 parent
16309370ba
commit
a0ec8e4c71
1 file changed
+3
-2
@@ -32,7 +32,7 @@ from InvenTree.config import (
|
|||||||
get_oidc_private_key,
|
get_oidc_private_key,
|
||||||
get_setting,
|
get_setting,
|
||||||
)
|
)
|
||||||
from InvenTree.ready import isInMainThread, isRunningBackup
|
from InvenTree.ready import isInMainThread, isInServerThread, isRunningBackup
|
||||||
from InvenTree.sentry import default_sentry_dsn, init_sentry
|
from InvenTree.sentry import default_sentry_dsn, init_sentry
|
||||||
from InvenTree.tracing import ensure_otel_middleware
|
from InvenTree.tracing import ensure_otel_middleware
|
||||||
from InvenTree.validators import invalid_site_url_hint
|
from InvenTree.validators import invalid_site_url_hint
|
||||||
@@ -597,7 +597,8 @@ TEMPLATES = [
|
|||||||
BASIC_AUTH_ENABLED = get_boolean_setting(
|
BASIC_AUTH_ENABLED = get_boolean_setting(
|
||||||
'INVENTREE_BASIC_AUTH_ENABLED', 'basic_auth_enabled', True
|
'INVENTREE_BASIC_AUTH_ENABLED', 'basic_auth_enabled', True
|
||||||
)
|
)
|
||||||
if BASIC_AUTH_ENABLED:
|
|
||||||
|
if BASIC_AUTH_ENABLED and isInServerThread():
|
||||||
logger.warning(
|
logger.warning(
|
||||||
'INVE-W18: Basic (username:password) authentication is enabled for the API - this is not recommended'
|
'INVE-W18: Basic (username:password) authentication is enabled for the API - this is not recommended'
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user