Normalize cloud login stack URLs#5904
Conversation
|
|
1 similar comment
|
|
|
Hi, @cyphercodes! Thanks for the contribution. Could you please sign the CLA? Without that, we cannot move forward and get your changes merged 🙇🏻 |
| name: "full https URL with multiple trailing slashes", | ||
| input: "https://my-team.grafana.net///", | ||
| expected: "https://my-team.grafana.net", |
There was a problem hiding this comment.
nit; I guess here it could also make sense to throw an error, considering it invalid. In other words, perhaps we should trim only up to one slash. But I have no strong opinion, and as I cannot see any downside of this approach, lgtm!
Any thoughts? @codebien
|
Hi @cyphercodes without you signing the CLA we do not have any way to merge this. Which also makes reviewing it not really useful. Sorry for the inconvience. If it isn't working for some reason you might have to retry as the cla assistant isn't very stable some days. Please do write if you are having problems so we do at least know there is a chance this will be signed. |
|
In absence of response and action from you @cyphercodes I took the liberty to create a superseeding PR, as I would really like to see this merged: #6087. I made sure to mention you and this PR in the description and commit to give credit where it is due 🙇🏻 |
What?
Normalize
k6 cloud login --stackstack inputs by removing trailing/characters before validating them with Grafana Cloud. This keeps copied stack URLs likehttps://my-team.grafana.net/equivalent tohttps://my-team.grafana.net.Added focused unit coverage for stack URL normalization and command coverage for login with a trailing-slash stack URL.
Why?
A trailing slash was sent to the Cloud auth API as part of
X-Stack-Url, which could make an otherwise valid stack fail authentication as not found.Checklist
make check) and all pass. (Rango test ./internal/cmd/... -count=1.)Checklist: Documentation (only for k6 maintainers and if relevant)
Not applicable; this is a CLI bug fix.
Related PR(s)/Issue(s)
Fixes #5894