@_mustachio/openauth 0.11.0 → 0.12.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.
Files changed (164) hide show
  1. package/dist/esm/adapters/d1/index.js +18 -9
  2. package/dist/esm/adapters/d1/migrations.js +7 -2
  3. package/dist/esm/adapters/d1/session-store.js +39 -0
  4. package/dist/esm/adapters/d1/session.js +2 -2
  5. package/dist/esm/adapters/durable-object/index.js +4 -0
  6. package/dist/esm/adapters/durable-object/session-store.js +42 -0
  7. package/dist/esm/adapters/dynamo/index.js +24 -7
  8. package/dist/esm/adapters/dynamo/session-store.js +49 -0
  9. package/dist/esm/adapters/kms/index.js +6 -2
  10. package/dist/esm/adapters/kv/index.js +6 -2
  11. package/dist/esm/adapters/memory/index.js +24 -7
  12. package/dist/esm/adapters/memory/session-store.js +23 -0
  13. package/dist/esm/adapters/postgres/executor.js +2 -2
  14. package/dist/esm/adapters/postgres/index.js +33 -10
  15. package/dist/esm/adapters/postgres/migrations.js +8 -2
  16. package/dist/esm/adapters/postgres/session-store.js +42 -0
  17. package/dist/esm/client.js +27 -27
  18. package/dist/esm/domain/authorize.js +2 -2
  19. package/dist/esm/domain/callback.js +121 -7
  20. package/dist/esm/domain/client-auth.js +2 -2
  21. package/dist/esm/domain/crypto.js +14 -14
  22. package/dist/esm/domain/discovery.js +2 -2
  23. package/dist/esm/domain/dpop.js +4 -4
  24. package/dist/esm/domain/id-token.js +5 -5
  25. package/dist/esm/domain/jwt.js +4 -4
  26. package/dist/esm/domain/method-dispatch.js +27 -1
  27. package/dist/esm/domain/method-route.js +80 -1
  28. package/dist/esm/domain/par.js +2 -2
  29. package/dist/esm/domain/pkce.js +2 -2
  30. package/dist/esm/domain/revoke.js +2 -2
  31. package/dist/esm/domain/state-envelope.js +2 -2
  32. package/dist/esm/domain/token.js +5 -5
  33. package/dist/esm/error.js +8 -8
  34. package/dist/esm/http/cookies.js +19 -2
  35. package/dist/esm/http/errors.js +4 -4
  36. package/dist/esm/http/handlers/authorize.js +3 -19
  37. package/dist/esm/http/handlers/callback.js +7 -1
  38. package/dist/esm/http/handlers/metadata.js +2 -2
  39. package/dist/esm/http/handlers/method-route.js +47 -2
  40. package/dist/esm/http/handlers/revocation.js +2 -2
  41. package/dist/esm/http/middleware/tenant.js +6 -6
  42. package/dist/esm/http/schemas/authorize.js +2 -2
  43. package/dist/esm/http/schemas/revocation.js +2 -2
  44. package/dist/esm/http/schemas/token.js +7 -7
  45. package/dist/esm/index.js +33 -32
  46. package/dist/esm/methods/oauth2-factory.js +2 -2
  47. package/dist/esm/methods/password-hash.js +2 -2
  48. package/dist/esm/methods/providers/index.js +30 -14
  49. package/dist/esm/methods/saml-sp/acs.js +208 -0
  50. package/dist/esm/methods/saml-sp/attributes.js +75 -0
  51. package/dist/esm/methods/saml-sp/authnrequest.js +63 -0
  52. package/dist/esm/methods/saml-sp/cache-provider.js +33 -0
  53. package/dist/esm/methods/saml-sp/cert-rotation.js +13 -0
  54. package/dist/esm/methods/saml-sp/factory.js +70 -0
  55. package/dist/esm/methods/saml-sp/index.js +7 -0
  56. package/dist/esm/methods/saml-sp/metadata.js +69 -0
  57. package/dist/esm/methods/saml-sp/method.js +29 -0
  58. package/dist/esm/methods/saml-sp/parse-idp-metadata.js +102 -0
  59. package/dist/esm/methods/saml-sp/saml-instance.js +49 -0
  60. package/dist/esm/methods/saml-sp/slo-initiate.js +84 -0
  61. package/dist/esm/methods/saml-sp/sls.js +154 -0
  62. package/dist/esm/methods/saml-sp/types.js +0 -0
  63. package/dist/esm/types/result.js +3 -3
  64. package/dist/esm/ui/forms.js +3 -3
  65. package/dist/esm/ui/index.js +8 -5
  66. package/dist/esm/ui/picker.js +2 -2
  67. package/dist/types/adapters/d1/migrations.d.ts.map +1 -1
  68. package/dist/types/adapters/d1/session-store.d.ts +3 -0
  69. package/dist/types/adapters/d1/session-store.d.ts.map +1 -1
  70. package/dist/types/adapters/durable-object/session-store.d.ts +3 -0
  71. package/dist/types/adapters/durable-object/session-store.d.ts.map +1 -1
  72. package/dist/types/adapters/dynamo/session-store.d.ts +3 -0
  73. package/dist/types/adapters/dynamo/session-store.d.ts.map +1 -1
  74. package/dist/types/adapters/memory/session-store.d.ts +3 -0
  75. package/dist/types/adapters/memory/session-store.d.ts.map +1 -1
  76. package/dist/types/adapters/postgres/migrations.d.ts +1 -1
  77. package/dist/types/adapters/postgres/migrations.d.ts.map +1 -1
  78. package/dist/types/adapters/postgres/session-store.d.ts +3 -0
  79. package/dist/types/adapters/postgres/session-store.d.ts.map +1 -1
  80. package/dist/types/domain/callback.d.ts +16 -1
  81. package/dist/types/domain/callback.d.ts.map +1 -1
  82. package/dist/types/domain/method-dispatch.d.ts.map +1 -1
  83. package/dist/types/domain/method-route.d.ts +57 -1
  84. package/dist/types/domain/method-route.d.ts.map +1 -1
  85. package/dist/types/http/context.d.ts +3 -1
  86. package/dist/types/http/context.d.ts.map +1 -1
  87. package/dist/types/http/cookies.d.ts +9 -1
  88. package/dist/types/http/cookies.d.ts.map +1 -1
  89. package/dist/types/http/handlers/callback.d.ts.map +1 -1
  90. package/dist/types/http/handlers/method-route.d.ts.map +1 -1
  91. package/dist/types/index.d.ts +1 -1
  92. package/dist/types/index.d.ts.map +1 -1
  93. package/dist/types/methods/saml-sp/acs.d.ts +4 -0
  94. package/dist/types/methods/saml-sp/acs.d.ts.map +1 -0
  95. package/dist/types/methods/saml-sp/attributes.d.ts +40 -0
  96. package/dist/types/methods/saml-sp/attributes.d.ts.map +1 -0
  97. package/dist/types/methods/saml-sp/authnrequest.d.ts +4 -0
  98. package/dist/types/methods/saml-sp/authnrequest.d.ts.map +1 -0
  99. package/dist/types/methods/saml-sp/cache-provider.d.ts +38 -0
  100. package/dist/types/methods/saml-sp/cache-provider.d.ts.map +1 -0
  101. package/dist/types/methods/saml-sp/cert-rotation.d.ts +23 -0
  102. package/dist/types/methods/saml-sp/cert-rotation.d.ts.map +1 -0
  103. package/dist/types/methods/saml-sp/factory.d.ts +704 -0
  104. package/dist/types/methods/saml-sp/factory.d.ts.map +1 -0
  105. package/dist/types/methods/saml-sp/index.d.ts +24 -0
  106. package/dist/types/methods/saml-sp/index.d.ts.map +1 -0
  107. package/dist/types/methods/saml-sp/metadata.d.ts +42 -0
  108. package/dist/types/methods/saml-sp/metadata.d.ts.map +1 -0
  109. package/dist/types/methods/saml-sp/method.d.ts +17 -0
  110. package/dist/types/methods/saml-sp/method.d.ts.map +1 -0
  111. package/dist/types/methods/saml-sp/parse-idp-metadata.d.ts +4 -0
  112. package/dist/types/methods/saml-sp/parse-idp-metadata.d.ts.map +1 -0
  113. package/dist/types/methods/saml-sp/saml-instance.d.ts +81 -0
  114. package/dist/types/methods/saml-sp/saml-instance.d.ts.map +1 -0
  115. package/dist/types/methods/saml-sp/slo-initiate.d.ts +4 -0
  116. package/dist/types/methods/saml-sp/slo-initiate.d.ts.map +1 -0
  117. package/dist/types/methods/saml-sp/sls.d.ts +4 -0
  118. package/dist/types/methods/saml-sp/sls.d.ts.map +1 -0
  119. package/dist/types/methods/saml-sp/types.d.ts +204 -0
  120. package/dist/types/methods/saml-sp/types.d.ts.map +1 -0
  121. package/dist/types/ports/audit-log.d.ts +18 -5
  122. package/dist/types/ports/audit-log.d.ts.map +1 -1
  123. package/dist/types/ports/session-store.d.ts +23 -0
  124. package/dist/types/ports/session-store.d.ts.map +1 -1
  125. package/dist/types/types/idp.d.ts +71 -0
  126. package/dist/types/types/idp.d.ts.map +1 -1
  127. package/dist/types/types/method.d.ts +109 -0
  128. package/dist/types/types/method.d.ts.map +1 -1
  129. package/package.json +9 -1
  130. package/src/adapters/d1/migrations.ts +5 -0
  131. package/src/adapters/d1/session-store.ts +68 -0
  132. package/src/adapters/durable-object/session-store.ts +61 -0
  133. package/src/adapters/dynamo/session-store.ts +63 -0
  134. package/src/adapters/memory/session-store.ts +39 -0
  135. package/src/adapters/postgres/migrations.ts +6 -0
  136. package/src/adapters/postgres/session-store.ts +69 -0
  137. package/src/domain/callback.ts +215 -7
  138. package/src/domain/method-dispatch.ts +53 -1
  139. package/src/domain/method-route.ts +190 -1
  140. package/src/http/context.ts +6 -0
  141. package/src/http/cookies.ts +19 -1
  142. package/src/http/handlers/authorize.ts +2 -21
  143. package/src/http/handlers/callback.ts +9 -1
  144. package/src/http/handlers/method-route.ts +75 -2
  145. package/src/index.ts +3 -0
  146. package/src/methods/saml-sp/acs.ts +399 -0
  147. package/src/methods/saml-sp/attributes.ts +137 -0
  148. package/src/methods/saml-sp/authnrequest.ts +128 -0
  149. package/src/methods/saml-sp/cache-provider.ts +76 -0
  150. package/src/methods/saml-sp/cert-rotation.ts +34 -0
  151. package/src/methods/saml-sp/factory.ts +118 -0
  152. package/src/methods/saml-sp/index.ts +34 -0
  153. package/src/methods/saml-sp/metadata.ts +204 -0
  154. package/src/methods/saml-sp/method.ts +65 -0
  155. package/src/methods/saml-sp/parse-idp-metadata.ts +164 -0
  156. package/src/methods/saml-sp/saml-instance.ts +173 -0
  157. package/src/methods/saml-sp/slo-initiate.ts +177 -0
  158. package/src/methods/saml-sp/sls.ts +306 -0
  159. package/src/methods/saml-sp/types.ts +203 -0
  160. package/src/ports/CONSISTENCY.md +25 -0
  161. package/src/ports/audit-log.ts +18 -5
  162. package/src/ports/session-store.ts +28 -0
  163. package/src/types/idp.ts +74 -0
  164. package/src/types/method.ts +110 -0
@@ -0,0 +1,24 @@
1
+ /**
2
+ * `@_mustachio/openauth/methods/saml-sp` — SAML 2.0 Service Provider
3
+ * method family.
4
+ *
5
+ * **Node-only.** This entry depends transitively on
6
+ * `@node-saml/node-saml` and `xml-crypto`, which require `node:crypto`
7
+ * and the `@xmldom/xmldom` DOM. Cloudflare Workers, browsers, and
8
+ * other edge runtimes cannot load this module; use the root
9
+ * `@_mustachio/openauth` entry (OIDC / OAuth methods) on those
10
+ * platforms.
11
+ *
12
+ * The library's root entry is verified edge-clean by
13
+ * `test/types/public-api-no-thirdparty-leaks.test.ts` and the
14
+ * complementary `saml-sp-no-thirdparty-leaks.test.ts` — neither this
15
+ * subpath's third-party deps nor its public types are reachable from
16
+ * `@_mustachio/openauth`.
17
+ *
18
+ * See `docs/plans/claude/saml-sp-plan.md` for the architectural
19
+ * decisions backing this surface (SAML-AD1–AD7) and the phase plan.
20
+ */
21
+ export { samlSpFactory } from "./factory";
22
+ export { parseSamlIdpMetadata } from "./parse-idp-metadata";
23
+ export type { SamlAttributeMapping, SamlAttributeRef, SamlIdpConfig, SamlIdpInitiatedConfig, SamlIdpSigningCert, SamlNameIdFormat, SamlSpConfig, SamlSpProperties, SamlSpState, } from "./types";
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/methods/saml-sp/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAE3D,YAAY,EACV,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,WAAW,GACZ,MAAM,SAAS,CAAA"}
@@ -0,0 +1,42 @@
1
+ import type { MethodContext, MethodResult } from "../../types/method";
2
+ import type { SamlNameIdFormat, SamlSpConfig, SamlSpProperties, SamlSpState } from "./types";
3
+ export type SpMetadataInput = {
4
+ spEntityId: string;
5
+ acsUrl: string;
6
+ /**
7
+ * The SP's own Single Logout Service URL (`/m/<methodId>/sls`).
8
+ * Present ⇒ front-channel SLO is served, so the metadata advertises
9
+ * `SingleLogoutService` for both bindings we accept. Same
10
+ * advertise-only-what-we-serve invariant as the ACS / signing cert.
11
+ */
12
+ slsUrl?: string;
13
+ nameIdFormat?: SamlNameIdFormat;
14
+ /**
15
+ * SP signing cert (PEM). Present ⇒ we sign AuthnRequests, so the
16
+ * metadata advertises `AuthnRequestsSigned="true"` and a
17
+ * `KeyDescriptor use="signing"`. Keeping this in lockstep with the
18
+ * runtime (the same `config.signingKey.certPem` that actually signs)
19
+ * is the same anti-drift invariant as the entityID/ACS.
20
+ */
21
+ signingCertPem?: string;
22
+ /**
23
+ * SP encryption cert (PEM). Present ⇒ the connection accepts
24
+ * encrypted assertions, so the metadata advertises a
25
+ * `KeyDescriptor use="encryption"` (the cert the IdP encrypts to —
26
+ * `config.decryptionKey.certPem`). Same anti-drift / advertise-only-
27
+ * what-we-serve invariant as the signing cert.
28
+ */
29
+ encryptionCertPem?: string;
30
+ };
31
+ /**
32
+ * Pure SP metadata builder. Mirrors `parseSamlIdpMetadata`'s purity so
33
+ * it is trivially unit-testable and reusable.
34
+ */
35
+ export declare function buildSpMetadataXml(input: SpMetadataInput): string;
36
+ /**
37
+ * `GET /metadata` route handler. Anonymous (declared in the method's
38
+ * `publicRoutes`): `ctx.flow` / `ctx.methodState` are null; everything
39
+ * comes from `ctx.tenant` + `ctx.dispatch` + captured config.
40
+ */
41
+ export declare function buildSpMetadata(ctx: MethodContext<SamlSpState>, methodId: string, config: SamlSpConfig): Promise<MethodResult<SamlSpProperties, SamlSpState>>;
42
+ //# sourceMappingURL=metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../../../src/methods/saml-sp/metadata.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGrE,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACZ,MAAM,SAAS,CAAA;AAsBhB,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,gBAAgB,CAAA;IAC/B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAUD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAiDjE;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,aAAa,CAAC,WAAW,CAAC,EAC/B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,YAAY,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAgDtD"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * `buildSamlSpMethod` — assembles the `AuthMethod` for a SAML SP
3
+ * instance. Mirrors `buildOauth2Method`: data + handler functions, no
4
+ * framework imports beyond `types/`.
5
+ *
6
+ * Routes:
7
+ * - `GET /authorize` → SP-initiated AuthnRequest redirect (implemented).
8
+ * - `GET /callback` → ACS verification gauntlet (next increment).
9
+ *
10
+ * The framework's universal callback (`/cb/<methodId>`, both GET and
11
+ * POST) always dispatches the `"GET /callback"` route key, so the ACS
12
+ * lives there rather than at a bespoke `/acs` sub-path.
13
+ */
14
+ import type { AuthMethod } from "../../types/method";
15
+ import type { SamlSpConfig, SamlSpProperties, SamlSpState } from "./types";
16
+ export declare function buildSamlSpMethod(id: string, kind: string, config: SamlSpConfig): AuthMethod<SamlSpProperties, SamlSpState>;
17
+ //# sourceMappingURL=method.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../../../src/methods/saml-sp/method.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,oBAAoB,CAAA;AAOnE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1E,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,YAAY,GACnB,UAAU,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAsC3C"}
@@ -0,0 +1,4 @@
1
+ import type { Result } from "../../types/result";
2
+ import type { SamlIdpConfig } from "./types";
3
+ export declare function parseSamlIdpMetadata(xml: string): Result<SamlIdpConfig>;
4
+ //# sourceMappingURL=parse-idp-metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-idp-metadata.d.ts","sourceRoot":"","sources":["../../../../src/methods/saml-sp/parse-idp-metadata.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAMhD,OAAO,KAAK,EAAE,aAAa,EAAoB,MAAM,SAAS,CAAA;AA8C9D,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,GACV,MAAM,CAAC,aAAa,CAAC,CA6FvB"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Construct a `@node-saml/node-saml` `SAML` instance from validated
3
+ * `SamlSpConfig` plus the per-request binding context (SP entityID +
4
+ * ACS URL, both derived at dispatch time per SAML-AD5).
5
+ *
6
+ * CJS interop: node-saml is CommonJS-only. Per the SAML house-style
7
+ * note, default-import then destructure rather than relying on the
8
+ * named-export heuristic.
9
+ */
10
+ import nodeSaml from "@node-saml/node-saml";
11
+ import type { MethodScratch } from "../../types/method";
12
+ import type { SamlNameIdFormat, SamlSpConfig } from "./types";
13
+ declare const SAML: typeof nodeSaml.SAML;
14
+ type SamlInstance = InstanceType<typeof SAML>;
15
+ /** Standard SAML 2.0 NameID format URNs. */
16
+ export declare const NAME_ID_FORMAT_URN: Record<SamlNameIdFormat, string>;
17
+ export type SamlBindingContext = {
18
+ /** SP entityID — `<issuerUrl>/<tenantId>/<methodId>` (SAML-AD5). */
19
+ spEntityId: string;
20
+ /** ACS URL — the framework's `/cb/<methodId>` universal callback. */
21
+ acsUrl: string;
22
+ /** Per-request scratch backing the `InResponseTo` cache. */
23
+ scratch: MethodScratch;
24
+ /**
25
+ * IdP-initiated mode. An unsolicited Response has no `InResponseTo`
26
+ * (there was no AuthnRequest), so `validateInResponseTo` must be
27
+ * `ifPresent` rather than `always` — otherwise node-saml throws
28
+ * "InResponseTo is missing". Signature / Issuer / Audience /
29
+ * Conditions are still fully enforced; assertion-ID replay dedup is
30
+ * layered on top by the caller (node-saml does not dedup unsolicited
31
+ * assertion IDs). Default `false` ⇒ SP-initiated, `always`
32
+ * (unchanged).
33
+ */
34
+ idpInitiated?: boolean;
35
+ /**
36
+ * Logout-binding instance (the `/sls` + `/logout` paths). node-saml's
37
+ * `InResponseTo` machinery only reads the attribute off a `Response`
38
+ * root, never a `LogoutResponse`, so with the default `always` it
39
+ * throws "InResponseTo is missing" on every inbound `LogoutResponse`.
40
+ * Front-channel logout correlation is out of that scope — we
41
+ * replay-dedup the inbound `LogoutRequest @ID` via `methodScratch`
42
+ * instead — so logout instances use `never`. Overrides `idpInitiated`.
43
+ */
44
+ logout?: boolean;
45
+ /**
46
+ * Per-connection SP signing material (SAML-AD: O3 — decoupled from
47
+ * the OIDC `KeyStore`; the IdP pins this cert, rotation is an
48
+ * IdP-coordination event). Present ⇒ node-saml signs the outbound
49
+ * `AuthnRequest` (HTTP-Redirect binding) **and** outbound logout
50
+ * messages (`LogoutRequest` / `LogoutResponse`) with it.
51
+ */
52
+ signing?: {
53
+ privateKeyPem: string;
54
+ certPem: string;
55
+ };
56
+ /**
57
+ * IdP Single Logout endpoint (`SamlSpConfig.idp.sloUrl`). Destination
58
+ * for SP-emitted `LogoutResponse` (front-channel SLO, Phase 3) and
59
+ * SP-initiated `LogoutRequest`. Only needed on the `/sls` path; the
60
+ * SSO paths leave it unset.
61
+ */
62
+ logoutUrl?: string;
63
+ /**
64
+ * SP decryption private key PEM (`SamlSpConfig.decryptionKey`),
65
+ * passed through to node-saml's `decryptionPvk`. Present ⇒ node-saml
66
+ * decrypts `<saml:EncryptedAssertion>` (the decrypted assertion's
67
+ * XML-DSig is still fully enforced). Set only when the connection
68
+ * opted into `allowEncryptedAssertions`; absent ⇒ an encrypted
69
+ * assertion is rejected.
70
+ */
71
+ decryptionPvk?: string;
72
+ };
73
+ /**
74
+ * Derive the per-instance SP entityID. Stable across deploys for a
75
+ * given `(issuerUrl, tenantId, methodId)` triple so IdP-side trust
76
+ * config doesn't churn.
77
+ */
78
+ export declare function deriveSpEntityId(issuerUrl: string, tenantId: string, methodId: string): string;
79
+ export declare function buildSamlInstance(config: SamlSpConfig, binding: SamlBindingContext, nowMs: number): SamlInstance;
80
+ export {};
81
+ //# sourceMappingURL=saml-instance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"saml-instance.d.ts","sourceRoot":"","sources":["../../../../src/methods/saml-sp/saml-instance.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,QAAQ,MAAM,sBAAsB,CAAA;AAE3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAIvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE7D,QAAA,MAAQ,IAAI,sBAAmC,CAAA;AAC/C,KAAK,YAAY,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,CAAA;AAE7C,4CAA4C;AAC5C,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAK/D,CAAA;AAUD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,oEAAoE;IACpE,UAAU,EAAE,MAAM,CAAA;IAClB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;IACd,4DAA4D;IAC5D,OAAO,EAAE,aAAa,CAAA;IACtB;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE;QACR,aAAa,EAAE,MAAM,CAAA;QACrB,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;IACD;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,MAAM,CAGR;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,kBAAkB,EAC3B,KAAK,EAAE,MAAM,GACZ,YAAY,CA6Dd"}
@@ -0,0 +1,4 @@
1
+ import type { MethodContext, MethodResult } from "../../types/method";
2
+ import type { SamlSpConfig, SamlSpProperties, SamlSpState } from "./types";
3
+ export declare function initiateSpLogout(ctx: MethodContext<SamlSpState>, methodId: string, config: SamlSpConfig): Promise<MethodResult<SamlSpProperties, SamlSpState>>;
4
+ //# sourceMappingURL=slo-initiate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slo-initiate.d.ts","sourceRoot":"","sources":["../../../../src/methods/saml-sp/slo-initiate.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAOrE,OAAO,KAAK,EAEV,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACZ,MAAM,SAAS,CAAA;AAEhB,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,aAAa,CAAC,WAAW,CAAC,EAC/B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,YAAY,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAgItD"}
@@ -0,0 +1,4 @@
1
+ import type { MethodContext, MethodResult } from "../../types/method";
2
+ import type { SamlSpConfig, SamlSpProperties, SamlSpState } from "./types";
3
+ export declare function consumeSls(ctx: MethodContext<SamlSpState>, methodId: string, config: SamlSpConfig): Promise<MethodResult<SamlSpProperties, SamlSpState>>;
4
+ //# sourceMappingURL=sls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sls.d.ts","sourceRoot":"","sources":["../../../../src/methods/saml-sp/sls.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAIrE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAmB1E,wBAAsB,UAAU,CAC9B,GAAG,EAAE,aAAa,CAAC,WAAW,CAAC,EAC/B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,YAAY,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,CAsPtD"}
@@ -0,0 +1,204 @@
1
+ /**
2
+ * SAML SP — public types.
3
+ *
4
+ * These types are the locked contract for the SAML SP method family and
5
+ * are intentionally introduced ahead of the runtime implementation so
6
+ * downstream callers can import them today, and so the public-API
7
+ * leak guard
8
+ * (`test/types/saml-sp-no-thirdparty-leaks.test.ts`) can verify
9
+ * the shapes before any `@node-saml/*` or `xml-crypto` code lands.
10
+ *
11
+ * No third-party types appear here. `@node-saml/node-saml`'s `Profile`
12
+ * is mapped onto `SamlSpProperties` at the wrapper boundary; consumers
13
+ * never see node-saml's surface.
14
+ *
15
+ * See `docs/plans/claude/saml-sp-plan.md` for the architectural
16
+ * decisions (SAML-AD1–AD7) backing this shape.
17
+ */
18
+ /**
19
+ * Standard SAML 2.0 NameID formats we support.
20
+ *
21
+ * - `persistent` — opaque, stable per user/SP pair; preferred.
22
+ * - `transient` — opaque, single-session.
23
+ * - `emailAddress` — RFC 822 email; common with legacy IdPs.
24
+ * - `unspecified` — IdP picks; pass through verbatim.
25
+ */
26
+ export type SamlNameIdFormat = "persistent" | "transient" | "emailAddress" | "unspecified";
27
+ /**
28
+ * One field's source. Either the assertion's NameID or a named
29
+ * attribute. `format` narrows attribute lookup when an IdP issues
30
+ * multiple attributes with the same `Name` but different `NameFormat`.
31
+ */
32
+ export type SamlAttributeRef = {
33
+ source: "nameId";
34
+ } | {
35
+ source: "attribute";
36
+ name: string;
37
+ format?: string;
38
+ };
39
+ /**
40
+ * How the SAML method translates a verified assertion into the
41
+ * `providerSubject` + per-claim fields that flow into the host's
42
+ * `success` callback. Mirrors the OIDC method's claim-mapping
43
+ * configuration — the host owns the final `SubjectClaim`; this map
44
+ * just normalises the SAML side.
45
+ */
46
+ export type SamlAttributeMapping = {
47
+ /** Which attribute becomes `providerSubject`. Defaults to NameID. */
48
+ subject?: SamlAttributeRef;
49
+ email?: SamlAttributeRef;
50
+ /** SAML assertions are typically issued only after IdP-side verification. */
51
+ emailVerified?: {
52
+ source: "literal";
53
+ value: boolean;
54
+ };
55
+ name?: SamlAttributeRef;
56
+ /** Multi-valued — the mapper preserves array shape. */
57
+ groups?: SamlAttributeRef;
58
+ /** Pass-through map for additional claims hosts want surfaced. */
59
+ custom?: Record<string, SamlAttributeRef>;
60
+ };
61
+ /**
62
+ * A single PEM-encoded IdP signing certificate, optionally bounded by a
63
+ * validity window. The runtime verifier accepts any cert whose window
64
+ * covers `now` — supports overlapping hot rotation without re-deploys.
65
+ */
66
+ export type SamlIdpSigningCert = {
67
+ pem: string;
68
+ /** Inclusive lower bound. Unix ms. Omit for no lower bound. */
69
+ notBefore?: number;
70
+ /** Exclusive upper bound. Unix ms. Omit for no upper bound. */
71
+ notAfter?: number;
72
+ };
73
+ /**
74
+ * Identity-Provider-side configuration the host paste/imports from the
75
+ * IdP's metadata XML (or uploads a metadata URL we fetch once). Stable
76
+ * across deploys — keyed by `(tenantId, methodId)` in `MethodStore`.
77
+ */
78
+ export type SamlIdpConfig = {
79
+ entityId: string;
80
+ /** SSO endpoint URL. HTTP-Redirect binding is the default. */
81
+ ssoUrl: string;
82
+ /** Single Logout endpoint URL. Optional; Phase 3 deliverable. */
83
+ sloUrl?: string;
84
+ /** Preferred NameID format requested in `AuthnRequest`. */
85
+ nameIdFormat?: SamlNameIdFormat;
86
+ /** One or more IdP signing certs. ≥1 required. Hot-rotatable. */
87
+ signingCerts: ReadonlyArray<SamlIdpSigningCert>;
88
+ };
89
+ /**
90
+ * IdP-initiated SSO binding. When set, the ACS endpoint accepts
91
+ * unsolicited SAML Responses (no `InResponseTo`) and synthesizes a
92
+ * flow record using these defaults so the existing
93
+ * `MethodResult.success` path can run end-to-end.
94
+ *
95
+ * Documented in plan SAML-AD7 — this is the one architectural carve-out
96
+ * SAML imposes on the framework. Omit to reject unsolicited Responses
97
+ * with `invalid_request` (the conservative default).
98
+ */
99
+ export type SamlIdpInitiatedConfig = {
100
+ defaultClientId: string;
101
+ defaultRedirectUri: string;
102
+ defaultScopes?: string[];
103
+ };
104
+ /**
105
+ * Tenant-supplied configuration for a SAML SP method instance.
106
+ * Validated by `samlSpFactory.configSchema` (Standard Schema v1).
107
+ */
108
+ export type SamlSpConfig = {
109
+ idp: SamlIdpConfig;
110
+ attributeMapping: SamlAttributeMapping;
111
+ /** Whether to sign outbound `AuthnRequest`. Default `false`. */
112
+ signAuthnRequest?: boolean;
113
+ /**
114
+ * Per-connection SP signing keypair (SAML-AD: O3). **Decoupled from
115
+ * the OIDC `KeyStore` on purpose** — the SP signing cert is pinned at
116
+ * the IdP and rotated as an IdP-coordination event, not on the OIDC
117
+ * token-key schedule; this also keeps the design KMS-agnostic.
118
+ * `privateKeyPem` signs the `AuthnRequest`; `certPem` is what the IdP
119
+ * pins and what SP metadata advertises. Required iff
120
+ * `signAuthnRequest` is `true`. Treat `privateKeyPem` as a secret:
121
+ * the host should encrypt the `MethodStore` at rest (or supply it via
122
+ * its own resolver) — same handling as any per-tenant credential.
123
+ */
124
+ signingKey?: {
125
+ privateKeyPem: string;
126
+ certPem: string;
127
+ };
128
+ /**
129
+ * Accept `<saml:EncryptedAssertion>` responses. **Off by default** —
130
+ * a connection only opts in when its IdP is configured to encrypt.
131
+ * When `false`, an encrypted assertion is rejected (the SP advertises
132
+ * no decryption cert and node-saml has no `decryptionPvk`). Requires
133
+ * `decryptionKey` when `true` (enforced by `configSchema`).
134
+ */
135
+ allowEncryptedAssertions?: boolean;
136
+ /**
137
+ * Per-connection SP **decryption** keypair — the private half the IdP
138
+ * encrypts assertions to. Same SAML-AD O3 rationale as `signingKey`:
139
+ * decoupled from the OIDC `KeyStore` (the IdP pins the matching cert
140
+ * via SP metadata; rotation is an IdP-coordination event;
141
+ * KMS-agnostic). Required iff `allowEncryptedAssertions` is `true`.
142
+ * Treat `privateKeyPem` as a secret: the host should encrypt the
143
+ * `MethodStore` at rest (or supply it via its own resolver) — same
144
+ * handling as `signingKey.privateKeyPem` and any per-tenant
145
+ * credential. `certPem` is the matching X.509 cert the IdP encrypts
146
+ * to; SP metadata advertises it as a `use="encryption"`
147
+ * `KeyDescriptor` (same advertise-only-what-we-serve invariant as
148
+ * `signingKey`).
149
+ */
150
+ decryptionKey?: {
151
+ privateKeyPem: string;
152
+ certPem: string;
153
+ };
154
+ idpInitiated?: SamlIdpInitiatedConfig;
155
+ /** Clock skew allowance for `NotBefore` / `NotOnOrAfter`. Seconds. */
156
+ clockSkewSeconds?: number;
157
+ };
158
+ /**
159
+ * Method-private state stashed in `FlowRecord.methodState` for the
160
+ * duration of an SP-initiated flow.
161
+ *
162
+ * `InResponseTo` correlation is handled out-of-band by node-saml's
163
+ * `CacheProvider` (backed by `methodScratch`), so the outstanding
164
+ * request id does **not** live here — only the framework state
165
+ * envelope echoed as RelayState and the issuance timestamp.
166
+ */
167
+ export type SamlSpState = {
168
+ relayState: string;
169
+ issuedAt: number;
170
+ /**
171
+ * SP entityID + ACS URL computed at AuthnRequest time, where the
172
+ * framework's dispatch context is available. The ACS dispatch has
173
+ * no dispatch context, so these are read back from here to validate
174
+ * the assertion's `AudienceRestriction` / `Recipient` against the
175
+ * exact values the IdP saw in the request.
176
+ */
177
+ spEntityId: string;
178
+ acsUrl: string;
179
+ };
180
+ /**
181
+ * Properties handed to the host's `IdPOptions.success` callback on a
182
+ * successful SAML authentication. The host translates these into the
183
+ * final `SubjectClaim` it owns.
184
+ *
185
+ * `raw.responseXml` is provided as an escape hatch for hosts that want
186
+ * to inspect the verified Response themselves; the wrapper has already
187
+ * run the full signature gauntlet by the time these properties leave
188
+ * the method.
189
+ */
190
+ export type SamlSpProperties = {
191
+ nameId: {
192
+ value: string;
193
+ format: SamlNameIdFormat;
194
+ };
195
+ attributes: Record<string, string | string[]>;
196
+ /** Used for Single Logout correlation (Phase 3). */
197
+ sessionIndex?: string;
198
+ /** Unix ms — the assertion's `AuthnInstant`. */
199
+ authnInstant: number;
200
+ raw: {
201
+ responseXml: string;
202
+ };
203
+ };
204
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/methods/saml-sp/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GACxB,YAAY,GACZ,WAAW,GACX,cAAc,GACd,aAAa,CAAA;AAEjB;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAAE,MAAM,EAAE,QAAQ,CAAA;CAAE,GACpB;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAE1D;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,qEAAqE;IACrE,OAAO,CAAC,EAAE,gBAAgB,CAAA;IAC1B,KAAK,CAAC,EAAE,gBAAgB,CAAA;IACxB,6EAA6E;IAC7E,aAAa,CAAC,EAAE;QAAE,MAAM,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAA;IACrD,IAAI,CAAC,EAAE,gBAAgB,CAAA;IACvB,uDAAuD;IACvD,MAAM,CA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,CAAA;IAC1D,YAAY,CAAC,EAAE,sBAAsB,CAAA;IACrC,sEAAsE;IACtE,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAA;QACb,MAAM,EAAE,gBAAgB,CAAA;KACzB,CAAA;IACD,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAA;IAC7C,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,gDAAgD;IAChD,YAAY,EAAE,MAAM,CAAA;IACpB,GAAG,EAAE;QACH,WAAW,EAAE,MAAM,CAAA;KACpB,CAAA;CACF,CAAA"}
@@ -83,16 +83,29 @@ export type AuditEvent = {
83
83
  family: string;
84
84
  } | {
85
85
  /**
86
- * Emitted by `/end_session` (OIDC RP-Initiated Logout 1.0 §2) after
87
- * processing the logout request — regardless of whether a
88
- * `post_logout_redirect_uri` was supplied. `subjectId` is present
89
- * when the request carried an `id_token_hint` that successfully
90
- * verified; absent otherwise.
86
+ * Emitted after a logout is processed. Two channels, discriminated
87
+ * by `via`:
88
+ *
89
+ * - `rp_initiated` (or absent the default): `/end_session`
90
+ * (OIDC RP-Initiated Logout 1.0 §2), regardless of whether a
91
+ * `post_logout_redirect_uri` was supplied. `subjectId` present
92
+ * when an `id_token_hint` verified; absent otherwise.
93
+ * - `upstream_slo`: an upstream IdP notified us a federated
94
+ * session ended (SAML front-channel Single Logout). `methodId`
95
+ * / `methodKind` identify the federation connection;
96
+ * `subjectId` present only when the host's `onLogout` returned
97
+ * a subject to revoke.
98
+ *
99
+ * `via` is general (OIDC back-channel logout would reuse
100
+ * `upstream_slo`), not SAML-specific surface.
91
101
  */
92
102
  kind: "session_logout";
93
103
  tenantId: TenantId;
94
104
  clientId?: string;
95
105
  subjectId?: string;
106
+ via?: "rp_initiated" | "upstream_slo";
107
+ methodId?: string;
108
+ methodKind?: string;
96
109
  } | {
97
110
  /**
98
111
  * Emitted when a DPoP proof's `jti` is presented within the replay
@@ -1 +1 @@
1
- {"version":3,"file":"audit-log.d.ts","sourceRoot":"","sources":["../../../src/ports/audit-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE/C;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAClB;IACE,IAAI,EAAE,mBAAmB,CAAA;IACzB,QAAQ,EAAE,QAAQ,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;CACf,GACD;IACE,IAAI,EAAE,qBAAqB,CAAA;IAC3B,QAAQ,EAAE,QAAQ,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;CAClB,GACD;IACE,IAAI,EAAE,kBAAkB,CAAA;IACxB,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAA;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACf,GACD;IACE,IAAI,EAAE,cAAc,CAAA;IACp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AAwD;IACxD,SAAS,EAAE,MAAM,CAAA;CAClB,GACD;IACE,IAAI,EAAE,qBAAqB,CAAA;IAC3B,QAAQ,EAAE,QAAQ,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;CACnB,GACD;IACE,IAAI,EAAE,oBAAoB,CAAA;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,GACD;IACE,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B,CAAA;AAEL,MAAM,MAAM,QAAQ,GAAG;IACrB;;;;OAIG;IACH,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC9D,CAAA"}
@@ -80,6 +80,29 @@ export type SessionStore = {
80
80
  */
81
81
  savePar?(requestUri: string, payload: ParRecord, ttl: number): Promise<Result<void>>;
82
82
  consumePar?(requestUri: string): Promise<Result<ParRecord>>;
83
+ /**
84
+ * Optional: per-method-instance scratch storage. Survives across flows
85
+ * (unlike `methodState`, which is per-flow). Use cases include cross-flow
86
+ * deduplication state — e.g., a SAML SP method remembering recently-seen
87
+ * assertion IDs for replay protection.
88
+ *
89
+ * The framework scopes keys per `(tenantId, methodId)` before calling
90
+ * these — adapters see opaque, already-namespaced keys and store the
91
+ * UTF-8 string value verbatim. Methods JSON-encode if they want object
92
+ * state.
93
+ *
94
+ * Strong consistency + TTL respect (same semantics as flow records).
95
+ * `readScratch` returns `unknown_state` if the key is missing or
96
+ * expired. `deleteScratch` is idempotent.
97
+ *
98
+ * Adapters without these methods cannot host methods that depend on
99
+ * scratch; the framework surfaces a clear `unsupported` error through
100
+ * `MethodContext.methodScratch` at call time. Implement all three
101
+ * methods together — partial implementations are not supported.
102
+ */
103
+ saveScratch?(key: string, value: string, ttlMs: number): Promise<Result<void>>;
104
+ readScratch?(key: string): Promise<Result<string>>;
105
+ deleteScratch?(key: string): Promise<Result<void>>;
83
106
  };
84
107
  /**
85
108
  * Stored PAR payload. The `params` blob is the raw form/query record from
@@ -1 +1 @@
1
- {"version":3,"file":"session-store.d.ts","sourceRoot":"","sources":["../../../src/ports/session-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C,MAAM,MAAM,YAAY,GAAG;IACzB;;;;;OAKG;IACH,QAAQ,CACN,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,UAAU,EACnB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;IAExB;;;;;;;;OAQG;IACH,qBAAqB,CACnB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,OAAO,GACnB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;IAExB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAA;IAErD;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAA;IAExD;;;;OAIG;IACH,aAAa,CAAC,CACZ,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,aAAa,EACtB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;IACxB,WAAW,CAAC,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAA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M,CAAC,IAAI,CAAC,CAAC,CAAA;IACxB,WAAW,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;IAClD,aAAa,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;CACnD,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,QAAQ,EAAE,MAAM,CAAA;IAChB,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,4EAA4E;AAC5E,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC,CAAA"}
@@ -58,6 +58,56 @@ export type FailureEvent = {
58
58
  flowId?: string;
59
59
  error: AuthError;
60
60
  };
61
+ /**
62
+ * Input to the optional `IdPOptions.onLogout` hook.
63
+ *
64
+ * Fires when an upstream provider notifies this IdP that a federated
65
+ * session has ended — today, a SAML front-channel `LogoutRequest`
66
+ * delivered to the SP's SLS endpoint. By the time this runs the library
67
+ * has already cryptographically verified the upstream logout message
68
+ * (XML-DSig via the SAML method), so the hook is purely the host's
69
+ * teardown point.
70
+ *
71
+ * The library deliberately does **not** know which OIDC `subject` an
72
+ * upstream identifier (`nameId`) maps to — that mapping lives in the
73
+ * host's `success` callback, not the library. So the host clears its
74
+ * own session and returns the subject (if any) whose library-issued
75
+ * tokens should be revoked; the library then runs the same
76
+ * `revokeAllForSubject` primitive `/end_session` uses. Returning
77
+ * nothing skips library-side revocation (the host handled everything,
78
+ * or there is nothing to revoke).
79
+ *
80
+ * Method-agnostic on purpose: any federation method that can verify an
81
+ * upstream logout signal reuses this. SAML SLO is the first caller;
82
+ * OIDC back-channel logout would be the next.
83
+ */
84
+ export type LogoutEventInput = {
85
+ tenant: TenantContext;
86
+ methodId: string;
87
+ methodKind: string;
88
+ /** What kind of upstream logout this is. Extensible discriminant. */
89
+ reason: "upstream_slo";
90
+ /**
91
+ * Upstream subject identifier from the verified logout message
92
+ * (SAML `LogoutRequest/NameID`). Absent if the message omitted it.
93
+ */
94
+ nameId?: string;
95
+ /**
96
+ * Upstream session index from the verified logout message
97
+ * (SAML `SessionIndex`), when present. Lets a host that tracks
98
+ * per-session state scope its teardown.
99
+ */
100
+ sessionIndex?: string;
101
+ };
102
+ /**
103
+ * Return of `IdPOptions.onLogout`. `revokeSubject` names the OIDC
104
+ * subject whose library-issued refresh tokens the library should
105
+ * revoke (the host resolves it from `nameId` — only the host has that
106
+ * map). Omit / return nothing to skip library-side revocation.
107
+ */
108
+ export type LogoutHookResult = {
109
+ revokeSubject?: string;
110
+ } | void;
61
111
  /**
62
112
  * Optional hook called at `/token` time, after PKCE has succeeded and
63
113
  * after the `success` callback has produced a `SubjectClaim`, but
@@ -226,6 +276,27 @@ export type IdPOptions = {
226
276
  onSuccess?: (event: SuccessEvent) => Promise<void>;
227
277
  onFailure?: (event: FailureEvent) => Promise<void>;
228
278
  };
279
+ /**
280
+ * Optional hook fired when an upstream provider signals that a
281
+ * federated session ended — SAML front-channel Single Logout today.
282
+ * The library has already verified the signed logout message; this
283
+ * hook is where the host tears down its own session and names the
284
+ * OIDC subject (if any) whose library-issued tokens to revoke. See
285
+ * the `LogoutEventInput` / `LogoutHookResult` type docs.
286
+ *
287
+ * Unlike `hooks.onSuccess`/`onFailure` (observation only) this hook
288
+ * **influences** library behaviour — its return drives token
289
+ * revocation — so it sits at the top level alongside `success`.
290
+ *
291
+ * Absent ⇒ the library still verifies the logout, emits a
292
+ * `session_logout` audit event, and returns the protocol
293
+ * `LogoutResponse`, but performs no token revocation (it cannot map
294
+ * the upstream id to a subject without the host).
295
+ *
296
+ * If it throws, the SLS endpoint fails closed with an internal error
297
+ * rather than acknowledging a logout it could not fully process.
298
+ */
299
+ onLogout?: (input: LogoutEventInput) => Promise<LogoutHookResult> | LogoutHookResult;
229
300
  /**
230
301
  * Optional escape hatch for high-sensitivity deployments — see the
231
302
  * `PersistUpstreamTokens` type doc.
@@ -1 +1 @@
1
- {"version":3,"file":"idp.d.ts","sourceRoot":"","sources":["../../../src/types/idp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AAC5D,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,WAAW,EACZ,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE3D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