Skip to content

fix(sync): a Mac connect uses a stored secret only where the library still points - #4824

Merged
datlechin merged 9 commits into
mainfrom
mac-connect-destination-check
Dec 2, 2026
Merged

datlechin merged 9 commits into
mainfrom
mac-connect-destination-check

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • The Mac's connect gets the core's connect-time secret check (core ADR 0114, A pulled destination does not take a stored secret), which Windows has through connect_saved since feat(core-sync): personal records go up sealed under the personal key at keyed wire ids #4815 and fix(core-sync): a moved secret goes back only once its record lands, and a record kept on the device is not sealed again #4816.
  • DialedSecrets gates each connect-time Keychain read: the database password, a credential profile's password, the SSL key passphrase and plugin fields, and the SSH password, key passphrase and TOTP secret, inline or from a profile.
  • A stored secret reads as missing, as a missing password does, when the dial points elsewhere than the library, before or after the read, or when a secret of the connection or its profiles lands during the read.
  • KeychainSyncedSecrets tells SecretLandings before a landing or removal touches the Keychain. A landing the library has not read back makes the gate read the core's file first (CoreLibraryStore.landingsRead).
  • Each dial names its source: connectToSession (through the SSH profile as it stands), session redials, metadata and lane drivers, native backup and Test Connection.
  • A session on another database, a new commit mode or environment label, or a write to another record during the read keeps the secret.
  • Test Connection dials its SSH profile as it stands, remote-file tests included, and refuses a profile that moves during the test.
  • Schema registry and backup field reads, which cannot wait, take no stored secret for a session the library no longer points at.
  • The editor reads a pulled move back before it shows a connection's secrets, and shows none when one lands while it reads them.
  • The published SSH route is left out of the comparison: the Mac dials through its own SSH config and records its own route after the tunnel opens.

Follow-ups for 0.90

  • Editor draft secrets carry no provenance: a password loaded into an editor that stays open while a pull moves its SSH profile can go to the new route through Test Connection.
  • Decide whether the published SSH route should join the comparison for connections a Mac dials through another device's resolution.

Test plan

  • New: DialedSecretsTests (17 cases) and ConnectionEditorStoreSecretStateTests.editorReadsBackAPulledMove.
  • verify.sh test passes on DialedSecretsTests, DriverOpenSecretReadTests, the ConnectionEditorStore suites, KeychainSyncedSecretsTests, KeychainSyncedConnectionSecretsTests, CoreLibraryStoreTests, SessionRecoveryLoopTests, SessionLanesTests, DatabaseManagerTunnelTests, CredentialLeaseRoutingTests, LocalCredentialConsentTests, ConnectionWarningTests, DatabaseManagerRDSEndpointTests, CloudSQLIAMAuthTests, EnvVarReferenceConsentTests, the NativeDump, SchemaRegistry and MetadataConnectionPool suites, SyncPassFollowerTests and CredentialProfileStorageTests.
  • verify.sh build and lint on each changed Swift file pass.

@datlechin datlechin added the backport release/0.89 Merged into main; pick onto release/0.89 label Dec 2, 2026
@datlechin
datlechin merged commit fc3b98c into main Dec 2, 2026
1 check passed
@datlechin
datlechin deleted the mac-connect-destination-check branch December 2, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport release/0.89 Merged into main; pick onto release/0.89

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant