1
0
mirror of https://github.com/quay/quay.git synced 2025-11-19 10:22:20 +03:00

ldap: Don't convert dashes to underscores in usernames (PROJQUAY-5253) (#1808)

* ldap: Don't convert dashes to underscores in usernames (PROJQUAY-5253)
When `FEATURE_USER_CONFIRMATION` is set to true and an LDAP username that has dashes inside is used, Quay will automatically change dashes to underscores. This breaks `LDAP_RESTRICTED_USER_FILTER`  since namespaces in Quay do not have to be the same as LDAP namespaces.
The change can only impact ancient Docker versions prior to version 1.5 where support for dashes in namespaces has been introduced.

* Fix validation test
This commit is contained in:
Ivan Bazulic
2023-03-27 14:54:34 -04:00
committed by GitHub
parent 2e5f25726a
commit b2a5b3abb7
2 changed files with 2 additions and 2 deletions

View File

@@ -18,7 +18,7 @@ VALID_LABEL_KEY_REGEX = r"^[a-z0-9](([a-z0-9]|[-.](?![.-]))*[a-z0-9])?$"
VALID_USERNAME_REGEX = r"^([a-z0-9]+(?:[._-][a-z0-9]+)*)$"
VALID_SERVICE_KEY_NAME_REGEX = r"^[\s a-zA-Z0-9\-_:/]*$"
INVALID_USERNAME_CHARACTERS = r"[^a-z0-9_]"
INVALID_USERNAME_CHARACTERS = r"[^a-z0-9_-]"
def validate_label_key(label_key):