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

Disallow empty string rootURL #23

Open
petemoore opened this issue Jan 7, 2019 · 0 comments
Open

Disallow empty string rootURL #23

petemoore opened this issue Jan 7, 2019 · 0 comments

Comments

@petemoore
Copy link
Member

petemoore commented Jan 7, 2019

For functions that take a root URL (which is possibly all of them), we should throw an exception / panic / do-language-appropriate-thing if the empty string is passed. This can be a common failure case, because if e.g. TASKCLUSTER_ROOT_URL environment variable isn't set for some program that requires it, requests could reach taskcluster-lib-urls with the empty string ("") for rootURL. This is always invalid, and it is easy to check for, so we should handle it upfront, to avoid unexpected downstream behaviour. This has already hit our systems, e.g. with invalid references being generated, such as the following from https://references.taskcluster.net/queue/v1/api.json:

{
  "$schema": "/schemas/common/api-reference-v0.json#",
  "title": "Queue API Documentation",
  ....
}

Here we see the value returned by the apiReferenceSchema method must have been generated using an empty rootUrl, since the value of property $schema does not include the root URL (it should have been "$schema": "https://schemas.taskcluster.net/common/api-reference-v0.json").

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

No branches or pull requests

1 participant