mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-04 08:55:40 +00:00
perf: 优化用户 access key 的使用和创建 (#11776)
* perf: 优化用户 access key 的使用和创建 * perf: 优化 access key api --------- Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
@@ -59,7 +59,7 @@ class WithBootstrapToken(permissions.BasePermission):
|
||||
class UserConfirmation(permissions.BasePermission):
|
||||
ttl = 60 * 5
|
||||
min_level = 1
|
||||
confirm_type = ConfirmType.ReLogin
|
||||
confirm_type = ConfirmType.RELOGIN
|
||||
|
||||
def has_permission(self, request, view):
|
||||
if not settings.SECURITY_VIEW_AUTH_NEED_MFA:
|
||||
@@ -82,7 +82,7 @@ class UserConfirmation(permissions.BasePermission):
|
||||
return ttl
|
||||
|
||||
@classmethod
|
||||
def require(cls, confirm_type=ConfirmType.ReLogin, ttl=60 * 5):
|
||||
def require(cls, confirm_type=ConfirmType.RELOGIN, ttl=60 * 5):
|
||||
min_level = ConfirmType.values.index(confirm_type) + 1
|
||||
name = 'UserConfirmationLevel{}TTL{}'.format(min_level, ttl)
|
||||
return type(name, (cls,), {'min_level': min_level, 'ttl': ttl, 'confirm_type': confirm_type})
|
||||
|
Reference in New Issue
Block a user