mirror of https://github.com/jumpserver/jumpserver
perf: Remove username hint
parent
ec20a4fd02
commit
bbd3b32aa1
|
@ -565,6 +565,7 @@ class Config(dict):
|
||||||
'TERMINAL_OMNIDB_ENABLED': True,
|
'TERMINAL_OMNIDB_ENABLED': True,
|
||||||
|
|
||||||
# 安全配置
|
# 安全配置
|
||||||
|
'SAFE_MODE': False,
|
||||||
'SECURITY_MFA_AUTH': 0, # 0 不开启 1 全局开启 2 管理员开启
|
'SECURITY_MFA_AUTH': 0, # 0 不开启 1 全局开启 2 管理员开启
|
||||||
'SECURITY_MFA_AUTH_ENABLED_FOR_THIRD_PARTY': True,
|
'SECURITY_MFA_AUTH_ENABLED_FOR_THIRD_PARTY': True,
|
||||||
'SECURITY_MFA_BY_EMAIL': False,
|
'SECURITY_MFA_BY_EMAIL': False,
|
||||||
|
|
|
@ -32,6 +32,7 @@ TERMINAL_REPLAY_STORAGE = CONFIG.TERMINAL_REPLAY_STORAGE
|
||||||
FTP_FILE_MAX_STORE = CONFIG.FTP_FILE_MAX_STORE
|
FTP_FILE_MAX_STORE = CONFIG.FTP_FILE_MAX_STORE
|
||||||
|
|
||||||
# Security settings
|
# Security settings
|
||||||
|
SAFE_MODE = CONFIG.SAFE_MODE
|
||||||
SECURITY_MFA_AUTH = CONFIG.SECURITY_MFA_AUTH
|
SECURITY_MFA_AUTH = CONFIG.SECURITY_MFA_AUTH
|
||||||
SECURITY_MFA_AUTH_ENABLED_FOR_THIRD_PARTY = CONFIG.SECURITY_MFA_AUTH_ENABLED_FOR_THIRD_PARTY
|
SECURITY_MFA_AUTH_ENABLED_FOR_THIRD_PARTY = CONFIG.SECURITY_MFA_AUTH_ENABLED_FOR_THIRD_PARTY
|
||||||
SECURITY_MFA_BY_EMAIL = CONFIG.SECURITY_MFA_BY_EMAIL
|
SECURITY_MFA_BY_EMAIL = CONFIG.SECURITY_MFA_BY_EMAIL
|
||||||
|
|
|
@ -294,6 +294,8 @@ class UsernameHintsAPI(APIView):
|
||||||
permission_classes = [IsValidUser]
|
permission_classes = [IsValidUser]
|
||||||
|
|
||||||
def post(self, request, **kwargs):
|
def post(self, request, **kwargs):
|
||||||
|
if settings.SAFE_MODE:
|
||||||
|
return Response(data=[])
|
||||||
node_ids = request.data.get('nodes', [])
|
node_ids = request.data.get('nodes', [])
|
||||||
asset_ids = request.data.get('assets', [])
|
asset_ids = request.data.get('assets', [])
|
||||||
query = request.data.get('query', None)
|
query = request.data.get('query', None)
|
||||||
|
|
Loading…
Reference in New Issue