mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge pull request #671 from YunoHost/forbidden-chars-for-app-password
[fix] Reject app password if they contains { or }
This commit is contained in:
commit
d058133f8d
2 changed files with 4 additions and 0 deletions
|
@ -381,6 +381,7 @@
|
|||
"pattern_port_or_range": "Must be a valid port number (i.e. 0-65535) or range of ports (e.g. 100:200)",
|
||||
"pattern_positive_number": "Must be a positive number",
|
||||
"pattern_username": "Must be lower-case alphanumeric and underscore characters only",
|
||||
"pattern_password_app": "Sorry, passwords should not contain the following characters: {forbidden_chars}",
|
||||
"port_already_closed": "Port {port:d} is already closed for {ip_version:s} connections",
|
||||
"port_already_opened": "Port {port:d} is already opened for {ip_version:s} connections",
|
||||
"port_available": "Port {port:d} is available",
|
||||
|
|
|
@ -2292,6 +2292,9 @@ def _parse_action_args_in_yunohost_format(args, action_args, auth=None):
|
|||
else:
|
||||
raise YunohostError('app_argument_choice_invalid', name=arg_name, choices='yes, no, y, n, 1, 0')
|
||||
elif arg_type == 'password':
|
||||
forbidden_chars = "{}"
|
||||
if any(char in arg_value for char in forbidden_chars):
|
||||
raise YunohostError('pattern_password_app', forbidden_chars=forbidden_chars)
|
||||
from yunohost.utils.password import assert_password_is_strong_enough
|
||||
assert_password_is_strong_enough('user', arg_value)
|
||||
args_dict[arg_name] = arg_value
|
||||
|
|
Loading…
Add table
Reference in a new issue