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

base_url validation doesn't allow valid TLDs #72

Closed
simontabor opened this issue Jan 4, 2024 · 2 comments · Fixed by #77
Closed

base_url validation doesn't allow valid TLDs #72

simontabor opened this issue Jan 4, 2024 · 2 comments · Fixed by #77
Assignees

Comments

@simontabor
Copy link

https://github.com/tdabasinskas/terraform-provider-backstage/blob/main/backstage/provider.go#L61

.engineer is a valid TLD and the regex fails, preventing use of the plugin.

I don't think validating URLs is terribly useful for this provider, especially not using regex - an invalid URL can simply be allowed to result in errors further down the line (connection failure)

Reproduce

provider "backstage" {
  base_url = "https://my-backstage-instance.engineer"
}
│ Error: Invalid Attribute Value Match
│
│   with provider["registry.terraform.io/tdabasinskas/backstage"],
│   on main.tf line 51, in provider "backstage":
│   51:   base_url = "https://my-backstage-instance.engineer"
│
│ Attribute base_url must be a valid URL, got: https://my-backstage-instance.engineer
@simontabor
Copy link
Author

Using BACKSTAGE_BASE_URL bypasses the validation and allows it to proceed, which is a separate issue (it should be validated in the same way), but this allows me to proceed for now.

@tdabasinskas
Copy link
Owner

Sounds legit. Thanks for reporting these - will try to address then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants