Skip to main content

Crate bitwarden_autotype

Crate bitwarden_autotype 

Source
Expand description

§Bitwarden Autotype

Provides encrypted IPC channels for use with the Bitwarden Desktop Autotype GA implementation, using [bitwarden_ipc].

The crate is WASM-only (everything lives behind the wasm feature and is re-exported from @bitwarden/sdk-internal). It has no Autotype logic of its own; it contains the typed, Noise-encrypted channels for use between the two desktop processes.

§Channels

RequestDirectionPayloadResponse
AutotypeSetEnabledRequestrender → mainenabled: bool{ success: bool }
AutotypeSetKeyboardShortcutRequestrender → mainshortcut: Vec<String>{ success: bool }
AutotypeListRunningAppsRequestrender → main(none){ apps: AutotypeRunningApp[] }
AutotypeGetCredentialsRequestmain → renderapp: AutotypeRunningApp{ credentials?: { username, password } }

Each process registers the handlers for the requests it receives, backed by its own driver:

  • Main implements AutotypeDriver and calls registerAutotypeHandlers. These handlers only accept requests from the desktop render process.
  • Render implements AutotypeRenderDriver and calls registerAutotypeRenderHandlers. These handlers only accept requests from the desktop main process.

§Tests

Coverage lives in the TypeScript integration tests under e2e/wasm/tests/autotype/, which test the serialize → encrypt → decrypt → deserialize path over a paired in-memory transport.

Run the tests with npm run e2e:wasm from the repository root.

Modules§

wasm
Wasm support module for autotype. WASM bindings for the autotype IPC requests, exposed to the clients through @bitwarden/sdk-internal.