perf: 密码中支持特殊字符比如"

pull/12041/head
feng 2023-11-03 15:20:19 +08:00
parent eee119eba1
commit 7b86938b58
1 changed files with 8 additions and 8 deletions

View File

@ -49,15 +49,15 @@ def validate_password_for_ansible(password):
# validate password contains left double curly bracket
# check password not contains `{{`
# Ansible 推送的时候不支持
if '{{' in password:
raise serializers.ValidationError(_('Password can not contains `{{` '))
if '{%' in password:
raise serializers.ValidationError(_('Password can not contains `{%` '))
if '{{' in password or '}}' in password:
raise serializers.ValidationError(_('Password can not contains `{{` or `}}`'))
if '{%' in password or '%}' in password:
raise serializers.ValidationError(_('Password can not contains `{%` or `%}`'))
# Ansible Windows 推送的时候不支持
if "'" in password:
raise serializers.ValidationError(_("Password can not contains `'` "))
if '"' in password:
raise serializers.ValidationError(_('Password can not contains `"` '))
# if "'" in password:
# raise serializers.ValidationError(_("Password can not contains `'` "))
# if '"' in password:
# raise serializers.ValidationError(_('Password can not contains `"` '))
def validate_ssh_key(ssh_key, passphrase=None):