Secure sharing
Secure sharing transfers a sealed snapshot of one vault entry through a short-lived bearer link. The sender stores only ciphertext in the sender's Google Drive, while the link carries the key needed to open it; the recipient can preview the content and save an independent copy without a Google account.
Sharing model
The sharing model is a one-way transfer of a snapshot. It does not name or authenticate a recipient, keep the two copies in sync, or guarantee burn-after-reading. Anyone who gets the link can open the share until Rowel's expiry check rejects it or the sender revokes it.
The link has two roles:
- It identifies the public Drive file that holds the sealed copy.
- It carries the per-share decryption key.
The key does not go to Google Drive. A recipient therefore needs the link and network access, but does not need a Rowel account or an unlocked vault. See credential management for the wider vault model and credential entry models for the data that a shared entry can represent.
Sharing lifecycle
Sharing moves from a local entry to a sealed remote file and then to a new local entry on the recipient's side. The sender's copy and the recipient's copy have separate lifecycles.
This diagram shows the main send and receive paths.
flowchart LR
A[Sender selects an entry] --> B[Entry is sanitized and sealed]
B --> C[Ciphertext is stored in sender's Drive]
C --> D[Link returns to sender]
D --> E[Recipient pastes link]
E --> F[Public file is fetched]
F --> G[Content is checked and previewed]
G --> H[Recipient adds a new vault entry]
C --> I[Expiry sweep or sender revoke]
I --> J[Remote share file is deleted]
The sender starts sharing from an entry detail action or the send dialog. The app creates the link when the dialog opens. It offers copy and revoke actions, and it keeps the link visible when a revoke fails because the remote share is still live.
The recipient opens the link before saving it. The preview shows enough non-secret data to identify the entry and counts secret fields without displaying their values. Adding the preview uses the normal new-entry path, so the recipient owns the saved row and later edits do not return to the sender.
References: src-tauri/…/mod.rs• L56-119 src/…/useSend.ts• L33-110 src/…/useReceive.ts• L46-99 src/…/Preview.tsx• L7-55
Entry handling
Shared content is a sanitized copy of the entry. Sanitization removes sender-owned identity and device state before the content leaves the sender, and the receive path removes the same fields before saving the preview as a new recipient-owned entry.
| Shared content | Recipient-owned content |
|---|---|
| Entry values such as title, username, password, OTP, tags, notes, and custom fields | Entry ID |
| Entry kind supported by the current Rowel version | Created and updated timestamps |
| The secret data needed for the copied entry | Favorite state, password history, and passkeys |
The recipient's vault assigns a new ID and new timestamps. It also clears the sender's favorite state, password history, and passkeys. This prevents a shared payload from naming or replacing an existing recipient row, and avoids treating copied history or a passkey as recipient-owned authentication state.
A login that contains only a passkey cannot be shared. A login must contain a password or OTP secret to produce a useful shared copy. Entries above the share size limit are rejected before upload.
References: src-tauri/…/envelope.rs• L66-107 src-tauri/…/envelope.rs• L123-164 src/…/useReceive.ts• L19-55 src/…/Preview.tsx• L28-55
Sharing API
The sharing API separates the frontend actions from the service that seals, fetches, lists, and removes share files. Sender-side commands require an unlocked workspace with Google Drive configured and a vault ID from at least one successful sync.
| API action | System result | Sender or recipient boundary |
|---|---|---|
share_create | Seals one entry, uploads it, makes the file public by its ID, and returns the link and expiry | Sender workspace required |
share_open | Fetches the public file and returns checked, sanitized entry data | No account or unlocked vault required |
share_revoke | Deletes one owned share before its expiry | Sender workspace required |
share_list | Sweeps expired shares, then returns the current workspace's active shares | Sender workspace required |
The vault ID is the ownership boundary for sender controls. One Google account can hold shares from more than one workspace, but a workspace lists and revokes only shares stamped with its own ID. A file ID by itself does not grant permission to delete a file.
Drive is the remote store and the only ledger of outstanding shares. The service uses a share marker to find share files, while opaque properties let the sender's UI relate a file to its local entry and expiry. The key remains outside that remote metadata.
References: src/…/share.ts• L4-58 src-tauri/…/share.rs• L22-124 src-tauri/…/mod.rs• L121-195 src-tauri/…/remote.rs• L26-91
User controls
User-facing controls expose sharing where a user has an entry to send and where a user manages the links already sent. These controls make the lifecycle boundary visible instead of treating sharing as a hidden export.
- Send an entry: The entry detail actions open the send dialog. A connected Drive is required because the share is a file in the sender's Drive.
- Copy a link: The link is copied through the app's clipboard handling and follows the configured clipboard clear time. The link is a live bearer credential, so the sender must use a trusted channel.
- Revoke a link: The send dialog and Sync settings can remove a live share before its fixed lifetime ends.
- Review active links: Sync settings lists the current workspace's links with the source entry, entry kind, and remaining time. A deleted source entry is shown as deleted, but its share remains independently revocable.
- Receive a link: The add-entry flow opens the receive dialog. The user can inspect the non-secret preview and choose whether to add the copy.
The sharing surfaces clear transient link and preview state when their dialogs close. A late create response that no longer belongs to the open dialog is treated as an orphan and queued for revoke rather than shown under the wrong entry.
References: src/…/SendDialog.tsx• L10-67 src/…/LinkPanel.tsx• L39-101 src/…/ReceiveDialog.tsx• L11-92 src/…/SharesRow.tsx• L20-155 src/…/ui.ts• L59-68 src/…/shares.ts• L1-15
Security boundaries
The main security boundary is local sealing before remote storage. Rowel stores ciphertext in the sender's Drive and gives public file access only to the file identified by the link. Possession of the link is possession of the share.
The share lifetime has two separate guarantees:
- Rowel refuses to open a share after the authenticated expiry time. This remains true if the remote file has not yet been deleted.
- A revoke or expiry sweep deletes the remote file. Deletion is best effort, so it is not a promise that a previously imported copy disappears.
The expiry is included inside the sealed content as well as in remote bookkeeping. This lets the recipient enforce the expiry without trusting Drive metadata. The remote expiry property supports cleanup but does not extend the life of the sealed content.
The recipient fetch path accepts public files by ID, so it limits downloads and applies a request deadline. It then rejects invalid links, altered content, unsupported versions or entry kinds, expired content, and payloads that are too large. A missing or deleted file is reported as expired or revoked.
References: src-tauri/…/envelope.rs• L106-160 src-tauri/…/remote.rs• L39-40 src-tauri/…/remote.rs• L221-250 src-tauri/…/mod.rs• L149-195 src/…/errors.ts• L20-27
Lifetime controls
Every share has a fixed 24-hour lifetime. The sender can revoke it sooner, while the account-wide sweep removes files whose known expiry has passed. The sweep runs after successful sync and when the active-share list is opened.
Listing is workspace-scoped, but sweeping is account-wide. This prevents an expired file from remaining in an account only because it came from another workspace or another sender device. A share with no readable expiry is not treated as expired automatically.
The sender must complete a successful sync before creating, listing, or revoking shares. A connected Drive alone is not enough because the vault ID is needed to stamp and check ownership. If a publish step fails after upload, the service removes the incomplete remote file before reporting failure.
References: src-tauri/…/envelope.rs• L16-29 src-tauri/…/share.rs• L92-124 src-tauri/…/mod.rs• L93-109 src-tauri/…/mod.rs• L149-179 src/…/SharesRow.tsx• L49-70
Change checklist
When these files or sections are changed, remember to consider these:
- Keep sender-side ownership checks aligned across create, list, and revoke. A share shown in the workspace settings must remain revocable by that same workspace.
- Keep the authenticated envelope expiry and the Drive expiry metadata aligned. The first controls opening; the second supports cleanup.
- Preserve sanitization on both send and receive paths. Changes to entry fields must not allow a sender ID, timestamps, favorites, password history, or passkeys to cross the copy boundary.
- Keep the share command error kinds aligned with user actions. In particular, a failed revoke must retry revoke rather than create a second live link.
- Keep late send responses tied to orphan cleanup. A share created for a closed or changed dialog must not remain live without a visible control.
- Keep receive size and format checks compatible with the entry models and with the public Drive fetch limit.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| The workspace has no successful sync | A share cannot be safely assigned to an owner | Sender commands return shareNeedsSync until a vault ID exists |
| A send request completes after the dialog changes entry | A live link could be left in Drive without being shown | The late file is queued as an orphan and revoke is retried |
| Revoke fails while the link is still live | The user could believe the credential is gone | The link stays visible and the same revoke action remains available |
| The source entry is deleted | The remote share still contains its snapshot | The active-share list shows a deleted source and keeps revoke available |
| A link is altered, expired, too large, or from a newer format | The recipient must not save untrusted or unusable data | Link parsing, size checks, authenticated expiry, and version checks reject it |
| A share contains a sender row ID, password history, or passkey | The recipient could overwrite local identity or receive sender-only authentication state | The backend and receive path sanitize the entry before save |
| Drive query results lag after upload | A new share could be missing from the list and remain live | Revoke fetches by file ID rather than relying on the listing index |
Key files
| File | Why to read it |
|---|---|
| src-tauri/…/mod.rs | Shows the share lifecycle from sealing and publishing through opening, revoking, listing, and sweeping. |
| src-tauri/…/envelope.rs | Defines the sealed snapshot, link boundary, expiry, size, version, and sanitization rules. |
| src-tauri/…/remote.rs | Explains the Drive storage boundary and the public recipient fetch path. |
| src-tauri/…/share.rs | Defines the frontend command boundary and the workspace readiness checks. |
| src/…/share.ts | States the frontend contract for creating, opening, listing, and revoking shares. |
| src/…/useSend.ts | Shows send-dialog state, clipboard handling, revoke retry, and orphan cleanup. |
| src/…/useReceive.ts | Shows link opening, preview state, and conversion into a new vault entry. |
| src/…/Preview.tsx | Shows which identifying data is visible before a recipient saves the share. |
| src/…/SharesRow.tsx | Shows active-link review, expiry refresh, and user revoke controls. |
| docs/share-design.md | Provides the product-level sharing model and the limits of the v1 security promise. |