mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-22 15:56:14 +00:00
feat(backend): enable disabling of basic authentication (#13169)
* !feat(backend): disable basic authentication by default * align PR * add PR number * fix schema creation/discovery * mask basic auth * fix error code * reduce diff * adjust changelog message * fix test (needs basic auth which is now off by default) * switch to default on; retain warning * update test for new default * fix assertation
This commit is contained in:
1 parent
be9639266d
commit
a8a867400d
15 files changed
+90
-5
No files matched your search
@@ -127,6 +127,7 @@ export default defineConfig({
|
||||
INVENTREE_SITE_URL: 'http://localhost:8000',
|
||||
INVENTREE_FRONTEND_API_HOST: 'http://localhost:8000',
|
||||
INVENTREE_CORS_ORIGIN_ALLOW_ALL: 'True',
|
||||
INVENTREE_BASIC_AUTH_ENABLED: 'True',
|
||||
INVENTREE_COOKIE_SAMESITE: 'False',
|
||||
INVENTREE_LOGIN_ATTEMPTS: '3',
|
||||
INVENTREE_PLUGINS_MANDATORY: 'samplelocate',
|
||||
|
||||
@@ -156,6 +156,13 @@ export function getAlerts(
|
||||
code: 'INVE-W16',
|
||||
message: t`CORS is set to allow all origins.`,
|
||||
condition: server?.system_state?.cors_allow_all || false
|
||||
},
|
||||
{
|
||||
key: 'basic_auth',
|
||||
title: t`Basic Authentication`,
|
||||
code: 'INVE-W18',
|
||||
message: t`Basic (username:password) authentication is enabled for the API.`,
|
||||
condition: server?.system_state?.basic_auth_enabled || false
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ export interface ServerAPIProps {
|
||||
};
|
||||
system_state: {
|
||||
cors_allow_all: null | boolean;
|
||||
basic_auth_enabled: null | boolean;
|
||||
} | null;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user