-
Notifications
You must be signed in to change notification settings - Fork 2
Cloud Storage for Connections and Tabs (Without Storing Passwords) #121
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Desktop Cloud Assets Without Cloud Credentials
Summary
Implement a Desktop-only cloud-first model for connections, tabs, and saved queries.
- Desktop CRUD for connection metadata, tabs, saved queries, and saved-query folders goes through cloud APIs by default.
- Sensitive credentials never leave the device.
- Desktop stores secrets only in OS keychain, keyed by a stable cloud connection identifier.
- On a new device, synced connections appear immediately but enter a
needs_credentialsstate until the user supplies local secrets once.
Key Changes
Data model and sync contract
- Introduce a strict cloud-safe connection payload for Desktop.
- Allow only non-sensitive fields in cloud storage:
name,type,engine,host,port,httpPort,database,path,username, display metadata, non-secret connection settings, non-secret SSH metadata. - Explicitly exclude from cloud payloads and sync payloads:
DB passwords, tokens, connection-string embedded secrets, SSH password, private key, passphrase, and any secret-like values insideoptions. - Treat current
syncOperations.payloadas unsafe for Desktop and replace it with a sanitized payload builder before enqueueing or sending. - Use a stable cloud connection ID as the canonical identifier for cloud resources, local Desktop cache rows, and keychain secret lookup.
Desktop secret storage
- Add a Desktop secret store abstraction under the runtime helper layer.
- Desktop implementation uses OS keychain.
- Secret store covers all sensitive fields:
DB password, driver-specific tokens/secrets, SSH password/private key/passphrase, and extracted secrets from connection strings. - Secret records are stored and loaded by stable cloud connection ID plus identity ID when relevant.
- Editing a connection updates cloud metadata and local keychain independently in one client flow.
- Deleting a connection removes cloud metadata first, then best-effort deletes local keychain entries.
Connection lifecycle and UX
- Add connection readiness states for Desktop:
ready,needs_credentials,error. - After cloud fetch on Desktop:
if metadata exists and matching local secrets exist, mark usable;
otherwise markneeds_credentials. - New-device behavior:
show synced connections immediately;
block connect/query actions until credentials are supplied;
open the existing connection dialog prefilled with cloud metadata and empty secret fields. - Connect/query codepaths in Desktop resolve secrets from local keychain, not from cloud DB rows.
Test connectionin Desktop combines cloud metadata with local unsaved secret inputs or stored keychain secrets.
Tabs and saved queries
- Keep tabs, saved queries, and saved-query folders cloud-backed for Desktop.
- Move remaining Desktop-only restoration state out of local-only storage where it affects visible continuity:
active tab per connection, and optionally current connection selection if exact session restoration is desired. - Keep truly device-local transient state local:
ephemeral session IDs and non-portable editor/runtime caches. - Define conflict policy:
connections metadata and saved queries use last-write-wins by serverupdatedAt;
tab ordering/content also use last-write-wins;
local unsynced credential edits never merge to cloud.
Runtime boundary
- Apply this behavior only when runtime is Desktop via the shared runtime helper layer.
- Web self-hosting behavior remains unchanged.
- Do not add scattered runtime env checks in feature code; centralize Desktop branching in runtime/storage/service adapters.
Public Interfaces / Contract Changes
- Add a Desktop cloud-safe connection DTO distinct from the existing full connection payload.
- Add a Desktop secret store interface with methods equivalent to:
loadSecrets,saveSecrets,deleteSecrets,hasSecrets. - Add or derive a connection usability field exposed to the connections UI:
needsCredentials: booleanor equivalent status enum. - Ensure cloud connection records expose a stable cloud ID usable on every Desktop device.
Test Plan
- Create Desktop connection with password and SSH secret:
cloud request contains no secrets;
local keychain entry is created. - Edit Desktop connection metadata only:
cloud metadata updates;
keychain secrets remain unchanged. - Edit Desktop secrets only:
keychain updates;
no secret fields appear in cloud traffic or sync outbox. - Sign in on a second Desktop:
connection metadata appears;
status isneeds_credentials;
connect/query is blocked until secrets are entered. - Supply credentials on second Desktop:
connection becomes usable without changing cloud metadata. - Delete connection:
cloud record is deleted;
local keychain entry is removed best-effort. - Tabs and saved queries created on Desktop A appear on Desktop B automatically.
- Active tab restoration behaves per chosen product rule for cloud-restored vs device-local transient state.
- Regression test that
syncOperationsand any cloud API payloads never contain sensitive fields.
Assumptions and Defaults
- Scope is Desktop runtime only.
- All sensitive fields remain local, not just DB password.
- OS keychain is the required local secret backend.
- New devices show synced connections in a
needs_credentialsstate rather than hiding them. - Stable cloud connection ID is the canonical key for secret lookup and cross-device mapping.
- Existing Web runtime behavior is unchanged in this phase.
Reactions are currently unavailable
Metadata
Metadata
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
Backlog