Add safeUriSchemes setting#20207
Conversation
5daba9c to
6bddc38
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
DHowett
left a comment
There was a problem hiding this comment.
Thank you so much. This is practically perfect.
I'm literally about to cut the new 1.24 Stable build which has the warning dialog, and I am going to take this in as well.
|
|
||
| return true; | ||
| } | ||
| if (const auto& safeSchemes = _settings.GlobalSettings().SafeUriSchemes()) |
There was a problem hiding this comment.
alright, so hear me out. should users be allowed to put file in the list to bypass all checks on file URIs?
There was a problem hiding this comment.
if so, we can easily throw this ten lines up
There was a problem hiding this comment.
I wondered about the same thing but thought this would be safer and you'd get fewer of those sCaRy hyperlinks reports. 😅
TBH I also thought about adding a * scheme to just allow everything, but wasn't sure if you'd accept it.
Either way, you decide 🙂
There was a problem hiding this comment.
eh, let's stick with this one for now. If users come asking for more, this is a good framework on which we can build more for them. Thanks so much!
|
I don't think the failing test is related to the PR. |
This adds a `safeUriSchemes` global setting which lets you define
hyperlink URI schemes which the user considers safe. No confirmation
dialog will be shown when trying to open hyperlinks which use these
schemes.
- This solves the root issue, but doesn't introduce any UI or
documentation changes. I wanted to validate the approach and
implementation with you first.
- I closely followed the code handling the `disabledProfileSources`
setting, which is of the same type.
- This feature does not change the behavior of `http`, `https` and
`file` schemes.
Validation
I ran the dev terminal, and tested the behavior by clicking on `vscode`
hyperlinks generated by ripgrep with various `safeUriSchemes` settings:
- Setting not defined - asks for confirmation
- `["vscode"]` - does not ask for confirmation
- `["foo", "vscode"]` - does not ask for confirmation
- `["foo"]` - asks for confirmation
- `null` - asks for confirmation
- `[]` - asks for confirmation
- `[""]` - asks for confirmation
- `[{"foo": "bar"}]` - fails to deserialize (as expected)
A few uinit tests failed, but they seem unrelated to these changes:
- `KeyBindingTests` in `UnitTests_SettingsModel`, probably because I use
an AZERTY keyboard.
- A few `Conhost` tests, but I didn't touch this part
Refs #20065
Closes #20191
(cherry picked from commit fb71a04)
Service-Card-Id: PVTI_lADOAF3p4s4BBcTlzgshlaM
Service-Version: 1.24
This adds a `safeUriSchemes` global setting which lets you define
hyperlink URI schemes which the user considers safe. No confirmation
dialog will be shown when trying to open hyperlinks which use these
schemes.
- This solves the root issue, but doesn't introduce any UI or
documentation changes. I wanted to validate the approach and
implementation with you first.
- I closely followed the code handling the `disabledProfileSources`
setting, which is of the same type.
- This feature does not change the behavior of `http`, `https` and
`file` schemes.
Validation
I ran the dev terminal, and tested the behavior by clicking on `vscode`
hyperlinks generated by ripgrep with various `safeUriSchemes` settings:
- Setting not defined - asks for confirmation
- `["vscode"]` - does not ask for confirmation
- `["foo", "vscode"]` - does not ask for confirmation
- `["foo"]` - asks for confirmation
- `null` - asks for confirmation
- `[]` - asks for confirmation
- `[""]` - asks for confirmation
- `[{"foo": "bar"}]` - fails to deserialize (as expected)
A few uinit tests failed, but they seem unrelated to these changes:
- `KeyBindingTests` in `UnitTests_SettingsModel`, probably because I use
an AZERTY keyboard.
- A few `Conhost` tests, but I didn't touch this part
Refs #20065
Closes #20191
(cherry picked from commit fb71a04)
Service-Card-Id: PVTI_lADOAF3p4s4BQX0-zgshlaI
Service-Version: 1.25
This adds a
safeUriSchemesglobal setting which lets you definehyperlink URI schemes which the user considers safe. No confirmation
dialog will be shown when trying to open hyperlinks which use these
schemes.
documentation changes. I wanted to validate the approach and
implementation with you first.
disabledProfileSourcessetting, which is of the same type.
http,httpsandfileschemes.Validation
I ran the dev terminal, and tested the behavior by clicking on
vscodehyperlinks generated by ripgrep with various
safeUriSchemessettings:["vscode"]- does not ask for confirmation["foo", "vscode"]- does not ask for confirmation["foo"]- asks for confirmationnull- asks for confirmation[]- asks for confirmation[""]- asks for confirmation[{"foo": "bar"}]- fails to deserialize (as expected)A few uinit tests failed, but they seem unrelated to these changes:
KeyBindingTestsinUnitTests_SettingsModel, probably because I usean AZERTY keyboard.
Conhosttests, but I didn't touch this partRefs #20065
Closes #20191