Guides

Permissions

Allow the plugin's commands in a capability, and give each window only what it needs.

Every command has an allow-* and a deny-* permission with the prefix keyring-store:. The full list is on the generated permissions page.

Default set

keyring-store:default allows every command:

src-tauri/capabilities/default.json
{
  "identifier": "default",
  "windows": ["main"],
  "permissions": ["core:default", "keyring-store:default"]
}

A window with allow-get-passwords can read every password account under your service; the export commands add nothing beyond that. Give the plugin only to windows that load your own code, never remote content.

Narrow sets

Pick only the commands a window calls. A window that only signs with a vault key:

{
  "identifier": "signer",
  "windows": ["signer"],
  "permissions": [
    "keyring-store:allow-initialize",
    "keyring-store:allow-load-client",
    "keyring-store:allow-execute-procedure"
  ]
}

A window that only reads and writes its own tokens:

{
  "identifier": "tokens",
  "windows": ["main"],
  "permissions": [
    "keyring-store:allow-get-passwords",
    "keyring-store:allow-set-passwords",
    "keyring-store:allow-delete-passwords",
    "keyring-store:allow-password-exists"
  ]
}

Permissions select commands, not accounts: allow-get-passwords reads any account (except the reserved kp: accounts). If windows must not see each other's secrets, give only one of them the password commands and route the rest through your own Rust commands.

Which method needs which command

JavaScriptCommand
KeyringSession.loadinitialize
session.unloaddestroy
session.savesave
session.createClient / loadClientcreate_client / load_client
store.get / insert / removeget_store_record / save_store_record / remove_store_record
vault.insert / removesave_secret / remove_secret
vault proceduresexecute_procedure
getPasswords / setPasswords / deletePasswords / passwordExistsget_passwords / set_passwords / delete_passwords / password_exists
exportPasswordsPlain / importPasswordsPlainexport_passwords_plain / import_passwords_plain
exportPasswordsEncrypted / importPasswordsEncryptedexport_passwords_encrypted / import_passwords_encrypted
pingping

Permission identifiers use dashes: command get_store_record is keyring-store:allow-get-store-record.