mirror of https://github.com/jumpserver/jumpserver
commit
06275a09ac
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue