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

Report error if tenant registration contains an invalid git url #179

Merged
merged 2 commits into from
Apr 25, 2022

Conversation

bastjan
Copy link
Contributor

@bastjan bastjan commented Apr 25, 2022

Reports errors if the git repo url is invalid on tenant creation.

❯ http localhost:8080/tenants Authorization:"Bearer ..." gitRepo:='{"url":"http://git:test"}' displayName="Syn Corp"
HTTP/1.1 400 Bad Request
{
    "reason": "failed to create git repo template: failed to parse git repo URL: parse \"http://git:test\": invalid port \":test\" after host"
}

❯ http localhost:8080/tenants Authorization:"Bearer ..." gitRepo:='{"url":"http://git/test"}' displayName="Syn Corp"
HTTP/1.1 400 Bad Request
{
    "reason": "failed to create git repo template: failed to parse git repo URL, expected 2+ elements in '/test'"
}

Checklist

  • Keep pull requests small so they can be easily reviewed.
  • Update the documentation.
  • Categorize the PR by setting a good title and adding one of the labels:
    bug, enhancement, documentation, change, breaking, dependency
    as they show up in the changelog

@bastjan bastjan added the bug Something isn't working label Apr 25, 2022
@bastjan bastjan requested review from glrf and simu April 25, 2022 07:27
@bastjan bastjan changed the title Report error if tenant registration consists of an invalid url Report error if tenant registration contains an invalid git url Apr 25, 2022
pkg/api/utils.go Outdated Show resolved Hide resolved
Co-authored-by: Simon Gerber <[email protected]>
@bastjan bastjan merged commit 51c1261 into master Apr 25, 2022
@bastjan bastjan deleted the report-error-invalid-url branch April 25, 2022 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Throw an error for tenant registration requests with invalid GitRepo URL
2 participants