UnENVerse 0.84.0
Local-first desktop secrets manager — TypeScript frontend
Loading...
Searching...
No Matches
RemoteVaultStore Class Reference
Inheritance diagram for RemoteVaultStore:
[legend]
Collaboration diagram for RemoteVaultStore:
[legend]

Public Member Functions

 constructor (public readonly baseUrl:string, public fingerprint?:string,)
 certFingerprint enables TOFU cert pinning when the server runs TLS with a self-signed cert.
 if (opts.headers) Object.assign(headers
etag async api< T=unknown >(path:string, method='GET', body?:unknown) takeMerged() lastSaveFailed ()
 Authenticated REST call for the user/class management panel.
async nodesRequest (method:'GET'| 'POST'| 'DELETE', path:string, body?:unknown,)
 One authenticated call to the node hub (/api/nodes/*, Phase 34).
async getStatus ()
 Fetch server status including TLS cert fingerprint (no auth needed).
get vaultId ()

Public Attributes

const useNative
opts headers
const r = await fetch(url, { method: opts.method, headers, body: opts.body })
 return
etag : r.headers.get('etag')
etag merged: r.headers.get('x-vault-merged') === '1'
let parsed: unknown = null
 try
 catch

Member Function Documentation

◆ constructor()

RemoteVaultStore::constructor ( public readonly baseUrl:string,
public fingerprint?:string )

certFingerprint enables TOFU cert pinning when the server runs TLS with a self-signed cert.

◆ if()

RemoteVaultStore::if ( opts. headers)

◆ lastSaveFailed()

etag async api< T=unknown >(path:string, method='GET', body?:unknown) takeMerged() RemoteVaultStore::lastSaveFailed ( )

Authenticated REST call for the user/class management panel.

Returns parsed JSON, or null for 204 No Content. Throws on non-2xx with the server error. Authenticate as a sub-user.

totp is sent only when the caller has one. A server whose user has a confirmed second factor answers 401 with totp_required: true for a correct password and no code — that is a prompt, not a failure, and it is thrown as [TotpRequiredError] so the caller can ask for the code and retry rather than telling the user their password was wrong. Phase 30.1: send only what changed (PATCH /api/vault, owner only). Same If-Match, merge and toasts as save. Resolves false when the server refuses deltas for this login (a sub-user) so the caller can save whole. Keep-alive. Every authenticated request slides the server-side session deadline; this exists so an idle-but-open client does not get expired. Returns false when the session is already gone. Mints a subscribable .ics feed. Returns the full URL, or null on failure — the token is shown to the caller exactly once, so this must never be retried "just to check": a retry after a network hiccup that actually succeeded server-side mints a second, orphaned feed. One authenticated call to the unique-ID registry (/api/uid/*, Phase 24.4). Returns the status and parsed body instead of collapsing errors to null: a 429 with its Retry-After, a 403 for a missing capability and a 404 for a server started without --uid-registry are each an answer the pane shows.

◆ nodesRequest()

async RemoteVaultStore::nodesRequest ( method:'GET'| 'POST'| 'DELETE',
path:string,
body?:unknown )

One authenticated call to the node hub (/api/nodes/*, Phase 34).

Same shape and reasons as RemoteVaultStore.uidRequest: the status is part of the answer.

◆ getStatus()

async RemoteVaultStore::getStatus ( )

Fetch server status including TLS cert fingerprint (no auth needed).

◆ vaultId()

get RemoteVaultStore::vaultId ( )

Member Data Documentation

◆ useNative

const RemoteVaultStore::useNative
Initial value:
= isTauri() && /^https?:\/\
if (useNative && _invoke) {
const result = (await _invoke('remote_request', {
url,
method: opts.method ?? 'GET',
headersJson: JSON.stringify(opts.headers ?? {}),
body: opts.body ?? null,
fingerprint: this.fingerprint ?? null,
})) as { status: number; body: string; etag?: string | null; merged?: boolean };
const ok = result.status >= 200 && result.status < 300;
return {
ok,
status: result.status,
json: () => {
const parsed: unknown = JSON.parse(result.body);
return Promise.resolve(parsed);
},
etag: result.etag ?? null,
merged: result.merged === true,
};
}
const headers: Record<string, string> = {}
const string
Definition auth-panel.ts:39
const useNative
Definition state.ts:267
opts headers
Definition state.ts:292
etag merged
Definition state.ts:302
import shipped from vault core data site families json
Definition families-pane.ts:13
const url
Definition lan.ts:24
const fingerprint
Definition lan.ts:25
const parsed
Definition ratelimit.ts:197
options unknown
Definition recipes-pane.ts:19
const _invoke
Definition state.ts:216

◆ headers

opts RemoteVaultStore::headers

◆ r

const RemoteVaultStore::r = await fetch(url, { method: opts.method, headers, body: opts.body })

◆ return

RemoteVaultStore::return
Initial value:
{
ok: r.ok,
status: r.status,
json: async () => {
const parsed: unknown = await r.json();
return parsed;
}
let parsed
Definition state.ts:642
const r
Definition state.ts:293

◆ __pad0__

etag RemoteVaultStore::__pad0__

◆ merged

etag RemoteVaultStore::merged

◆ parsed

let RemoteVaultStore::parsed

◆ try

RemoteVaultStore::try
Initial value:
{
parsed = await r.json()

◆ catch

RemoteVaultStore::catch
Initial value:
{
}
return { status: r.status, body: parsed }

The documentation for this class was generated from the following file: