perf: 优化设置布局

This commit is contained in:
ibuler
2023-08-14 19:40:21 +08:00
parent e2de744398
commit 8e0c04c84c
8 changed files with 220 additions and 182 deletions

View File

@@ -99,24 +99,31 @@ class SecurityAuthSerializer(serializers.Serializer):
ONLY_ALLOW_EXIST_USER_AUTH = serializers.BooleanField(
required=False, default=False, label=_("Only exist user login"),
help_text=_(
"If enabled, non-existent users will not be allowed to log in; if disabled, users of other authentication methods except local authentication methods are allowed to log in and automatically create users (if the user does not exist)")
"If enabled, non-existent users will not be allowed to log in; if disabled, "
"users of other authentication methods except local authentication methods are allowed "
"to log in and automatically create users (if the user does not exist)"
)
)
ONLY_ALLOW_AUTH_FROM_SOURCE = serializers.BooleanField(
required=False, default=False, label=_("Only from source login"),
help_text=_(
"If it is enabled, the user will only authenticate to the source when logging in; if it is disabled, the user will authenticate all the enabled authentication methods in a certain order when logging in, and as long as one of the authentication methods is successful, they can log in directly")
"If it is enabled, the user will only authenticate to the source when logging in; "
"if it is disabled, the user will authenticate all the enabled authentication methods "
"in a certain order when logging in, and as long as one of the authentication methods is successful, "
"they can log in directly"
)
)
SECURITY_MFA_VERIFY_TTL = serializers.IntegerField(
min_value=5, max_value=60 * 60 * 10,
label=_("MFA verify TTL (secend)"),
label=_("MFA verify TTL"),
help_text=_(
"The verification MFA takes effect only when you view the account password"
"Unit: second, The verification MFA takes effect only when you view the account password"
)
)
VERIFY_CODE_TTL = serializers.IntegerField(
min_value=5, max_value=60 * 60 * 10,
label=_("Verify code TTL"),
help_text=_("Unit: second, reset password and send SMS code expiration time")
label=_("Verify code TTL (second)"),
help_text=_("Reset password and send SMS code expiration time")
)
SECURITY_LOGIN_CHALLENGE_ENABLED = serializers.BooleanField(
required=False, default=False,
@@ -207,3 +214,10 @@ class SecuritySettingSerializer(SecurityPasswordRuleSerializer, SecurityAuthSeri
'If the account is logged in from a common login city, the system sends a remote login reminder'
)
)
OTP_ISSUER_NAME = serializers.CharField(
required=False, max_length=16, label=_('OTP issuer name'),
)
OTP_VALID_WINDOW = serializers.IntegerField(
min_value=1, max_value=10,
label=_("OTP valid window")
)