Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting base url fail with error 400 #5081

Closed
Neurozone opened this issue Oct 23, 2019 · 5 comments
Closed

Setting base url fail with error 400 #5081

Neurozone opened this issue Oct 23, 2019 · 5 comments

Comments

@Neurozone
Copy link

ISSUE TYPE
  • Bug Report
SUMMARY

Whe have an internal dns with a domain like "org.les800"
when i'm trying to set the base url of the tower host with something like "tower.org.les800", it fail with an error 400 and url not valid

ENVIRONMENT
  • AWX version: 8.0.0
  • AWX install method: MrMee rpm
  • Ansible version: 2.8.6
  • Operating System: CentOS 7.7
  • Web Browser: Chrome latest
STEPS TO REPRODUCE

try an url like http://tower.org.les800 in settings/system

EXPECTED RESULTS

url for the base host set

ACTUAL RESULTS

got url with the name of the server instead

ADDITIONAL INFORMATION
@ryanpetrello
Copy link
Contributor

@fosterseth you mind taking a look at this? I'll bet it's similar to the LDAP bug you recently fixed.

@fosterseth
Copy link
Member

fosterseth commented Oct 25, 2019

@ryanpetrello yes it's same issue as the LDAP bug.

We can either make a new TowerURLBaseField class that subclasses URLField, and then feed in a custom regex pattern to the URLValidator to allow numbers in the top level domain. This is how it is done in the case of LDAPServerURIField.

Or more generally we can change some logic in class URLField that adds an allow_number_in_top_level_domain flag and if set to True, will pass the modified regex into the validator. That way any setting of this class can be configured to have numbers in the TLD going forward.

@ryanpetrello
Copy link
Contributor

Or more generally we can change some logic in class URLField that adds an allow_number_in_top_level_domain flag and if set to True, will pass the modified regex into the validator. That way any setting of this class can be configured to have numbers in the TLD going forward.

I think this is probably a better idea going forward, and it probably makes sense to default allow_number_in_top_level_domain to True, given that numbers in TLDs is totally a thing.

@kdelee
Copy link
Member

kdelee commented Jan 13, 2020

connecting ldap stuff:
issue: #3646
PR: #4784

@nixocio nixocio self-assigned this Jan 21, 2020
@nixocio
Copy link
Contributor

nixocio commented Jan 29, 2020

@nixocio nixocio closed this as completed Jan 29, 2020
AlanCoding pushed a commit to AlanCoding/awx that referenced this issue Jun 23, 2021
Allow edit fields to custom credential types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants