@web-ts-toolkit/oidc-vault-dpop-client 0.48.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/llms.txt ADDED
@@ -0,0 +1,45 @@
1
+ @web-ts-toolkit/oidc-vault-dpop-client: browser-only DPoP client for
2
+ @web-ts-toolkit/express-oidc-vault vault flows (body + cookie transports).
3
+ Vanilla TS, no framework, no default export. Full guide: README.md.
4
+
5
+ Install: pnpm add @web-ts-toolkit/oidc-vault-dpop-client
6
+ (jose + idb ride as dependencies; no separate install needed.)
7
+
8
+ Imports (named root only):
9
+ import { createOidcVaultDpopSession, fetchWithDpop } from
10
+ '@web-ts-toolkit/oidc-vault-dpop-client';
11
+ Also root-exported: getOrCreateDpopKey, createDpopProof, DpopNonceCache,
12
+ createDeviceFingerprint, fingerprintJsSignalSource, OidcVaultDpopClientError,
13
+ plus DpopKey/Scope, DpopAccessToken, DpopFetchContext/Options/Api,
14
+ OidcVaultDpopSession/Options, DeviceFingerprint types.
15
+
16
+ Workflow 1 — vault session lifecycle:
17
+ session = createOidcVaultDpopSession({ backendOrigin, basePath,
18
+ sessionTransport: 'body' | 'cookie' }); // basePath = exact mount
19
+ login(returnTo?) -> exchange(code) -> getAccessToken/refresh -> logout.
20
+ login/exchange always credentials:include; refresh/logout body=omit+sessionId,
21
+ cookie=include+{} (never sessionId in cookie JSON). Vault nonce failures are
22
+ HTTP 400 OIDC_VAULT_USE_DPOP_NONCE with one retry. Key loss (DPOP_KEY_LOST)
23
+ requires fresh login; never fall back to Bearer or ephemeral keys.
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.
29
+
30
+ Workflow 2 — bound API fetch:
31
+ fetchWithDpop({ session, apis: [{ origin, replayNamespace }] }, url, opts?).
32
+ Owns Authorization/DPoP, redirect:error, no-store; fresh proof+ath per
33
+ attempt. API nonce failures are 401 use_dpop_nonce with one retry; only
34
+ invalid_token triggers one refresh. GET/HEAD/OPTIONS retryable; mutations
35
+ single-attempt unless retry:'idempotent' with a server idempotency contract.
36
+
37
+ Workflow 3 — optional recognition (opt-in change detection, never PoP):
38
+ fingerprint = createDeviceFingerprint(async () => signal | undefined);
39
+ Pass { fingerprint } to session options. 403
40
+ OIDC_VAULT_FINGERPRINT_REAUTH_REQUIRED -> clear auth, fresh login.
41
+
42
+ Limits: Chromium 151 + Firefox 153 evidenced (same-site loopback); Safari/
43
+ WebKit uncertified; third-party-cookie policy is deployment-specific.
44
+ Backend wire tables stay authoritative in express-oidc-vault README.
45
+ Live example: apps/oidc-vault-dpop-example (both transports + browsers).
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@web-ts-toolkit/oidc-vault-dpop-client",
3
+ "description": "DPoP browser client for @web-ts-toolkit/express-oidc-vault with body+cookie transports",
4
+ "homepage": "https://web-ts-toolkit.pages.dev/docs/packages/oidc-vault-dpop-client",
5
+ "version": "0.48.0",
6
+ "sideEffects": false,
7
+ "keywords": [
8
+ "oidc",
9
+ "dpop",
10
+ "browser",
11
+ "authentication",
12
+ "proof-of-possession"
13
+ ],
14
+ "main": "./index.js",
15
+ "module": "./index.mjs",
16
+ "types": "./index.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "types": {
20
+ "import": "./index.d.mts",
21
+ "require": "./index.d.ts"
22
+ },
23
+ "import": "./index.mjs",
24
+ "require": "./index.js"
25
+ }
26
+ },
27
+ "engines": {
28
+ "node": ">=22"
29
+ },
30
+ "browserslist": [
31
+ "chrome >= 94",
32
+ "edge >= 94",
33
+ "firefox >= 93",
34
+ "safari >= 16"
35
+ ],
36
+ "dependencies": {
37
+ "idb": "^8.0.3",
38
+ "jose": "^6.1.0"
39
+ },
40
+ "files": [
41
+ "**/*",
42
+ "!**/*.map"
43
+ ],
44
+ "author": "Junmin Ahn",
45
+ "bugs": {
46
+ "url": "https://github.com/egose/web-ts-toolkit/issues"
47
+ },
48
+ "license": "Apache-2.0",
49
+ "repository": {
50
+ "type": "git",
51
+ "url": "git+https://github.com/egose/web-ts-toolkit.git",
52
+ "directory": "packages/oidc-vault-dpop-client"
53
+ }
54
+ }