Desktop: Windows portable: Fix keychain-backed storage incorrectly enabled #10942
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request reverts a behavior change from #10535 --- previously, keychain support was disabled in the Windows portable application. After #10535, Electron safeStorage is used to encrypt secure settings in the Windows portable app before saving them in Joplin's database. This may break the portability of Joplin Portable.
Notes:
safeStorage
for keychain support #10535 secure settings are still stored in Joplin's database (not the system keychain). Desktop: Use ElectronsafeStorage
for keychain support #10535 encrypted these settings.safeStorage
-encrypted settings in the portable app.safeStorage
can be used.Note
The new portable app behavior introduced by #10535 may be desired. Consider closing this pull request without merging.
Testing plan
This pull request includes automated tests that:
KeychainService
, if available.KeychainService
) whenKeychainService
is read-only.KeychainService
is read-only, verifies that passwords saved using the default setting storage are preferred to those stored in the keychain.Manual testing (in progress):
Setting.value('keychain.supported')
and verify that the output is 1.testing
and enable password-protected backups.testing
must be set in both the password and confirm inputs.JoplinPortable.exe
with the builtJoplinPortable.exe
.JoplinPortable.exe
.testing
(in settings, using dev tools).test
and save.test
must be set in both the password and confirm inputs.test
.No
.Yes
.Setting.setValue('keychain.supported', -1)
.Yes
.tried to set and get password. Result was: mytest
.