@web-ts-toolkit/express-oidc-vault 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/wire.d.ts ADDED
@@ -0,0 +1,76 @@
1
+ /** Public JSON profile returned by exchange/refresh. */
2
+ interface OidcVaultUserProfile {
3
+ sub: string;
4
+ email?: string;
5
+ name?: string;
6
+ preferredUsername?: string;
7
+ [key: string]: unknown;
8
+ }
9
+ /**
10
+ * Local application credentials returned by `OidcVaultTokenIssuer.issue`.
11
+ * Runtime validation copies only these fields into a fresh result; additional
12
+ * properties are ignored and cannot override the response's session ID/user.
13
+ */
14
+ interface OidcVaultTokenIssueResult {
15
+ /**
16
+ * Nonempty opaque token for unbound issuance. Bound issuance requires a
17
+ * compact signed JWT (canonical unpadded base64url), exactly one cnf field
18
+ * `{ jkt }` matching the verified canonical SHA-256 thumbprint, and a
19
+ * nonnegative safe-integer exp in seconds with safe exp * 1000 milliseconds.
20
+ * Core checks the output shape; APIs independently authenticate the JWT.
21
+ */
22
+ accessToken: string;
23
+ /**
24
+ * Token lifetime in seconds: a finite nonnegative safe integer; bound
25
+ * issuance also requires safe expiresIn * 1000. Zero is valid and may carry
26
+ * a rotated session handle, but supplies no live reusable API credential.
27
+ */
28
+ expiresIn: number;
29
+ /** Exact `DPoP` is required when bound. Unbound permits only `Bearer` or omission; omitted/undefined stays absent in JSON. */
30
+ tokenType?: 'Bearer' | 'DPoP';
31
+ }
32
+ /** Exchange/refresh JSON. Local token fields are absent when no token issuer is configured. */
33
+ interface OidcVaultExchangeResult extends Partial<OidcVaultTokenIssueResult> {
34
+ /** Authoritative vault handle in body transport; omitted from cookie-transport JSON. */
35
+ sessionId?: string;
36
+ /** Session profile; extra token-issuer result properties cannot override it. */
37
+ user?: OidcVaultUserProfile;
38
+ }
39
+ /** JSON body for opt-in `POST <basePath>/login`; proof/key and recognition signals belong in their configured headers, not the body. */
40
+ interface OidcVaultLoginInitiationInput {
41
+ /** Optional destination on the configured frontend origin. Query-string returnTo is ignored by POST login. */
42
+ returnTo?: string;
43
+ }
44
+ /**
45
+ * Exact successful POST-login JSON. Navigate to this URL after storing a proof
46
+ * key when DPoP is enabled. Use credentials: 'include' even with body session
47
+ * transport: initiation sets a temporary HttpOnly transaction cookie.
48
+ */
49
+ interface OidcVaultLoginInitiationResult {
50
+ authorizationUrl: string;
51
+ }
52
+ /** Successful local logout; stateless application JWTs require separate revocation or expiry. */
53
+ interface OidcVaultLogoutResult {
54
+ /**
55
+ * Successful logout commits revocation before upstream work and clears the
56
+ * session cookie under cookie transport. Built-in live handles and unexpired
57
+ * aliases authenticate the surviving lineage's provider/original binding;
58
+ * wrong identity, missing/wrong/stale/replayed proof, or disabled acceptance
59
+ * of a bound lineage fails without deleting or clearing. No currently live
60
+ * target is idempotent success without deletion or proof reservation. Aliases
61
+ * grant revocation only, not refresh authentication or upstream redirects.
62
+ * Old custom bearer stores without revocation context retain legacy alias
63
+ * deletion behavior. Stateless application access tokens are not invalidated.
64
+ * Local-only logout (`redirect` unset or `false`) never contacts the provider.
65
+ * Redirected logout (`redirect: true`)
66
+ * treats the upstream end-session redirect as best-effort: when provider
67
+ * discovery fails or no `endSessionEndpoint` is available, the route still
68
+ * returns this local success. Discovery errors reach `onError` without
69
+ * undoing revocation or skipping the live session's `onLogout` notification.
70
+ */
71
+ loggedOut: true;
72
+ }
73
+ /** Vault handle transport; independent of DPoP mode. Default: body. */
74
+ type OidcVaultSessionTransport = 'body' | 'cookie';
75
+
76
+ export type { OidcVaultExchangeResult, OidcVaultLoginInitiationInput, OidcVaultLoginInitiationResult, OidcVaultLogoutResult, OidcVaultSessionTransport, OidcVaultTokenIssueResult, OidcVaultUserProfile };
package/wire.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/wire.ts
17
+ var wire_exports = {};
18
+ module.exports = __toCommonJS(wire_exports);
package/wire.mjs ADDED
File without changes