-
Notifications
You must be signed in to change notification settings - Fork 572
fix(sso): login with custom startUrl not allowed #6368
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
Conversation
Problem: A user reported that a non-standard start url is technically valid. This is because it can redirect to the underlying valid start url that matches the pattern: https://xxxxxxxx.awsapps.com/start Solution: Allow any URL, but warn users if they are using a non-standard one. We will show a yellow warning message in this case. The red error message is still shown when the input does not match a URL in general. Signed-off-by: nkomonen-amazon <[email protected]>
Signed-off-by: nkomonen-amazon <[email protected]>
@@ -58,3 +58,15 @@ export function toUri(path: string | vscode.Uri): vscode.Uri { | |||
} | |||
return vscode.Uri.file(path) | |||
} | |||
|
|||
export function isValidUrl(string: string): boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is vscode.Uri.parse
useful here? docstring may want to mention why not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would add additional LOC since we'd have to check every part manually. Also there may be nuances with a valid URL that we could miss
Signed-off-by: nkomonen-amazon <[email protected]>
Signed-off-by: nkomonen-amazon <[email protected]>
## Problem: A user reported that a non-standard start url is technically valid. This is because it can redirect to the underlying valid start url that matches the pattern: https://xxxxxxxx.awsapps.com/start ## Solution: Allow any URL, but warn users if they are using a non-standard one. We will show a yellow warning message in this case. The red error message is still shown when the input does not match a URL in general. ## Examples ### Invalid URL <img width="315" alt="Screenshot 2025-01-14 at 4 33 58 PM" src="https://github.com/user-attachments/assets/a5b2cb8a-c4fc-4678-a711-2f3f00bbe084" /> ### Possibly valid since it may redirect to a valid URL <img width="302" alt="Screenshot 2025-01-14 at 4 34 13 PM" src="https://github.com/user-attachments/assets/0690f818-f4ba-4eae-b037-f856f5a2b2a0" /> ### Missing the trailing `/start` <img width="295" alt="Screenshot 2025-01-14 at 4 34 29 PM" src="https://github.com/user-attachments/assets/8bcf3a4b-eba3-4bd8-8c68-24b709ee854d" /> ### URL that also matches expected pattern <img width="286" alt="Screenshot 2025-01-14 at 4 34 35 PM" src="https://github.com/user-attachments/assets/eea2f2cb-6500-469c-9836-96ffc9cb5794" /> --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Signed-off-by: nkomonen-amazon <[email protected]>
## Problem: A user reported that a non-standard start url is technically valid. This is because it can redirect to the underlying valid start url that matches the pattern: https://xxxxxxxx.awsapps.com/start ## Solution: Allow any URL, but warn users if they are using a non-standard one. We will show a yellow warning message in this case. The red error message is still shown when the input does not match a URL in general. ## Examples ### Invalid URL <img width="315" alt="Screenshot 2025-01-14 at 4 33 58 PM" src="https://github.com/user-attachments/assets/a5b2cb8a-c4fc-4678-a711-2f3f00bbe084" /> ### Possibly valid since it may redirect to a valid URL <img width="302" alt="Screenshot 2025-01-14 at 4 34 13 PM" src="https://github.com/user-attachments/assets/0690f818-f4ba-4eae-b037-f856f5a2b2a0" /> ### Missing the trailing `/start` <img width="295" alt="Screenshot 2025-01-14 at 4 34 29 PM" src="https://github.com/user-attachments/assets/8bcf3a4b-eba3-4bd8-8c68-24b709ee854d" /> ### URL that also matches expected pattern <img width="286" alt="Screenshot 2025-01-14 at 4 34 35 PM" src="https://github.com/user-attachments/assets/eea2f2cb-6500-469c-9836-96ffc9cb5794" /> --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Signed-off-by: nkomonen-amazon <[email protected]>
## Problem: A user reported that a non-standard start url is technically valid. This is because it can redirect to the underlying valid start url that matches the pattern: https://xxxxxxxx.awsapps.com/start ## Solution: Allow any URL, but warn users if they are using a non-standard one. We will show a yellow warning message in this case. The red error message is still shown when the input does not match a URL in general. ## Examples ### Invalid URL <img width="315" alt="Screenshot 2025-01-14 at 4 33 58 PM" src="https://github.com/user-attachments/assets/a5b2cb8a-c4fc-4678-a711-2f3f00bbe084" /> ### Possibly valid since it may redirect to a valid URL <img width="302" alt="Screenshot 2025-01-14 at 4 34 13 PM" src="https://github.com/user-attachments/assets/0690f818-f4ba-4eae-b037-f856f5a2b2a0" /> ### Missing the trailing `/start` <img width="295" alt="Screenshot 2025-01-14 at 4 34 29 PM" src="https://github.com/user-attachments/assets/8bcf3a4b-eba3-4bd8-8c68-24b709ee854d" /> ### URL that also matches expected pattern <img width="286" alt="Screenshot 2025-01-14 at 4 34 35 PM" src="https://github.com/user-attachments/assets/eea2f2cb-6500-469c-9836-96ffc9cb5794" /> --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Signed-off-by: nkomonen-amazon <[email protected]>
Problem:
A user reported that a non-standard start url is technically
valid. This is because it can redirect to the underlying valid
start url that matches the pattern: https://xxxxxxxx.awsapps.com/start
#6341
Solution:
Allow any URL, but warn users if they are using a non-standard one.
We will show a yellow warning message in this case.
The red error message is still shown when the input does not match a
URL in general.
Examples
Invalid URL
Possibly valid since it may redirect to a valid URL
Missing the trailing
/start
URL that also matches expected pattern
feature/x
branches will not be squash-merged at release time.