perf: Add retention period for expired user tokens and implement cleanup task

This commit is contained in:
wangruidong
2025-05-29 15:19:30 +08:00
committed by 老广
parent 53a84850dc
commit 3f85c67aee
6 changed files with 267 additions and 194 deletions

View File

@@ -23,6 +23,11 @@ class SecurityPasswordRuleSerializer(serializers.Serializer):
'automatic sent to the user by system within 5 days (daily) before the password expires'
)
)
SECURITY_EXPIRED_TOKEN_RECORD_KEEP_DAYS = serializers.IntegerField(
min_value=1, max_value=99999, required=True,
label=_('User expired tokens record keep days'),
help_text=_("Retention period (in days) for expired user tokens before automatic cleanup.")
)
OLD_PASSWORD_HISTORY_LIMIT_COUNT = serializers.IntegerField(
min_value=0, max_value=99999, required=True,
label=_('Recent password count'),