You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot save LDAP settings if Server URI ends with custom domain(i.e. not ending with com, net, org, etc) #3646
one workaround would be to replace any given url top level domain portion with something we know works, e.g. replace
ldap://servername.cotoso.coto.so3:389
with
ldap://servername.cotoso.coto.com:389
and sending that into the run_validations() method. That way it checks the validity of the rest of the url and url structure without getting hung up on the top level domain
another option is to write a custom regex and send that into the validator
or we can simply disallow non-conventional urls and give the user a more detailed error message instead of the generic 400
or, we can remove this particular URLValidator altogether so the check never occurs.
Activity
ryanpetrello commentedon May 31, 2019
I'm able to reproduce this:
fosterseth commentedon Sep 16, 2019
the error occurs if a number is present anywhere in the top-level domain portion of the url, e.g. .so3, s3o, 3so, etc.
the full url is validated using the built-in django URLValidator, which checks against a pre-defined reg expression to make sure the string looks like a valid url
(https://docs.djangoproject.com/en/2.2/ref/validators/#urlvalidator)
one workaround would be to replace any given url top level domain portion with something we know works, e.g. replace
ldap://servername.cotoso.coto.so3:389
with
ldap://servername.cotoso.coto.com:389
and sending that into the run_validations() method. That way it checks the validity of the rest of the url and url structure without getting hung up on the top level domain
another option is to write a custom regex and send that into the validator
or we can simply disallow non-conventional urls and give the user a more detailed error message instead of the generic 400
or, we can remove this particular URLValidator altogether so the check never occurs.
fosterseth commentedon Sep 16, 2019
here is the regex is checks against by default https://github.com/django/django/blob/55b68de643b5c2d5f0a8ea7587ab3b2966021ccc/django/core/validators.py#L89
Modified class LPADServerURIField in awx/sso/fields.py to contain a c…
Fix LDAPServerFieldURI number in domain
Fix LDAPServerURIField number in domain
Fix LDAPServerURIField number in domain
kdelee commentedon Sep 20, 2019
Tested out with a variety of different URIs, I'm happy with the unit test coverage that was added. Thanks!