Command Palette
Search for a command to run...

API reference

The backend exposes six Connect-RPC services under the opensecret.v1 package. Connect speaks HTTP, so a client is a plain fetch away; the frontends use the generated TypeScript client in open-secret-shared.

Identity always comes from the session token, never from a request-body user id, so authenticated calls can only touch the caller's own data. Only the five endpoints marked public work without a token.

AuthService

RPCPurposePublic
SignupCreate the first account/device; returns a session token.
ChallengeBegin login: submit an auth public key, get a one-time challenge.
VerifyComplete login: submit the signed challenge, get a session token.
LogoutInvalidate the current session client-side.-

InstanceService

RPCPurposePublic
GetConfigNon-secret instance config: signups enabled, backup enabled + the backup public key, the deployment auth_mode, and (in IDP mode) the public OIDC client config. Never a secret or the K2 unlock half.

IdpService

Present in IDP-mode deployments (rejected with FailedPrecondition in standalone).

RPCPurposePublic
ExchangeSSOTokenValidate an OIDC ID token (issuer/audience/expiry/signature via JWKS), JIT-provision the user + identity device on first login, and mint a session token.
GetWrappingFactorK2Return the server-held K2 half of the vault key + the escrowed wrapped vault blob. Insufficient to decrypt without the client-only factor1.-
PutEscrowedVaultStore the wrapped identity-keypair blob so a second device can recover it after SSO.-

UserService

RPCPurpose
MeThe caller's profile (id, email, display name, admin flag, backup opt-in).
LookupByEmailResolve an email to a user id (for sharing).
SetBackupOptInOpt the user's entries into operator backup (signed command).

DeviceService

RPCPurpose
AttachDeviceRegister a new device's public keys with a parent attestation.
ListList the caller's devices.
RenameRename a device (signed command).
RevokeRevoke a device (signed command).
DeleteDelete a device (signed command).
ListPubkeysForUserFetch a user's device encryption public keys (to seal shares when sharing).

EntryService

RPCPurpose
CreateCreate an entry's first version with per-device shares.
UpdatePublish a new version (optimistic-concurrency checked).
GetFetch a version (default: current) and the caller's share.
ListList readable entries.
ListEntryVersionsReturn version-history metadata for an entry, newest first. Content is fetched per-version via Get.
DeleteDelete an entry (signed command).
AddRecipientShare with another user by sealing shares to their devices.
RemoveRecipientStop sealing future versions to a user.
BackfillDeviceSeal existing entries to a newly-paired device.
SetBackupEnabled / SetBackupEnabledBulkToggle operator-backup sealing per entry.
AttachBackupShareAttach the backup-key-sealed ciphertext for a version.

Authorization invariants

Three rules the server enforces and clients rely on:

  • Owner scoping, every entry/device query is constrained by the token-derived user id, with belt-and-braces owner clauses in SQL.
  • Share coverage, a write must seal a share for every active device of every recipient; the server rejects writes that don't.
  • NotFound vs PermissionDenied, chosen deliberately and load-bearing for clients; the distinction isn't collapsed.