Repository navigation
fix(storage): an unreadable keyring is an error, not an empty password (#1303) - #1320
Merged
Merged
Conversation
#1303) The secure-store reads swallowed every failure and returned nulls, so a locked keyring or a missing secret service was reported as Authentication failed, and a following edit could save the missing password as empty. - readForConnection / readSshSecretsForConnection throw SecretsStoreUnavailableException when the store does not answer; an absent secret is still null. - The drivers let it through instead of connecting without a password, and the error text names the keyring, not the credentials. - Editing a connection stops before any write when the saved secrets cannot be read, and says so.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #1303
Problem:
ConnectionSecretsStore.readForConnection/readSshSecretsForConnectioncaught every error and returned nulls, and the drivers wrapped the read incatch (_) {}.updateConnectionread the previous secrets the same way. With the read failing silently, the next write stored the missing password as empty (a delete), so an unrelated edit could erase it.Fix
SecretsStoreUnavailableException. The reads throw it when the backend throws; an absent key still reads as null. A missing profile id (nothing stored yet) is still "no secrets".mapDatabaseErrormaps it before the text matching, so it is never an authentication failure.LocalDb.updateConnectionreads the previous secrets before touching the row, so it stops without writing; the connections panel's edit flow shows the message in a toast instead of saving.getConnections(hydrateSecrets: true)) keeps its tolerance: the row loads without its password and the connect reports the keyring.Tests: store reads (throws on a failing backend, null for absent keys, SSH too); an edit with an unreadable store changes nothing and the saved password survives; each driver's
connectsurfaces the keyring error; the mapper keeps it apart from authentication failures. The old test that expected nulls on a failing read now expects the exception.