@_mustachio/openauth 0.10.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 (277) 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 +45 -0
  13. package/dist/esm/adapters/memory/token-store.js +13 -0
  14. package/dist/esm/adapters/postgres/executor.js +2 -2
  15. package/dist/esm/adapters/postgres/index.js +33 -10
  16. package/dist/esm/adapters/postgres/migrations.js +8 -2
  17. package/dist/esm/adapters/postgres/session-store.js +42 -0
  18. package/dist/esm/client.js +35 -28
  19. package/dist/esm/domain/authorize.js +7 -2
  20. package/dist/esm/domain/callback.js +124 -7
  21. package/dist/esm/domain/client-auth.js +2 -2
  22. package/dist/esm/domain/crypto.js +14 -14
  23. package/dist/esm/domain/discovery.js +46 -4
  24. package/dist/esm/domain/dpop.js +122 -0
  25. package/dist/esm/domain/id-token.js +94 -0
  26. package/dist/esm/domain/introspect.js +5 -1
  27. package/dist/esm/domain/jwt.js +30 -2
  28. package/dist/esm/domain/logout.js +75 -0
  29. package/dist/esm/domain/method-dispatch.js +27 -1
  30. package/dist/esm/domain/method-route.js +83 -1
  31. package/dist/esm/domain/par.js +51 -0
  32. package/dist/esm/domain/pkce.js +2 -2
  33. package/dist/esm/domain/refresh.js +12 -1
  34. package/dist/esm/domain/register.js +74 -0
  35. package/dist/esm/domain/revoke.js +2 -2
  36. package/dist/esm/domain/state-envelope.js +2 -2
  37. package/dist/esm/domain/token-exchange.js +1 -0
  38. package/dist/esm/domain/token.js +53 -12
  39. package/dist/esm/domain/userinfo.js +38 -3
  40. package/dist/esm/error.js +8 -8
  41. package/dist/esm/http/cookies.js +19 -2
  42. package/dist/esm/http/errors.js +4 -4
  43. package/dist/esm/http/handlers/authorize.js +92 -21
  44. package/dist/esm/http/handlers/callback.js +7 -1
  45. package/dist/esm/http/handlers/end-session.js +64 -0
  46. package/dist/esm/http/handlers/metadata.js +7 -4
  47. package/dist/esm/http/handlers/method-route.js +47 -2
  48. package/dist/esm/http/handlers/par.js +53 -0
  49. package/dist/esm/http/handlers/register.js +46 -0
  50. package/dist/esm/http/handlers/revocation.js +2 -2
  51. package/dist/esm/http/handlers/token.js +36 -6
  52. package/dist/esm/http/handlers/userinfo.js +35 -29
  53. package/dist/esm/http/middleware/tenant.js +6 -6
  54. package/dist/esm/http/router.js +10 -0
  55. package/dist/esm/http/schemas/authorize.js +8 -2
  56. package/dist/esm/http/schemas/end-session.js +13 -0
  57. package/dist/esm/http/schemas/par.js +9 -0
  58. package/dist/esm/http/schemas/register.js +16 -0
  59. package/dist/esm/http/schemas/revocation.js +2 -2
  60. package/dist/esm/http/schemas/token.js +7 -7
  61. package/dist/esm/index.js +40 -34
  62. package/dist/esm/methods/oauth2-factory.js +2 -2
  63. package/dist/esm/methods/password-hash.js +2 -2
  64. package/dist/esm/methods/providers/index.js +30 -14
  65. package/dist/esm/methods/saml-sp/acs.js +208 -0
  66. package/dist/esm/methods/saml-sp/attributes.js +75 -0
  67. package/dist/esm/methods/saml-sp/authnrequest.js +63 -0
  68. package/dist/esm/methods/saml-sp/cache-provider.js +33 -0
  69. package/dist/esm/methods/saml-sp/cert-rotation.js +13 -0
  70. package/dist/esm/methods/saml-sp/factory.js +70 -0
  71. package/dist/esm/methods/saml-sp/index.js +7 -0
  72. package/dist/esm/methods/saml-sp/metadata.js +69 -0
  73. package/dist/esm/methods/saml-sp/method.js +29 -0
  74. package/dist/esm/methods/saml-sp/parse-idp-metadata.js +102 -0
  75. package/dist/esm/methods/saml-sp/saml-instance.js +49 -0
  76. package/dist/esm/methods/saml-sp/slo-initiate.js +84 -0
  77. package/dist/esm/methods/saml-sp/sls.js +154 -0
  78. package/dist/esm/methods/saml-sp/types.js +0 -0
  79. package/dist/esm/types/error.js +5 -0
  80. package/dist/esm/types/result.js +3 -3
  81. package/dist/esm/ui/forms.js +3 -3
  82. package/dist/esm/ui/index.js +8 -5
  83. package/dist/esm/ui/picker.js +2 -2
  84. package/dist/types/adapters/d1/migrations.d.ts.map +1 -1
  85. package/dist/types/adapters/d1/session-store.d.ts +3 -0
  86. package/dist/types/adapters/d1/session-store.d.ts.map +1 -1
  87. package/dist/types/adapters/durable-object/session-store.d.ts +3 -0
  88. package/dist/types/adapters/durable-object/session-store.d.ts.map +1 -1
  89. package/dist/types/adapters/dynamo/session-store.d.ts +3 -0
  90. package/dist/types/adapters/dynamo/session-store.d.ts.map +1 -1
  91. package/dist/types/adapters/memory/session-store.d.ts +6 -1
  92. package/dist/types/adapters/memory/session-store.d.ts.map +1 -1
  93. package/dist/types/adapters/memory/token-store.d.ts +1 -0
  94. package/dist/types/adapters/memory/token-store.d.ts.map +1 -1
  95. package/dist/types/adapters/postgres/migrations.d.ts +1 -1
  96. package/dist/types/adapters/postgres/migrations.d.ts.map +1 -1
  97. package/dist/types/adapters/postgres/session-store.d.ts +3 -0
  98. package/dist/types/adapters/postgres/session-store.d.ts.map +1 -1
  99. package/dist/types/client.d.ts +19 -0
  100. package/dist/types/client.d.ts.map +1 -1
  101. package/dist/types/domain/authorize.d.ts.map +1 -1
  102. package/dist/types/domain/callback.d.ts +16 -1
  103. package/dist/types/domain/callback.d.ts.map +1 -1
  104. package/dist/types/domain/client-credentials.d.ts +2 -0
  105. package/dist/types/domain/client-credentials.d.ts.map +1 -1
  106. package/dist/types/domain/discovery.d.ts +37 -0
  107. package/dist/types/domain/discovery.d.ts.map +1 -1
  108. package/dist/types/domain/dpop.d.ts +61 -0
  109. package/dist/types/domain/dpop.d.ts.map +1 -0
  110. package/dist/types/domain/id-token.d.ts +83 -0
  111. package/dist/types/domain/id-token.d.ts.map +1 -0
  112. package/dist/types/domain/introspect.d.ts +8 -0
  113. package/dist/types/domain/introspect.d.ts.map +1 -1
  114. package/dist/types/domain/jwt.d.ts +27 -1
  115. package/dist/types/domain/jwt.d.ts.map +1 -1
  116. package/dist/types/domain/logout.d.ts +69 -0
  117. package/dist/types/domain/logout.d.ts.map +1 -0
  118. package/dist/types/domain/method-dispatch.d.ts.map +1 -1
  119. package/dist/types/domain/method-route.d.ts +57 -1
  120. package/dist/types/domain/method-route.d.ts.map +1 -1
  121. package/dist/types/domain/par.d.ts +62 -0
  122. package/dist/types/domain/par.d.ts.map +1 -0
  123. package/dist/types/domain/refresh.d.ts +9 -0
  124. package/dist/types/domain/refresh.d.ts.map +1 -1
  125. package/dist/types/domain/register.d.ts +33 -0
  126. package/dist/types/domain/register.d.ts.map +1 -0
  127. package/dist/types/domain/token-exchange.d.ts +2 -0
  128. package/dist/types/domain/token-exchange.d.ts.map +1 -1
  129. package/dist/types/domain/token.d.ts +41 -1
  130. package/dist/types/domain/token.d.ts.map +1 -1
  131. package/dist/types/domain/userinfo.d.ts +44 -5
  132. package/dist/types/domain/userinfo.d.ts.map +1 -1
  133. package/dist/types/http/context.d.ts +6 -1
  134. package/dist/types/http/context.d.ts.map +1 -1
  135. package/dist/types/http/cookies.d.ts +9 -1
  136. package/dist/types/http/cookies.d.ts.map +1 -1
  137. package/dist/types/http/handlers/authorize.d.ts.map +1 -1
  138. package/dist/types/http/handlers/callback.d.ts.map +1 -1
  139. package/dist/types/http/handlers/end-session.d.ts +3 -0
  140. package/dist/types/http/handlers/end-session.d.ts.map +1 -0
  141. package/dist/types/http/handlers/metadata.d.ts +1 -1
  142. package/dist/types/http/handlers/metadata.d.ts.map +1 -1
  143. package/dist/types/http/handlers/method-route.d.ts.map +1 -1
  144. package/dist/types/http/handlers/par.d.ts +3 -0
  145. package/dist/types/http/handlers/par.d.ts.map +1 -0
  146. package/dist/types/http/handlers/register.d.ts +3 -0
  147. package/dist/types/http/handlers/register.d.ts.map +1 -0
  148. package/dist/types/http/handlers/token.d.ts.map +1 -1
  149. package/dist/types/http/handlers/userinfo.d.ts.map +1 -1
  150. package/dist/types/http/router.d.ts.map +1 -1
  151. package/dist/types/http/schemas/authorize.d.ts +40 -0
  152. package/dist/types/http/schemas/authorize.d.ts.map +1 -1
  153. package/dist/types/http/schemas/end-session.d.ts +31 -0
  154. package/dist/types/http/schemas/end-session.d.ts.map +1 -0
  155. package/dist/types/http/schemas/par.d.ts +20 -0
  156. package/dist/types/http/schemas/par.d.ts.map +1 -0
  157. package/dist/types/http/schemas/register.d.ts +42 -0
  158. package/dist/types/http/schemas/register.d.ts.map +1 -0
  159. package/dist/types/index.d.ts +3 -3
  160. package/dist/types/index.d.ts.map +1 -1
  161. package/dist/types/methods/saml-sp/acs.d.ts +4 -0
  162. package/dist/types/methods/saml-sp/acs.d.ts.map +1 -0
  163. package/dist/types/methods/saml-sp/attributes.d.ts +40 -0
  164. package/dist/types/methods/saml-sp/attributes.d.ts.map +1 -0
  165. package/dist/types/methods/saml-sp/authnrequest.d.ts +4 -0
  166. package/dist/types/methods/saml-sp/authnrequest.d.ts.map +1 -0
  167. package/dist/types/methods/saml-sp/cache-provider.d.ts +38 -0
  168. package/dist/types/methods/saml-sp/cache-provider.d.ts.map +1 -0
  169. package/dist/types/methods/saml-sp/cert-rotation.d.ts +23 -0
  170. package/dist/types/methods/saml-sp/cert-rotation.d.ts.map +1 -0
  171. package/dist/types/methods/saml-sp/factory.d.ts +704 -0
  172. package/dist/types/methods/saml-sp/factory.d.ts.map +1 -0
  173. package/dist/types/methods/saml-sp/index.d.ts +24 -0
  174. package/dist/types/methods/saml-sp/index.d.ts.map +1 -0
  175. package/dist/types/methods/saml-sp/metadata.d.ts +42 -0
  176. package/dist/types/methods/saml-sp/metadata.d.ts.map +1 -0
  177. package/dist/types/methods/saml-sp/method.d.ts +17 -0
  178. package/dist/types/methods/saml-sp/method.d.ts.map +1 -0
  179. package/dist/types/methods/saml-sp/parse-idp-metadata.d.ts +4 -0
  180. package/dist/types/methods/saml-sp/parse-idp-metadata.d.ts.map +1 -0
  181. package/dist/types/methods/saml-sp/saml-instance.d.ts +81 -0
  182. package/dist/types/methods/saml-sp/saml-instance.d.ts.map +1 -0
  183. package/dist/types/methods/saml-sp/slo-initiate.d.ts +4 -0
  184. package/dist/types/methods/saml-sp/slo-initiate.d.ts.map +1 -0
  185. package/dist/types/methods/saml-sp/sls.d.ts +4 -0
  186. package/dist/types/methods/saml-sp/sls.d.ts.map +1 -0
  187. package/dist/types/methods/saml-sp/types.d.ts +204 -0
  188. package/dist/types/methods/saml-sp/types.d.ts.map +1 -0
  189. package/dist/types/ports/audit-log.d.ts +40 -0
  190. package/dist/types/ports/audit-log.d.ts.map +1 -1
  191. package/dist/types/ports/session-store.d.ts +50 -0
  192. package/dist/types/ports/session-store.d.ts.map +1 -1
  193. package/dist/types/ports/token-store.d.ts +12 -0
  194. package/dist/types/ports/token-store.d.ts.map +1 -1
  195. package/dist/types/types/authorization.d.ts +23 -0
  196. package/dist/types/types/authorization.d.ts.map +1 -1
  197. package/dist/types/types/error.d.ts +9 -0
  198. package/dist/types/types/error.d.ts.map +1 -1
  199. package/dist/types/types/flow.d.ts +10 -0
  200. package/dist/types/types/flow.d.ts.map +1 -1
  201. package/dist/types/types/idp.d.ts +162 -1
  202. package/dist/types/types/idp.d.ts.map +1 -1
  203. package/dist/types/types/method.d.ts +109 -0
  204. package/dist/types/types/method.d.ts.map +1 -1
  205. package/dist/types/types/tenant.d.ts +37 -0
  206. package/dist/types/types/tenant.d.ts.map +1 -1
  207. package/dist/types/types/token.d.ts +128 -0
  208. package/dist/types/types/token.d.ts.map +1 -1
  209. package/package.json +9 -1
  210. package/src/adapters/d1/migrations.ts +5 -0
  211. package/src/adapters/d1/session-store.ts +68 -0
  212. package/src/adapters/durable-object/session-store.ts +61 -0
  213. package/src/adapters/dynamo/session-store.ts +63 -0
  214. package/src/adapters/memory/session-store.ts +83 -1
  215. package/src/adapters/memory/token-store.ts +16 -0
  216. package/src/adapters/postgres/migrations.ts +6 -0
  217. package/src/adapters/postgres/session-store.ts +69 -0
  218. package/src/client.ts +32 -0
  219. package/src/domain/authorize.ts +9 -0
  220. package/src/domain/callback.ts +220 -7
  221. package/src/domain/client-credentials.ts +2 -0
  222. package/src/domain/discovery.ts +80 -2
  223. package/src/domain/dpop.ts +293 -0
  224. package/src/domain/id-token.ts +213 -0
  225. package/src/domain/introspect.ts +10 -0
  226. package/src/domain/jwt.ts +80 -1
  227. package/src/domain/logout.ts +180 -0
  228. package/src/domain/method-dispatch.ts +53 -1
  229. package/src/domain/method-route.ts +195 -1
  230. package/src/domain/par.ts +141 -0
  231. package/src/domain/refresh.ts +41 -0
  232. package/src/domain/register.ts +168 -0
  233. package/src/domain/token-exchange.ts +11 -0
  234. package/src/domain/token.ts +134 -8
  235. package/src/domain/userinfo.ts +121 -6
  236. package/src/http/context.ts +10 -0
  237. package/src/http/cookies.ts +19 -1
  238. package/src/http/handlers/authorize.ts +146 -24
  239. package/src/http/handlers/callback.ts +9 -1
  240. package/src/http/handlers/end-session.ts +106 -0
  241. package/src/http/handlers/metadata.ts +7 -2
  242. package/src/http/handlers/method-route.ts +75 -2
  243. package/src/http/handlers/par.ts +84 -0
  244. package/src/http/handlers/register.ts +70 -0
  245. package/src/http/handlers/token.ts +56 -0
  246. package/src/http/handlers/userinfo.ts +62 -38
  247. package/src/http/router.ts +19 -0
  248. package/src/http/schemas/authorize.ts +27 -0
  249. package/src/http/schemas/end-session.ts +23 -0
  250. package/src/http/schemas/par.ts +23 -0
  251. package/src/http/schemas/register.ts +29 -0
  252. package/src/index.ts +21 -1
  253. package/src/methods/saml-sp/acs.ts +399 -0
  254. package/src/methods/saml-sp/attributes.ts +137 -0
  255. package/src/methods/saml-sp/authnrequest.ts +128 -0
  256. package/src/methods/saml-sp/cache-provider.ts +76 -0
  257. package/src/methods/saml-sp/cert-rotation.ts +34 -0
  258. package/src/methods/saml-sp/factory.ts +118 -0
  259. package/src/methods/saml-sp/index.ts +34 -0
  260. package/src/methods/saml-sp/metadata.ts +204 -0
  261. package/src/methods/saml-sp/method.ts +65 -0
  262. package/src/methods/saml-sp/parse-idp-metadata.ts +164 -0
  263. package/src/methods/saml-sp/saml-instance.ts +173 -0
  264. package/src/methods/saml-sp/slo-initiate.ts +177 -0
  265. package/src/methods/saml-sp/sls.ts +306 -0
  266. package/src/methods/saml-sp/types.ts +203 -0
  267. package/src/ports/CONSISTENCY.md +77 -21
  268. package/src/ports/audit-log.ts +42 -0
  269. package/src/ports/session-store.ts +61 -0
  270. package/src/ports/token-store.ts +13 -0
  271. package/src/types/authorization.ts +25 -0
  272. package/src/types/error.ts +23 -0
  273. package/src/types/flow.ts +10 -0
  274. package/src/types/idp.ts +170 -0
  275. package/src/types/method.ts +110 -0
  276. package/src/types/tenant.ts +37 -0
  277. package/src/types/token.ts +135 -0
@@ -1 +1 @@
1
- {"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/token.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAKvD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,OAC5B,WAAW,KAAG,OAAO,CAAC,QAAQ,CAAC,CA6KjD"}
1
+ {"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/token.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAKvD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,OAC5B,WAAW,KAAG,OAAO,CAAC,QAAQ,CAAC,CAoOjD"}
@@ -1 +1 @@
1
- {"version":3,"file":"userinfo.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/userinfo.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAEvD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,OAC/B,WAAW,KAAG,OAAO,CAAC,QAAQ,CAAC,CAiDjD"}
1
+ {"version":3,"file":"userinfo.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/userinfo.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAEvD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,OAC/B,WAAW,KAAG,OAAO,CAAC,QAAQ,CAAC,CAgDjD"}
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/http/router.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAW3B,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAElD,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,CAmCzD"}
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/http/router.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAc3B,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAElD,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,CAmDzD"}
@@ -8,6 +8,12 @@
8
8
  * requirement, etc.).
9
9
  */
10
10
  import { z } from "zod";
11
+ /**
12
+ * Standard `/authorize` query schema. Used both for direct calls and as
13
+ * the validation target after a PAR record is rehydrated — the PAR'd
14
+ * params are passed through this same parser so semantic checks stay in
15
+ * a single place.
16
+ */
11
17
  export declare const authorizeQuerySchema: z.ZodObject<{
12
18
  response_type: z.ZodString;
13
19
  client_id: z.ZodString;
@@ -21,6 +27,12 @@ export declare const authorizeQuerySchema: z.ZodObject<{
21
27
  prompt: z.ZodOptional<z.ZodEffects<z.ZodString, string[], string>>;
22
28
  ui_locales: z.ZodOptional<z.ZodEffects<z.ZodString, string[], string>>;
23
29
  nonce: z.ZodOptional<z.ZodString>;
30
+ /**
31
+ * OIDC Core §5.5 — JSON-encoded claims request. Parsing + structural
32
+ * validation happens in the domain layer; here we just accept any
33
+ * non-empty string and let the handler parse + reject malformed.
34
+ */
35
+ claims: z.ZodOptional<z.ZodString>;
24
36
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
25
37
  response_type: z.ZodString;
26
38
  client_id: z.ZodString;
@@ -34,6 +46,12 @@ export declare const authorizeQuerySchema: z.ZodObject<{
34
46
  prompt: z.ZodOptional<z.ZodEffects<z.ZodString, string[], string>>;
35
47
  ui_locales: z.ZodOptional<z.ZodEffects<z.ZodString, string[], string>>;
36
48
  nonce: z.ZodOptional<z.ZodString>;
49
+ /**
50
+ * OIDC Core §5.5 — JSON-encoded claims request. Parsing + structural
51
+ * validation happens in the domain layer; here we just accept any
52
+ * non-empty string and let the handler parse + reject malformed.
53
+ */
54
+ claims: z.ZodOptional<z.ZodString>;
37
55
  }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
38
56
  response_type: z.ZodString;
39
57
  client_id: z.ZodString;
@@ -47,6 +65,28 @@ export declare const authorizeQuerySchema: z.ZodObject<{
47
65
  prompt: z.ZodOptional<z.ZodEffects<z.ZodString, string[], string>>;
48
66
  ui_locales: z.ZodOptional<z.ZodEffects<z.ZodString, string[], string>>;
49
67
  nonce: z.ZodOptional<z.ZodString>;
68
+ /**
69
+ * OIDC Core §5.5 — JSON-encoded claims request. Parsing + structural
70
+ * validation happens in the domain layer; here we just accept any
71
+ * non-empty string and let the handler parse + reject malformed.
72
+ */
73
+ claims: z.ZodOptional<z.ZodString>;
74
+ }, z.ZodTypeAny, "passthrough">>;
75
+ /**
76
+ * RFC 9126 §4: when `request_uri` is presented, the user-agent's
77
+ * `/authorize` URL is allowed to carry only `client_id` and
78
+ * `request_uri`; the rest of the parameter set must come from the
79
+ * stored PAR record.
80
+ */
81
+ export declare const authorizeRequestUriQuerySchema: z.ZodObject<{
82
+ client_id: z.ZodString;
83
+ request_uri: z.ZodString;
84
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
85
+ client_id: z.ZodString;
86
+ request_uri: z.ZodString;
87
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
88
+ client_id: z.ZodString;
89
+ request_uri: z.ZodString;
50
90
  }, z.ZodTypeAny, "passthrough">>;
51
91
  export type AuthorizeQuery = z.infer<typeof authorizeQuerySchema>;
52
92
  //# sourceMappingURL=authorize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"authorize.d.ts","sourceRoot":"","sources":["../../../../src/http/schemas/authorize.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAyBvB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAqBjB,CAAA;AAEhB,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
1
+ {"version":3,"file":"authorize.d.ts","sourceRoot":"","sources":["../../../../src/http/schemas/authorize.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAyBvB;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;IAoB7B;;;;OAIG;;;;;;;;;;;;;;;IAJH;;;;OAIG;;;;;;;;;;;;;;;IAJH;;;;OAIG;;gCAGS,CAAA;AAEhB;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;gCAO3B,CAAA;AAEhB,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Zod schema for `/end_session` (OIDC RP-Initiated Logout 1.0 §2).
3
+ *
4
+ * Every parameter is optional per spec. The domain layer enforces the
5
+ * "needs identifying client to honor post_logout_redirect_uri" rule.
6
+ */
7
+ import { z } from "zod";
8
+ export declare const endSessionParamsSchema: z.ZodObject<{
9
+ id_token_hint: z.ZodOptional<z.ZodString>;
10
+ client_id: z.ZodOptional<z.ZodString>;
11
+ post_logout_redirect_uri: z.ZodOptional<z.ZodString>;
12
+ state: z.ZodOptional<z.ZodString>;
13
+ logout_hint: z.ZodOptional<z.ZodString>;
14
+ ui_locales: z.ZodOptional<z.ZodString>;
15
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
16
+ id_token_hint: z.ZodOptional<z.ZodString>;
17
+ client_id: z.ZodOptional<z.ZodString>;
18
+ post_logout_redirect_uri: z.ZodOptional<z.ZodString>;
19
+ state: z.ZodOptional<z.ZodString>;
20
+ logout_hint: z.ZodOptional<z.ZodString>;
21
+ ui_locales: z.ZodOptional<z.ZodString>;
22
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
23
+ id_token_hint: z.ZodOptional<z.ZodString>;
24
+ client_id: z.ZodOptional<z.ZodString>;
25
+ post_logout_redirect_uri: z.ZodOptional<z.ZodString>;
26
+ state: z.ZodOptional<z.ZodString>;
27
+ logout_hint: z.ZodOptional<z.ZodString>;
28
+ ui_locales: z.ZodOptional<z.ZodString>;
29
+ }, z.ZodTypeAny, "passthrough">>;
30
+ export type EndSessionParams = z.infer<typeof endSessionParamsSchema>;
31
+ //# sourceMappingURL=end-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"end-session.d.ts","sourceRoot":"","sources":["../../../../src/http/schemas/end-session.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;gCAYnB,CAAA;AAEhB,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Zod schema for the `POST /par` body (RFC 9126 §2).
3
+ *
4
+ * The shape is identical to `/authorize` query parameters; we just need
5
+ * `client_id` to identify the authenticating client. `client_secret` is
6
+ * accepted in-body for `client_secret_post` auth.
7
+ */
8
+ import { z } from "zod";
9
+ export declare const parBodySchema: z.ZodObject<{
10
+ client_id: z.ZodString;
11
+ client_secret: z.ZodOptional<z.ZodString>;
12
+ }, "strip", z.ZodString, z.objectOutputType<{
13
+ client_id: z.ZodString;
14
+ client_secret: z.ZodOptional<z.ZodString>;
15
+ }, z.ZodString, "strip">, z.objectInputType<{
16
+ client_id: z.ZodString;
17
+ client_secret: z.ZodOptional<z.ZodString>;
18
+ }, z.ZodString, "strip">>;
19
+ export type ParBody = z.infer<typeof parBodySchema>;
20
+ //# sourceMappingURL=par.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"par.d.ts","sourceRoot":"","sources":["../../../../src/http/schemas/par.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,aAAa;;;;;;;;;yBAWH,CAAA;AAEvB,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Zod schema for `POST /register` (RFC 7591 §2).
3
+ *
4
+ * The body is `application/json`. We surface invalid structure as
5
+ * `invalid_request` rather than the spec's `invalid_client_metadata` /
6
+ * `invalid_redirect_uri` codes — the library collapses all wire-format
7
+ * problems to the OAuth-2.0 `invalid_request` family for consistency.
8
+ */
9
+ import { z } from "zod";
10
+ export declare const registerBodySchema: z.ZodObject<{
11
+ client_name: z.ZodOptional<z.ZodString>;
12
+ redirect_uris: z.ZodArray<z.ZodString, "many">;
13
+ grant_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
14
+ response_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
15
+ token_endpoint_auth_method: z.ZodOptional<z.ZodEnum<["none", "client_secret_basic", "client_secret_post"]>>;
16
+ scope: z.ZodOptional<z.ZodString>;
17
+ post_logout_redirect_uris: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
18
+ sector_identifier_uri: z.ZodOptional<z.ZodString>;
19
+ contacts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
20
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
21
+ client_name: z.ZodOptional<z.ZodString>;
22
+ redirect_uris: z.ZodArray<z.ZodString, "many">;
23
+ grant_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
24
+ response_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
25
+ token_endpoint_auth_method: z.ZodOptional<z.ZodEnum<["none", "client_secret_basic", "client_secret_post"]>>;
26
+ scope: z.ZodOptional<z.ZodString>;
27
+ post_logout_redirect_uris: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
28
+ sector_identifier_uri: z.ZodOptional<z.ZodString>;
29
+ contacts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
30
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
31
+ client_name: z.ZodOptional<z.ZodString>;
32
+ redirect_uris: z.ZodArray<z.ZodString, "many">;
33
+ grant_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
34
+ response_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
35
+ token_endpoint_auth_method: z.ZodOptional<z.ZodEnum<["none", "client_secret_basic", "client_secret_post"]>>;
36
+ scope: z.ZodOptional<z.ZodString>;
37
+ post_logout_redirect_uris: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
38
+ sector_identifier_uri: z.ZodOptional<z.ZodString>;
39
+ contacts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
40
+ }, z.ZodTypeAny, "passthrough">>;
41
+ export type RegisterBody = z.infer<typeof registerBodySchema>;
42
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/http/schemas/register.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAgBf,CAAA;AAEhB,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
@@ -18,15 +18,15 @@ export { asTenantId } from "./types/tenant";
18
18
  export type { FlowRecord } from "./types/flow";
19
19
  export type { AuthMethod, AuthMethodFactory, CachePolicy, ClientFn, MethodContext, MethodDispatchData, MethodHandler, MethodResult, SetCookie, } from "./types/method";
20
20
  export type { AuthorizationRequest, AuthorizationState, } from "./types/authorization";
21
- export type { AccessTokenClaims, CodePayload, RefreshTokenPayload, TokenResponse, } from "./types/token";
21
+ export type { AccessTokenClaims, AddressClaim, CodePayload, IdTokenClaims, RefreshTokenPayload, ScopedProfileClaims, TokenResponse, } from "./types/token";
22
22
  export type { SubjectClaim, SubjectPayload, SubjectSchema, } from "./types/subject";
23
- export type { ExchangeAudience, FailureEvent, IdP, IdPOptions, PersistUpstreamTokens, RenderPicker, SuccessEvent, SuccessMapInput, } from "./types/idp";
23
+ export type { ExchangeAudience, FailureEvent, IdP, IdPOptions, LogoutEventInput, LogoutHookResult, PersistUpstreamTokens, RegisterClient, RegisterClientRequest, RegisterClientResponse, RenderPicker, SuccessEvent, SuccessMapInput, } from "./types/idp";
24
24
  export type { PickerContext, PickerMethod } from "./types/picker";
25
25
  export type { AuditEvent, AuditLog } from "./ports/audit-log";
26
26
  export type { ConfigStore } from "./ports/config-store";
27
27
  export type { EncryptionKey, KeyStore, KeyWrapper, SigningKey, } from "./ports/key-store";
28
28
  export type { MethodStore } from "./ports/method-store";
29
- export type { SessionRecord, SessionStore } from "./ports/session-store";
29
+ export type { ParRecord, SessionRecord, SessionStore, } from "./ports/session-store";
30
30
  export type { TokenStore } from "./ports/token-store";
31
31
  /**
32
32
  * Host-callable primitive for "log me out of all devices" UX. Wraps
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,YAAY,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAA;AAErD,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEzC,YAAY,EACV,YAAY,EACZ,wBAAwB,EACxB,SAAS,EACT,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,cAAc,EACd,WAAW,GACZ,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE9C,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,SAAS,GACV,MAAM,gBAAgB,CAAA;AAEvB,YAAY,EACV,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,uBAAuB,CAAA;AA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BAA0B,CAAA;AAEjC,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,QAAQ,EACR,YAAY,GACb,MAAM,qBAAqB,CAAA;AAE5B,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAKlD;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,GAAG,CAsF/C"}
@@ -0,0 +1,4 @@
1
+ import type { MethodContext, MethodResult } from "../../types/method";
2
+ import type { SamlSpConfig, SamlSpProperties, SamlSpState } from "./types";
3
+ export declare function consumeAssertion(ctx: MethodContext<SamlSpState>, methodId: string, config: SamlSpConfig): Promise<MethodResult<SamlSpProperties, SamlSpState>>;
4
+ //# sourceMappingURL=acs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acs.d.ts","sourceRoot":"","sources":["../../../../src/methods/saml-sp/acs.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAIrE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAmI1E,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,CAqNtD"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Attribute mapping — translate a node-saml `Profile` (already
3
+ * cryptographically verified by the time it reaches here) into our
4
+ * `SamlSpProperties`.
5
+ *
6
+ * node-saml flattens the assertion's `AttributeStatement` onto the
7
+ * `Profile` object as arbitrary top-level keys (single value → string,
8
+ * multi-valued → array), plus the structural `nameID` /
9
+ * `nameIDFormat` / `sessionIndex`. The host's `success` callback owns
10
+ * the final `SubjectClaim`; this layer just normalises the SAML side
11
+ * per the tenant's configured `SamlAttributeMapping`.
12
+ *
13
+ * Pure: no node-saml import, no I/O. `Profile` is modelled here as the
14
+ * minimal structural shape we read, so this file stays free of the
15
+ * third-party type (the public-API leak guard depends on that).
16
+ */
17
+ import type { SamlAttributeMapping, SamlSpProperties } from "./types";
18
+ /** The slice of node-saml's `Profile` we actually consume. */
19
+ export type VerifiedProfile = {
20
+ nameID: string;
21
+ nameIDFormat: string;
22
+ sessionIndex?: string;
23
+ attributes: Record<string, unknown>;
24
+ authnInstant?: string;
25
+ responseXml: string;
26
+ };
27
+ export type MappedSubject = {
28
+ providerSubject: string;
29
+ properties: SamlSpProperties;
30
+ };
31
+ /**
32
+ * Build `(providerSubject, properties)` from a verified profile.
33
+ * Returns a string describing the failure when the configured subject
34
+ * source resolves to nothing — the caller turns that into a `denied`
35
+ * result rather than minting a subject-less success.
36
+ */
37
+ export declare function mapProfile(profile: VerifiedProfile, mapping: SamlAttributeMapping): MappedSubject | {
38
+ error: string;
39
+ };
40
+ //# sourceMappingURL=attributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../../src/methods/saml-sp/attributes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EACV,oBAAoB,EAGpB,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAEhB,8DAA8D;AAC9D,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAwCD,MAAM,MAAM,aAAa,GAAG;IAC1B,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,gBAAgB,CAAA;CAC7B,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,oBAAoB,GAC5B,aAAa,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAmDnC"}
@@ -0,0 +1,4 @@
1
+ import type { MethodContext, MethodResult } from "../../types/method";
2
+ import type { SamlSpConfig, SamlSpProperties, SamlSpState } from "./types";
3
+ export declare function buildAuthnRequestRedirect(ctx: MethodContext<SamlSpState>, methodId: string, config: SamlSpConfig): Promise<MethodResult<SamlSpProperties, SamlSpState>>;
4
+ //# sourceMappingURL=authnrequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authnrequest.d.ts","sourceRoot":"","sources":["../../../../src/methods/saml-sp/authnrequest.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAIrE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1E,wBAAsB,yBAAyB,CAC7C,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,CAyGtD"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * `@node-saml/node-saml` `CacheProvider` backed by `methodScratch`.
3
+ *
4
+ * node-saml tracks outstanding `AuthnRequest` IDs through a
5
+ * `CacheProvider`: `saveAsync(requestId, marker)` when the request is
6
+ * generated, then `getAsync` + `removeAsync` during response
7
+ * validation to enforce `InResponseTo` (defeats unsolicited /
8
+ * replayed Responses on the SP-initiated path).
9
+ *
10
+ * The default in-memory provider is single-process only. We back it
11
+ * with `MethodContext.methodScratch`, which is already scoped per
12
+ * `(tenantId, methodId)` and shared across instances via the
13
+ * `SessionStore` adapter — so an AuthnRequest minted on one node
14
+ * validates on another.
15
+ *
16
+ * `methodScratch.get` returning `unknown_state` (missing / expired)
17
+ * maps to `null`, which is exactly node-saml's "unknown request id"
18
+ * signal.
19
+ */
20
+ import type { MethodScratch } from "../../types/method";
21
+ type CacheItem = {
22
+ value: string;
23
+ createdAt: number;
24
+ };
25
+ type NodeSamlCacheProvider = {
26
+ saveAsync(key: string, value: string): Promise<CacheItem | null>;
27
+ getAsync(key: string): Promise<string | null>;
28
+ removeAsync(key: string | null): Promise<string | null>;
29
+ };
30
+ /**
31
+ * @param scratch Per-request `MethodContext.methodScratch`.
32
+ * @param ttlMs How long an outstanding request id stays valid. Should
33
+ * comfortably exceed the slowest realistic IdP login
34
+ * (the flow record itself expires independently).
35
+ */
36
+ export declare function methodScratchCacheProvider(scratch: MethodScratch, ttlMs: number): NodeSamlCacheProvider;
37
+ export {};
38
+ //# sourceMappingURL=cache-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-provider.d.ts","sourceRoot":"","sources":["../../../../src/methods/saml-sp/cache-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAIvD,KAAK,SAAS,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAA;AACrD,KAAK,qBAAqB,GAAG;IAC3B,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAA;IAChE,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IAC7C,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;CACxD,CAAA;AAKD;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,MAAM,GACZ,qBAAqB,CAiCvB"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Cert-rotation shim.
3
+ *
4
+ * `@node-saml/node-saml`'s `idpCert` accepts a single PEM, an array of
5
+ * PEMs, or a callback. Our config models hot rotation as an array of
6
+ * `{ pem, notBefore?, notAfter? }`. This pure function filters that
7
+ * array to the certs whose validity window covers `now`, producing the
8
+ * PEM list node-saml verifies against.
9
+ *
10
+ * A cert with no `notBefore` has no lower bound; no `notAfter` has no
11
+ * upper bound. `notBefore` is inclusive, `notAfter` is exclusive — a
12
+ * cert is active while `notBefore <= now < notAfter`. Overlapping
13
+ * windows are the whole point: during rotation both the outgoing and
14
+ * incoming cert are active so in-flight assertions from either key
15
+ * still verify.
16
+ *
17
+ * Returns `[]` when nothing is in window — the caller surfaces a
18
+ * configuration error rather than handing node-saml an empty cert set
19
+ * (which it would treat as "accept nothing").
20
+ */
21
+ import type { SamlIdpSigningCert } from "./types";
22
+ export declare function selectActiveCertPems(certs: ReadonlyArray<SamlIdpSigningCert>, nowMs: number): string[];
23
+ //# sourceMappingURL=cert-rotation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cert-rotation.d.ts","sourceRoot":"","sources":["../../../../src/methods/saml-sp/cert-rotation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAEjD,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,aAAa,CAAC,kBAAkB,CAAC,EACxC,KAAK,EAAE,MAAM,GACZ,MAAM,EAAE,CAQV"}