From 3691c667348a16f9b87533df1d25df0cd3b88852 Mon Sep 17 00:00:00 2001 From: Sietse Snel Date: Wed, 18 Oct 2023 16:38:09 +0200 Subject: [PATCH] YDA-5505: do not accept backslashes in passwords These don't get passed correctly to the external-auth script on the provider, and therefore cause authentication to fail. --- yoda_eus/password_complexity.py | 3 +++ yoda_eus/templates/web/password-requirements.html | 2 +- yoda_eus/tests/test_unit.py | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/yoda_eus/password_complexity.py b/yoda_eus/password_complexity.py index db15905..2ab51b6 100644 --- a/yoda_eus/password_complexity.py +++ b/yoda_eus/password_complexity.py @@ -33,4 +33,7 @@ def check_password_complexity(password: str) -> List[str]: if not (any(c in string.punctuation for c in password)): errors.append("Password needs to contain at least one punctuation character ({})".format(string.punctuation)) + if "\\" in password: + errors.append("Password must not contain backslashes.") + return errors diff --git a/yoda_eus/templates/web/password-requirements.html b/yoda_eus/templates/web/password-requirements.html index aee37c9..96fdfb6 100644 --- a/yoda_eus/templates/web/password-requirements.html +++ b/yoda_eus/templates/web/password-requirements.html @@ -1,7 +1,7 @@

Your password must meet the following requirements: