Expand description
The Vaultwarden HTTP client. Stateless about auth: every authed call takes
the access token the workspaceโs VaultSession holds, so the session is the
one owner of the tokens and the client can be shared across seats.
Re-exportsยง
use std::time::Duration;๐use futures::StreamExt;๐use serde::de::DeserializeOwned;๐use serde_json::Value;๐use zeroize::Zeroize;๐use zeroize::Zeroize;๐use crate::vault::VaultError;๐use crate::vault::models::AttachmentMeta;๐use crate::vault::models::Folder;๐use crate::vault::models::FolderList;๐use crate::vault::models::Prelogin;๐use crate::vault::models::SyncData;๐use crate::vault::models::TokenResponse;๐use crate::vault::models::TwoFactorCode;๐
Structsยง
Enumsยง
- Error
Fields ๐ - Which fields of an error body a route may surface.
Constantsยง
- API_
ERROR_ ๐POINTERS - CLIENT_
ID - The OAuth client id Vaultwardenโs token endpoint expects for a password grant. There is no secret: the password grant is a public client.
- CLIENT_
VERSION - The client version every request carries.
GET /api/syncomits SSH keys unless this is at least 2024.12.0, so the value is load-bearing rather than decorative. - CONNECT_
TIMEOUT - Bounds for one ordinary vault call. A stalled server must fail the call rather than hold the unlock or refresh gate for ever, which would queue every later vault call behind it.
- DOWNLOAD_
READ_ TIMEOUT - A download is opaque ciphertext up to the attachment cap, so its idle read bound and total bound are longer than an API callโs.
- DOWNLOAD_
TIMEOUT - OAUTH_
ERROR_ ๐POINTERS - READ_
TIMEOUT - REQUEST_
TIMEOUT
Functionsยง
- api_
error ๐ - Map a non-2xx response to the error the facade branches on.
- path_
segment ๐ - Percent-encode one id for a path segment. An empty id is refused rather than sent as a route with a hole in it.
- retry_
after ๐ - The serverโs
Retry-Afterhint, when it sends a whole number of seconds. - safe_
error ๐ - The serverโs own error text and nothing else. Vaultwarden states an API
refusal in
message, Rocketโs catcher nests its reason undererror, and the identity endpoint uses the OAutherrorpair. A body that does not parse contributes nothing. - send_
request ๐ - Send one request, dropping the URL from any transport error: a signed download URL carries its token in the query string.
- user_
agent - The user agent every vault request carries.