@web-ts-toolkit/oidc-vault-dpop-client 0.51.0 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +483 -73
- package/index.d.mts +182 -81
- package/index.d.ts +182 -81
- package/index.js +943 -226
- package/index.mjs +946 -229
- package/llms.txt +52 -37
- package/package.json +2 -2
package/llms.txt
CHANGED
|
@@ -1,45 +1,60 @@
|
|
|
1
|
-
@web-ts-toolkit/oidc-vault-dpop-client
|
|
2
|
-
|
|
3
|
-
Vanilla TS, no framework, no default export. Full guide: README.md.
|
|
1
|
+
@web-ts-toolkit/oidc-vault-dpop-client — browser DPoP vault sessions and API fetch.
|
|
2
|
+
Start with README.md: Quickstart, Recovery, Lifecycle, HTTP, Gateway, Upgrade notes.
|
|
4
3
|
|
|
5
4
|
Install: pnpm add @web-ts-toolkit/oidc-vault-dpop-client
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
jose + idb are dependencies. No Express/backend runtime or ambient types needed.
|
|
6
|
+
Node tooling/import/require: >=22.12.0 (CJS uses default require(esm) for jose).
|
|
7
|
+
Browser sessions need secure-context Web Crypto, IndexedDB CryptoKey persistence
|
|
8
|
+
and sessionStorage; cookie mode also needs Web Locks + BroadcastChannel.
|
|
9
|
+
Named root imports only, no default export/subpaths or src/dist deep imports:
|
|
9
10
|
import { createOidcVaultDpopSession, fetchWithDpop } from
|
|
10
11
|
'@web-ts-toolkit/oidc-vault-dpop-client';
|
|
11
|
-
|
|
12
|
-
createDeviceFingerprint, fingerprintJsSignalSource, OidcVaultDpopClientError
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
Other runtime exports: getOrCreateDpopKey, createDpopProof, DpopNonceCache,
|
|
13
|
+
createDeviceFingerprint, fingerprintJsSignalSource, OidcVaultDpopClientError.
|
|
14
|
+
Full root type list and member contracts: README API reference + index.d.mts.
|
|
15
|
+
Both declaration conditions are DOM-only (types:[], skipLibCheck:false).
|
|
16
|
+
Wire DTOs come from express-oidc-vault/wire at build time and are bundled here.
|
|
17
|
+
|
|
18
|
+
Session: createOidcVaultDpopSession({backendOrigin,basePath,sessionTransport})
|
|
19
|
+
defaults to /auth/oidc + body. login -> exchange(code) -> API/refresh -> logout.
|
|
20
|
+
Bootstrap removes/exchanges a callback code once or refreshes existing storage.
|
|
21
|
+
login/exchange include temporary cookies; refresh/logout body=omit+sessionId,
|
|
22
|
+
cookie=include+{} (no handle in JSON). JWTs: memory; handles/pending login:
|
|
23
|
+
tab-local sessionStorage; scoped keys/coordination metadata: IndexedDB.
|
|
24
|
+
|
|
25
|
+
Bound profile: exact DPoP, canonical compact signed JWT, exact cnf:{jkt}, safe
|
|
26
|
+
mandatory exp seconds/millisecond arithmetic. Decoding is NOT authentication;
|
|
27
|
+
APIs verify JWT/proof. Server unbound/opaque compatibility remains. expiresIn:0
|
|
28
|
+
retains rotation handles but no live API/peer token (DPOP_ACCESS_TOKEN_EXPIRED).
|
|
15
29
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
Access JWT: memory only. Body handle: tab-local sessionStorage. Cookie
|
|
25
|
-
handle: backend HttpOnly. Keys: IndexedDB scoped
|
|
26
|
-
[frontendOrigin, backendOrigin, basePath]. Cookie mode also needs Web Locks
|
|
27
|
-
+ BroadcastChannel. Cross-site HTTPS needs transactionCookie sameSite none,
|
|
28
|
-
trustedOrigins, credentialed CORS exposing DPoP-Nonce/WWW-Authenticate.
|
|
30
|
+
Lifecycle/recovery: FIFO mutations; refresh coalesces until an intervening call.
|
|
31
|
+
Cookie mode adds same-origin/scope locks + 180ms peer wait. clear invalidates local
|
|
32
|
+
auth/owned HTTP but retains key; dispose closes context and retains reload state.
|
|
33
|
+
resetKey deletes only scoped key+metadata; await then login. Existing corrupt keys
|
|
34
|
+
need this explicit recovery; no automatic reset/Bearer fallback. logout requests
|
|
35
|
+
server revocation; reset leaves old sessions/JWTs until revocation/expiry.
|
|
36
|
+
DPOP_OPERATION_SUPERSEDED / DPOP_SESSION_DISPOSED are non-terminal; stale work
|
|
37
|
+
cannot publish/navigate/clear newer auth. See README's cleanup/recovery tables.
|
|
29
38
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
single-attempt unless retry:'idempotent' with a server idempotency contract.
|
|
39
|
+
HTTP: requestTimeoutMs=15000 ms per vault headers/body/JSON attempt;
|
|
40
|
+
maxResponseBytes=1048576 streamed bytes. Bounds exclude queue/storage/key/hooks/
|
|
41
|
+
other locks. Timeout/size errors retain auth. API/proof signal stops only this
|
|
42
|
+
waiter, not shared refresh/already-started crypto. API bodies are caller-owned.
|
|
43
|
+
Abort is not server/Set-Cookie rollback; lost rotation can need login. No network retry.
|
|
36
44
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
API: fetchWithDpop({session,apis},url,options?). DpopApi.pathPrefix uses longest
|
|
46
|
+
normalized segment match; omission/root is origin-wide, duplicates reject.
|
|
47
|
+
Outbound paths normalize unreserved escapes/dots, preserve reserved separators
|
|
48
|
+
and query data. Separate gateway namespaces isolate nonces. Auth headers are
|
|
49
|
+
owned; redirect:error, no-store, API credentials:omit default. Fresh proof/JTI/ath.
|
|
50
|
+
Retry-enabled APIs: one use_dpop_nonce retry + one invalid_token refresh budget;
|
|
51
|
+
only unambiguous HTTP-401 DPoP challenges qualify. Mutations default single-attempt;
|
|
52
|
+
'idempotent' needs a server contract; 'never' forbids retries. Learn success/final
|
|
53
|
+
nonces even without retry: 64 tuples, oldest-remembered eviction, no inferred TTL.
|
|
54
|
+
Vaults retry nonce once, then DPOP_NONCE_RETRY_EXHAUSTED; final API Responses are caller-owned.
|
|
41
55
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
56
|
+
Errors: requiresLogin covers terminal session/key/browser/recognition failures,
|
|
57
|
+
not every 401. Proof/nonce/transient errors retain auth; unknown server codes ->
|
|
58
|
+
fixed OIDC_REQUEST_FAILED. Optional recognition is change detection, never PoP.
|
|
59
|
+
Limits: same-origin locks are not distributed leases. Chromium/Firefox loopback
|
|
60
|
+
evidence does not certify Safari/WebKit/cross-site cookies; see README.
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@web-ts-toolkit/oidc-vault-dpop-client",
|
|
3
3
|
"description": "DPoP browser client for @web-ts-toolkit/express-oidc-vault with body+cookie transports",
|
|
4
4
|
"homepage": "https://web-ts-toolkit.pages.dev/docs/packages/oidc-vault-dpop-client",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.53.0",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"keywords": [
|
|
8
8
|
"oidc",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
|
-
"node": ">=22"
|
|
28
|
+
"node": ">=22.12.0"
|
|
29
29
|
},
|
|
30
30
|
"browserslist": [
|
|
31
31
|
"chrome >= 94",
|