@_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.
- package/dist/esm/adapters/d1/index.js +18 -9
- package/dist/esm/adapters/d1/migrations.js +7 -2
- package/dist/esm/adapters/d1/session-store.js +39 -0
- package/dist/esm/adapters/d1/session.js +2 -2
- package/dist/esm/adapters/durable-object/index.js +4 -0
- package/dist/esm/adapters/durable-object/session-store.js +42 -0
- package/dist/esm/adapters/dynamo/index.js +24 -7
- package/dist/esm/adapters/dynamo/session-store.js +49 -0
- package/dist/esm/adapters/kms/index.js +6 -2
- package/dist/esm/adapters/kv/index.js +6 -2
- package/dist/esm/adapters/memory/index.js +24 -7
- package/dist/esm/adapters/memory/session-store.js +45 -0
- package/dist/esm/adapters/memory/token-store.js +13 -0
- package/dist/esm/adapters/postgres/executor.js +2 -2
- package/dist/esm/adapters/postgres/index.js +33 -10
- package/dist/esm/adapters/postgres/migrations.js +8 -2
- package/dist/esm/adapters/postgres/session-store.js +42 -0
- package/dist/esm/client.js +35 -28
- package/dist/esm/domain/authorize.js +7 -2
- package/dist/esm/domain/callback.js +124 -7
- package/dist/esm/domain/client-auth.js +2 -2
- package/dist/esm/domain/crypto.js +14 -14
- package/dist/esm/domain/discovery.js +46 -4
- package/dist/esm/domain/dpop.js +122 -0
- package/dist/esm/domain/id-token.js +94 -0
- package/dist/esm/domain/introspect.js +5 -1
- package/dist/esm/domain/jwt.js +30 -2
- package/dist/esm/domain/logout.js +75 -0
- package/dist/esm/domain/method-dispatch.js +27 -1
- package/dist/esm/domain/method-route.js +83 -1
- package/dist/esm/domain/par.js +51 -0
- package/dist/esm/domain/pkce.js +2 -2
- package/dist/esm/domain/refresh.js +12 -1
- package/dist/esm/domain/register.js +74 -0
- package/dist/esm/domain/revoke.js +2 -2
- package/dist/esm/domain/state-envelope.js +2 -2
- package/dist/esm/domain/token-exchange.js +1 -0
- package/dist/esm/domain/token.js +53 -12
- package/dist/esm/domain/userinfo.js +38 -3
- package/dist/esm/error.js +8 -8
- package/dist/esm/http/cookies.js +19 -2
- package/dist/esm/http/errors.js +4 -4
- package/dist/esm/http/handlers/authorize.js +92 -21
- package/dist/esm/http/handlers/callback.js +7 -1
- package/dist/esm/http/handlers/end-session.js +64 -0
- package/dist/esm/http/handlers/metadata.js +7 -4
- package/dist/esm/http/handlers/method-route.js +47 -2
- package/dist/esm/http/handlers/par.js +53 -0
- package/dist/esm/http/handlers/register.js +46 -0
- package/dist/esm/http/handlers/revocation.js +2 -2
- package/dist/esm/http/handlers/token.js +36 -6
- package/dist/esm/http/handlers/userinfo.js +35 -29
- package/dist/esm/http/middleware/tenant.js +6 -6
- package/dist/esm/http/router.js +10 -0
- package/dist/esm/http/schemas/authorize.js +8 -2
- package/dist/esm/http/schemas/end-session.js +13 -0
- package/dist/esm/http/schemas/par.js +9 -0
- package/dist/esm/http/schemas/register.js +16 -0
- package/dist/esm/http/schemas/revocation.js +2 -2
- package/dist/esm/http/schemas/token.js +7 -7
- package/dist/esm/index.js +40 -34
- package/dist/esm/methods/oauth2-factory.js +2 -2
- package/dist/esm/methods/password-hash.js +2 -2
- package/dist/esm/methods/providers/index.js +30 -14
- package/dist/esm/methods/saml-sp/acs.js +208 -0
- package/dist/esm/methods/saml-sp/attributes.js +75 -0
- package/dist/esm/methods/saml-sp/authnrequest.js +63 -0
- package/dist/esm/methods/saml-sp/cache-provider.js +33 -0
- package/dist/esm/methods/saml-sp/cert-rotation.js +13 -0
- package/dist/esm/methods/saml-sp/factory.js +70 -0
- package/dist/esm/methods/saml-sp/index.js +7 -0
- package/dist/esm/methods/saml-sp/metadata.js +69 -0
- package/dist/esm/methods/saml-sp/method.js +29 -0
- package/dist/esm/methods/saml-sp/parse-idp-metadata.js +102 -0
- package/dist/esm/methods/saml-sp/saml-instance.js +49 -0
- package/dist/esm/methods/saml-sp/slo-initiate.js +84 -0
- package/dist/esm/methods/saml-sp/sls.js +154 -0
- package/dist/esm/methods/saml-sp/types.js +0 -0
- package/dist/esm/types/error.js +5 -0
- package/dist/esm/types/result.js +3 -3
- package/dist/esm/ui/forms.js +3 -3
- package/dist/esm/ui/index.js +8 -5
- package/dist/esm/ui/picker.js +2 -2
- package/dist/types/adapters/d1/migrations.d.ts.map +1 -1
- package/dist/types/adapters/d1/session-store.d.ts +3 -0
- package/dist/types/adapters/d1/session-store.d.ts.map +1 -1
- package/dist/types/adapters/durable-object/session-store.d.ts +3 -0
- package/dist/types/adapters/durable-object/session-store.d.ts.map +1 -1
- package/dist/types/adapters/dynamo/session-store.d.ts +3 -0
- package/dist/types/adapters/dynamo/session-store.d.ts.map +1 -1
- package/dist/types/adapters/memory/session-store.d.ts +6 -1
- package/dist/types/adapters/memory/session-store.d.ts.map +1 -1
- package/dist/types/adapters/memory/token-store.d.ts +1 -0
- package/dist/types/adapters/memory/token-store.d.ts.map +1 -1
- package/dist/types/adapters/postgres/migrations.d.ts +1 -1
- package/dist/types/adapters/postgres/migrations.d.ts.map +1 -1
- package/dist/types/adapters/postgres/session-store.d.ts +3 -0
- package/dist/types/adapters/postgres/session-store.d.ts.map +1 -1
- package/dist/types/client.d.ts +19 -0
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/domain/authorize.d.ts.map +1 -1
- package/dist/types/domain/callback.d.ts +16 -1
- package/dist/types/domain/callback.d.ts.map +1 -1
- package/dist/types/domain/client-credentials.d.ts +2 -0
- package/dist/types/domain/client-credentials.d.ts.map +1 -1
- package/dist/types/domain/discovery.d.ts +37 -0
- package/dist/types/domain/discovery.d.ts.map +1 -1
- package/dist/types/domain/dpop.d.ts +61 -0
- package/dist/types/domain/dpop.d.ts.map +1 -0
- package/dist/types/domain/id-token.d.ts +83 -0
- package/dist/types/domain/id-token.d.ts.map +1 -0
- package/dist/types/domain/introspect.d.ts +8 -0
- package/dist/types/domain/introspect.d.ts.map +1 -1
- package/dist/types/domain/jwt.d.ts +27 -1
- package/dist/types/domain/jwt.d.ts.map +1 -1
- package/dist/types/domain/logout.d.ts +69 -0
- package/dist/types/domain/logout.d.ts.map +1 -0
- package/dist/types/domain/method-dispatch.d.ts.map +1 -1
- package/dist/types/domain/method-route.d.ts +57 -1
- package/dist/types/domain/method-route.d.ts.map +1 -1
- package/dist/types/domain/par.d.ts +62 -0
- package/dist/types/domain/par.d.ts.map +1 -0
- package/dist/types/domain/refresh.d.ts +9 -0
- package/dist/types/domain/refresh.d.ts.map +1 -1
- package/dist/types/domain/register.d.ts +33 -0
- package/dist/types/domain/register.d.ts.map +1 -0
- package/dist/types/domain/token-exchange.d.ts +2 -0
- package/dist/types/domain/token-exchange.d.ts.map +1 -1
- package/dist/types/domain/token.d.ts +41 -1
- package/dist/types/domain/token.d.ts.map +1 -1
- package/dist/types/domain/userinfo.d.ts +44 -5
- package/dist/types/domain/userinfo.d.ts.map +1 -1
- package/dist/types/http/context.d.ts +6 -1
- package/dist/types/http/context.d.ts.map +1 -1
- package/dist/types/http/cookies.d.ts +9 -1
- package/dist/types/http/cookies.d.ts.map +1 -1
- package/dist/types/http/handlers/authorize.d.ts.map +1 -1
- package/dist/types/http/handlers/callback.d.ts.map +1 -1
- package/dist/types/http/handlers/end-session.d.ts +3 -0
- package/dist/types/http/handlers/end-session.d.ts.map +1 -0
- package/dist/types/http/handlers/metadata.d.ts +1 -1
- package/dist/types/http/handlers/metadata.d.ts.map +1 -1
- package/dist/types/http/handlers/method-route.d.ts.map +1 -1
- package/dist/types/http/handlers/par.d.ts +3 -0
- package/dist/types/http/handlers/par.d.ts.map +1 -0
- package/dist/types/http/handlers/register.d.ts +3 -0
- package/dist/types/http/handlers/register.d.ts.map +1 -0
- package/dist/types/http/handlers/token.d.ts.map +1 -1
- package/dist/types/http/handlers/userinfo.d.ts.map +1 -1
- package/dist/types/http/router.d.ts.map +1 -1
- package/dist/types/http/schemas/authorize.d.ts +40 -0
- package/dist/types/http/schemas/authorize.d.ts.map +1 -1
- package/dist/types/http/schemas/end-session.d.ts +31 -0
- package/dist/types/http/schemas/end-session.d.ts.map +1 -0
- package/dist/types/http/schemas/par.d.ts +20 -0
- package/dist/types/http/schemas/par.d.ts.map +1 -0
- package/dist/types/http/schemas/register.d.ts +42 -0
- package/dist/types/http/schemas/register.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/methods/saml-sp/acs.d.ts +4 -0
- package/dist/types/methods/saml-sp/acs.d.ts.map +1 -0
- package/dist/types/methods/saml-sp/attributes.d.ts +40 -0
- package/dist/types/methods/saml-sp/attributes.d.ts.map +1 -0
- package/dist/types/methods/saml-sp/authnrequest.d.ts +4 -0
- package/dist/types/methods/saml-sp/authnrequest.d.ts.map +1 -0
- package/dist/types/methods/saml-sp/cache-provider.d.ts +38 -0
- package/dist/types/methods/saml-sp/cache-provider.d.ts.map +1 -0
- package/dist/types/methods/saml-sp/cert-rotation.d.ts +23 -0
- package/dist/types/methods/saml-sp/cert-rotation.d.ts.map +1 -0
- package/dist/types/methods/saml-sp/factory.d.ts +704 -0
- package/dist/types/methods/saml-sp/factory.d.ts.map +1 -0
- package/dist/types/methods/saml-sp/index.d.ts +24 -0
- package/dist/types/methods/saml-sp/index.d.ts.map +1 -0
- package/dist/types/methods/saml-sp/metadata.d.ts +42 -0
- package/dist/types/methods/saml-sp/metadata.d.ts.map +1 -0
- package/dist/types/methods/saml-sp/method.d.ts +17 -0
- package/dist/types/methods/saml-sp/method.d.ts.map +1 -0
- package/dist/types/methods/saml-sp/parse-idp-metadata.d.ts +4 -0
- package/dist/types/methods/saml-sp/parse-idp-metadata.d.ts.map +1 -0
- package/dist/types/methods/saml-sp/saml-instance.d.ts +81 -0
- package/dist/types/methods/saml-sp/saml-instance.d.ts.map +1 -0
- package/dist/types/methods/saml-sp/slo-initiate.d.ts +4 -0
- package/dist/types/methods/saml-sp/slo-initiate.d.ts.map +1 -0
- package/dist/types/methods/saml-sp/sls.d.ts +4 -0
- package/dist/types/methods/saml-sp/sls.d.ts.map +1 -0
- package/dist/types/methods/saml-sp/types.d.ts +204 -0
- package/dist/types/methods/saml-sp/types.d.ts.map +1 -0
- package/dist/types/ports/audit-log.d.ts +40 -0
- package/dist/types/ports/audit-log.d.ts.map +1 -1
- package/dist/types/ports/session-store.d.ts +50 -0
- package/dist/types/ports/session-store.d.ts.map +1 -1
- package/dist/types/ports/token-store.d.ts +12 -0
- package/dist/types/ports/token-store.d.ts.map +1 -1
- package/dist/types/types/authorization.d.ts +23 -0
- package/dist/types/types/authorization.d.ts.map +1 -1
- package/dist/types/types/error.d.ts +9 -0
- package/dist/types/types/error.d.ts.map +1 -1
- package/dist/types/types/flow.d.ts +10 -0
- package/dist/types/types/flow.d.ts.map +1 -1
- package/dist/types/types/idp.d.ts +162 -1
- package/dist/types/types/idp.d.ts.map +1 -1
- package/dist/types/types/method.d.ts +109 -0
- package/dist/types/types/method.d.ts.map +1 -1
- package/dist/types/types/tenant.d.ts +37 -0
- package/dist/types/types/tenant.d.ts.map +1 -1
- package/dist/types/types/token.d.ts +128 -0
- package/dist/types/types/token.d.ts.map +1 -1
- package/package.json +9 -1
- package/src/adapters/d1/migrations.ts +5 -0
- package/src/adapters/d1/session-store.ts +68 -0
- package/src/adapters/durable-object/session-store.ts +61 -0
- package/src/adapters/dynamo/session-store.ts +63 -0
- package/src/adapters/memory/session-store.ts +83 -1
- package/src/adapters/memory/token-store.ts +16 -0
- package/src/adapters/postgres/migrations.ts +6 -0
- package/src/adapters/postgres/session-store.ts +69 -0
- package/src/client.ts +32 -0
- package/src/domain/authorize.ts +9 -0
- package/src/domain/callback.ts +220 -7
- package/src/domain/client-credentials.ts +2 -0
- package/src/domain/discovery.ts +80 -2
- package/src/domain/dpop.ts +293 -0
- package/src/domain/id-token.ts +213 -0
- package/src/domain/introspect.ts +10 -0
- package/src/domain/jwt.ts +80 -1
- package/src/domain/logout.ts +180 -0
- package/src/domain/method-dispatch.ts +53 -1
- package/src/domain/method-route.ts +195 -1
- package/src/domain/par.ts +141 -0
- package/src/domain/refresh.ts +41 -0
- package/src/domain/register.ts +168 -0
- package/src/domain/token-exchange.ts +11 -0
- package/src/domain/token.ts +134 -8
- package/src/domain/userinfo.ts +121 -6
- package/src/http/context.ts +10 -0
- package/src/http/cookies.ts +19 -1
- package/src/http/handlers/authorize.ts +146 -24
- package/src/http/handlers/callback.ts +9 -1
- package/src/http/handlers/end-session.ts +106 -0
- package/src/http/handlers/metadata.ts +7 -2
- package/src/http/handlers/method-route.ts +75 -2
- package/src/http/handlers/par.ts +84 -0
- package/src/http/handlers/register.ts +70 -0
- package/src/http/handlers/token.ts +56 -0
- package/src/http/handlers/userinfo.ts +62 -38
- package/src/http/router.ts +19 -0
- package/src/http/schemas/authorize.ts +27 -0
- package/src/http/schemas/end-session.ts +23 -0
- package/src/http/schemas/par.ts +23 -0
- package/src/http/schemas/register.ts +29 -0
- package/src/index.ts +21 -1
- package/src/methods/saml-sp/acs.ts +399 -0
- package/src/methods/saml-sp/attributes.ts +137 -0
- package/src/methods/saml-sp/authnrequest.ts +128 -0
- package/src/methods/saml-sp/cache-provider.ts +76 -0
- package/src/methods/saml-sp/cert-rotation.ts +34 -0
- package/src/methods/saml-sp/factory.ts +118 -0
- package/src/methods/saml-sp/index.ts +34 -0
- package/src/methods/saml-sp/metadata.ts +204 -0
- package/src/methods/saml-sp/method.ts +65 -0
- package/src/methods/saml-sp/parse-idp-metadata.ts +164 -0
- package/src/methods/saml-sp/saml-instance.ts +173 -0
- package/src/methods/saml-sp/slo-initiate.ts +177 -0
- package/src/methods/saml-sp/sls.ts +306 -0
- package/src/methods/saml-sp/types.ts +203 -0
- package/src/ports/CONSISTENCY.md +77 -21
- package/src/ports/audit-log.ts +42 -0
- package/src/ports/session-store.ts +61 -0
- package/src/ports/token-store.ts +13 -0
- package/src/types/authorization.ts +25 -0
- package/src/types/error.ts +23 -0
- package/src/types/flow.ts +10 -0
- package/src/types/idp.ts +170 -0
- package/src/types/method.ts +110 -0
- package/src/types/tenant.ts +37 -0
- package/src/types/token.ts +135 -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 @@
|
|
|
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":"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DAAoD;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"}
|
|
@@ -49,6 +49,10 @@ export type AuditEvent = {
|
|
|
49
49
|
subjectId: string;
|
|
50
50
|
/** Hash of the issued refresh token id — never the token itself. */
|
|
51
51
|
refreshTokenIdHash?: string;
|
|
52
|
+
/** OIDC Core §2 — set when the response carried an `id_token`. */
|
|
53
|
+
idTokenIssued?: boolean;
|
|
54
|
+
/** RFC 9449 — set when the access token is DPoP-bound. */
|
|
55
|
+
dpopBound?: boolean;
|
|
52
56
|
} | {
|
|
53
57
|
kind: "token_refreshed";
|
|
54
58
|
tenantId: TenantId;
|
|
@@ -77,6 +81,42 @@ export type AuditEvent = {
|
|
|
77
81
|
tenantId: TenantId;
|
|
78
82
|
clientId: string;
|
|
79
83
|
family: string;
|
|
84
|
+
} | {
|
|
85
|
+
/**
|
|
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.
|
|
101
|
+
*/
|
|
102
|
+
kind: "session_logout";
|
|
103
|
+
tenantId: TenantId;
|
|
104
|
+
clientId?: string;
|
|
105
|
+
subjectId?: string;
|
|
106
|
+
via?: "rp_initiated" | "upstream_slo";
|
|
107
|
+
methodId?: string;
|
|
108
|
+
methodKind?: string;
|
|
109
|
+
} | {
|
|
110
|
+
/**
|
|
111
|
+
* Emitted when a DPoP proof's `jti` is presented within the replay
|
|
112
|
+
* window (RFC 9449 §11.1). The request was rejected with
|
|
113
|
+
* `invalid_dpop_proof`. Operators / SIEM use this to spot
|
|
114
|
+
* stolen-key replay attempts.
|
|
115
|
+
*/
|
|
116
|
+
kind: "dpop_replay_detected";
|
|
117
|
+
tenantId: TenantId | null;
|
|
118
|
+
/** First-half of the offending jti so logs can correlate without storing it. */
|
|
119
|
+
jtiPrefix: string;
|
|
80
120
|
} | {
|
|
81
121
|
kind: "flow_replay_attempt";
|
|
82
122
|
tenantId: TenantId | null;
|
|
@@ -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,QA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EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,wDAAwD;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"}
|
|
@@ -67,6 +67,56 @@ export type SessionStore = {
|
|
|
67
67
|
createSession?(sessionId: string, payload: SessionRecord, ttl: number): Promise<Result<void>>;
|
|
68
68
|
readSession?(sessionId: string): Promise<Result<SessionRecord>>;
|
|
69
69
|
revokeSession?(sessionId: string): Promise<Result<void>>;
|
|
70
|
+
/**
|
|
71
|
+
* Optional: Pushed Authorization Request (RFC 9126) storage. Persists the
|
|
72
|
+
* pre-parsed `/authorize` parameters under an opaque `request_uri` for
|
|
73
|
+
* one-shot retrieval at `/authorize` time. Strong consistency + atomic
|
|
74
|
+
* delete-on-read — same semantics as `saveFlow` / `consumeFlow`.
|
|
75
|
+
*
|
|
76
|
+
* Adapters without these methods cannot satisfy `/par`; the framework's
|
|
77
|
+
* `/par` handler returns `invalid_request` when called against such a
|
|
78
|
+
* store. Implement both methods together (the framework only exposes
|
|
79
|
+
* the endpoint when both are present).
|
|
80
|
+
*/
|
|
81
|
+
savePar?(requestUri: string, payload: ParRecord, ttl: number): Promise<Result<void>>;
|
|
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>>;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Stored PAR payload. The `params` blob is the raw form/query record from
|
|
109
|
+
* `POST /par`, kept verbatim so the `/authorize` rehydrate path can feed
|
|
110
|
+
* it through the same Zod parser the direct path uses.
|
|
111
|
+
*/
|
|
112
|
+
export type ParRecord = {
|
|
113
|
+
requestUri: string;
|
|
114
|
+
/** Raw key/value record as posted to `/par` (excluding auth fields). */
|
|
115
|
+
params: Record<string, string>;
|
|
116
|
+
clientId: string;
|
|
117
|
+
/** Wall-clock issuance + absolute expiry (ms). */
|
|
118
|
+
issuedAt: number;
|
|
119
|
+
expiresAt: number;
|
|
70
120
|
};
|
|
71
121
|
/** Optional long-lived session payload (used by `createSession` family). */
|
|
72
122
|
export type SessionRecord = {
|
|
@@ -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,CAAA;IAC/D,aAAa,CAAC,CAAC,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; documented eventual lag acceptable.
|
|
90
90
|
*/
|
|
91
91
|
revokeBySubject(tenantId: TenantId, subjectId: string): Promise<Result<void>>;
|
|
92
|
+
/**
|
|
93
|
+
* Optional: DPoP proof replay protection (RFC 9449 §11.1). Atomically
|
|
94
|
+
* record the proof's `jti` and reject if it's been seen within the TTL
|
|
95
|
+
* window. Returns `invalid_grant` (with `reuseSignal` omitted) when a
|
|
96
|
+
* `jti` is already present.
|
|
97
|
+
*
|
|
98
|
+
* Adapters without this method cannot satisfy DPoP at the token /
|
|
99
|
+
* userinfo endpoints; the framework's DPoP verifier returns
|
|
100
|
+
* `invalid_dpop_proof` when called against such a store. Memory adapter
|
|
101
|
+
* implements; production adapters follow in subsequent commits.
|
|
102
|
+
*/
|
|
103
|
+
recordDpopJti?(jti: string, ttlMs: number): Promise<Result<void>>;
|
|
92
104
|
};
|
|
93
105
|
//# sourceMappingURL=token-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-store.d.ts","sourceRoot":"","sources":["../../../src/ports/token-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE/C,MAAM,MAAM,UAAU,GAAG;IACvB;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;IAE9E;;;;;;OAMG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;IAElD;;;OAGG;IACH,WAAW,CACT,OAAO,EAAE,MAAM,EACf,OAAO,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O,EAAE,MAAM,EACf,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;IAExB;;;;;;;;;;;;;;;;;;OAkBG;IACH,cAAc,CACZ,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,GACnC,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAA;IAEvC;;;;;;;;;;;;;OAaG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAA;IAElE;;;;OAIG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;IAEnD;;;OAGG;IACH,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;IAE7E;;;;;;;;;;OAUG;IACH,aAAa,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;CAClE,CAAA"}
|
|
@@ -36,6 +36,29 @@ export type AuthorizationRequest = {
|
|
|
36
36
|
uiLocales?: string[];
|
|
37
37
|
/** Standard OIDC. */
|
|
38
38
|
nonce?: string;
|
|
39
|
+
/**
|
|
40
|
+
* OIDC Core §5.5 — RP-requested claims, parsed from the `claims`
|
|
41
|
+
* parameter's JSON value. The library currently honors claim **names**
|
|
42
|
+
* (additive, bypasses scope gating) but does not enforce the
|
|
43
|
+
* `essential` / `value` / `values` qualifiers.
|
|
44
|
+
*/
|
|
45
|
+
claimsRequest?: ClaimsRequest;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* OIDC Core §5.5 `claims` parameter. Each section maps claim name to an
|
|
49
|
+
* optional qualifier object (`{essential, value, values}`) or `null`
|
|
50
|
+
* meaning "just request the claim without qualifiers".
|
|
51
|
+
*/
|
|
52
|
+
export type ClaimsRequest = {
|
|
53
|
+
/** Claims to include in the `/userinfo` response. */
|
|
54
|
+
userinfo?: Record<string, ClaimRequestEntry | null>;
|
|
55
|
+
/** Claims to include in the `id_token`. */
|
|
56
|
+
id_token?: Record<string, ClaimRequestEntry | null>;
|
|
57
|
+
};
|
|
58
|
+
export type ClaimRequestEntry = {
|
|
59
|
+
essential?: boolean;
|
|
60
|
+
value?: unknown;
|
|
61
|
+
values?: unknown[];
|
|
39
62
|
};
|
|
40
63
|
/**
|
|
41
64
|
* In-memory authorization state produced by `domain/authorize.startAuthorize`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization.d.ts","sourceRoot":"","sources":["../../../src/types/authorization.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,QAAQ,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,6EAA6E;IAC7E,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,qBAAqB;IACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,qBAAqB;IACrB,KAAK,CAAC,E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