-
-
Notifications
You must be signed in to change notification settings - Fork 652
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
add validation of update mirror urls #17310
base: master
Are you sure you want to change the base?
add validation of update mirror urls #17310
Conversation
…unction (nvaccess#17205) Moved the logic for parsing update check responses into a new function `parseUpdateCheckResponse`.
Co-authored-by: Sean Budd <[email protected]>
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.
Thanks @christopherpross. A couple of minor adjustments, plus I think you may have forgotten to push the schema validation.
Co-authored-by: Sascha Cowley <[email protected]>
Hi @christopherpross - just confirming you've seen Sascha's review and intend to still work on this? |
@seanbudd and @SaschaCowley sorry for the delay, my real life comes in the way. I am so sorry. If you have a deathline for this fix, someone can, if they want take this and fix the remaining missing code. I has forgotten something to push and deleted my local repo. So in the next few days I will try to get into this. But I understand fully if you have a deathline and you have to fix this issue fast. Sorry for the inconventience. |
…nd the updateCheck function. nvaccess#17205
@SaschaCowley and @seanbudd |
See test results for failed build of commit b58d91a109 |
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.
Thanks @christopherpross. A few suggestions to improve the quality of the update check code while you're here. Please also update the copyright headers of the files you have touched to reflect that they have been modified in 2025, and add yourself to the list of copyright holders, if you like
See test results for failed build of commit 8a7529d07e |
Co-authored-by: Sascha Cowley <[email protected]>
…s#17205 Introduced the UpdateInfo dataclass to replace the dictionary used for update metadata. This improves type safety, readability, and maintainability by providing a structured and self-documenting representation of update information.
38a684f
to
0a5a8e8
Compare
@SaschaCowley |
Link to issue number:
#17205
Summary of the issue:
Users could configure an invalid update mirror URL, which would only be discovered when attempting to check for updates. This PR implements a validation mechanism that ensures the specified update mirror is valid before allowing it to be set in the settings.
Description of user facing changes
A new validation process has been added when setting an update mirror URL in NVDA's settings. Users will now receive feedback if the URL they provide is not a valid update mirror. The "Test" button in the settings will now ensure that the mirror responds with the expected format, preventing invalid configurations.
Description of development approach
parseUpdateCheckResponse
.version
launcherUrl
apiVersion
_isResponseUpdateMirrorValid
insettingsDialogs.py
, which callsparseUpdateCheckResponse
to validate the mirror's response._isResponseUpdateMirrorValid
as theresponseValidator
in the_SetURLDialog
for update mirrors.Testing strategy:
Known issues with pull request:
No known issues.
Code Review Checklist:
@coderabbitai summary