@_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.
- 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 +23 -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 +27 -27
- package/dist/esm/domain/authorize.js +2 -2
- package/dist/esm/domain/callback.js +121 -7
- package/dist/esm/domain/client-auth.js +2 -2
- package/dist/esm/domain/crypto.js +14 -14
- package/dist/esm/domain/discovery.js +2 -2
- package/dist/esm/domain/dpop.js +4 -4
- package/dist/esm/domain/id-token.js +5 -5
- package/dist/esm/domain/jwt.js +4 -4
- package/dist/esm/domain/method-dispatch.js +27 -1
- package/dist/esm/domain/method-route.js +80 -1
- package/dist/esm/domain/par.js +2 -2
- package/dist/esm/domain/pkce.js +2 -2
- package/dist/esm/domain/revoke.js +2 -2
- package/dist/esm/domain/state-envelope.js +2 -2
- package/dist/esm/domain/token.js +5 -5
- 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 +3 -19
- package/dist/esm/http/handlers/callback.js +7 -1
- package/dist/esm/http/handlers/metadata.js +2 -2
- package/dist/esm/http/handlers/method-route.js +47 -2
- package/dist/esm/http/handlers/revocation.js +2 -2
- package/dist/esm/http/middleware/tenant.js +6 -6
- package/dist/esm/http/schemas/authorize.js +2 -2
- package/dist/esm/http/schemas/revocation.js +2 -2
- package/dist/esm/http/schemas/token.js +7 -7
- package/dist/esm/index.js +33 -32
- 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/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 +3 -0
- package/dist/types/adapters/memory/session-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/domain/callback.d.ts +16 -1
- package/dist/types/domain/callback.d.ts.map +1 -1
- 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/http/context.d.ts +3 -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/callback.d.ts.map +1 -1
- package/dist/types/http/handlers/method-route.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- 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 +18 -5
- package/dist/types/ports/audit-log.d.ts.map +1 -1
- package/dist/types/ports/session-store.d.ts +23 -0
- package/dist/types/ports/session-store.d.ts.map +1 -1
- package/dist/types/types/idp.d.ts +71 -0
- 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/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 +39 -0
- package/src/adapters/postgres/migrations.ts +6 -0
- package/src/adapters/postgres/session-store.ts +69 -0
- package/src/domain/callback.ts +215 -7
- package/src/domain/method-dispatch.ts +53 -1
- package/src/domain/method-route.ts +190 -1
- package/src/http/context.ts +6 -0
- package/src/http/cookies.ts +19 -1
- package/src/http/handlers/authorize.ts +2 -21
- package/src/http/handlers/callback.ts +9 -1
- package/src/http/handlers/method-route.ts +75 -2
- package/src/index.ts +3 -0
- 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 +25 -0
- package/src/ports/audit-log.ts +18 -5
- package/src/ports/session-store.ts +28 -0
- package/src/types/idp.ts +74 -0
- package/src/types/method.ts +110 -0
|
@@ -16,5 +16,8 @@ export declare class PostgresSessionStore implements SessionStore {
|
|
|
16
16
|
createSession(sessionId: string, payload: SessionRecord, ttl: number): Promise<Result<void>>;
|
|
17
17
|
readSession(sessionId: string): Promise<Result<SessionRecord>>;
|
|
18
18
|
revokeSession(sessionId: string): Promise<Result<void>>;
|
|
19
|
+
saveScratch(key: string, value: string, ttlMs: number): Promise<Result<void>>;
|
|
20
|
+
readScratch(key: string): Promise<Result<string>>;
|
|
21
|
+
deleteScratch(key: string): Promise<Result<void>>;
|
|
19
22
|
}
|
|
20
23
|
//# sourceMappingURL=session-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-store.d.ts","sourceRoot":"","sources":["../../../../src/adapters/postgres/session-store.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC5E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAGhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,gBAAgB,CAAA;I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Error } from "../types/error";
|
|
27
27
|
import type { SetCookie, CachePolicy } from "../types/method";
|
|
28
28
|
import type { Result } from "../types/result";
|
|
29
|
-
import type { StateKeyRing } from "../types/tenant";
|
|
29
|
+
import type { StateKeyRing, TenantContext } from "../types/tenant";
|
|
30
30
|
import { MethodCache } from "./method-cache";
|
|
31
31
|
export type CallbackOutput = {
|
|
32
32
|
kind: "issue-code";
|
|
@@ -47,6 +47,21 @@ export type HandleCallbackInput = {
|
|
|
47
47
|
/** The raw `Request` for the upstream provider's redirect. */
|
|
48
48
|
rawRequest: Request;
|
|
49
49
|
cookies: ReadonlyMap<string, string>;
|
|
50
|
+
/**
|
|
51
|
+
* Resolved tenant for this request. The SP-initiated path derives
|
|
52
|
+
* the tenant from the consumed flow and ignores this. The
|
|
53
|
+
* **IdP-initiated** path (unsolicited POST, no flow) has nothing to
|
|
54
|
+
* derive from, so it uses this — populated by the HTTP layer from
|
|
55
|
+
* the tenant middleware. Absent ⇒ IdP-initiated is not attempted.
|
|
56
|
+
*/
|
|
57
|
+
tenant?: TenantContext;
|
|
58
|
+
/**
|
|
59
|
+
* Per-request issuer URL (HTTP layer). Used only by the
|
|
60
|
+
* IdP-initiated path to derive the SP entityID / ACS — the same
|
|
61
|
+
* derivation the AuthnRequest and metadata paths use, so the values
|
|
62
|
+
* cannot drift.
|
|
63
|
+
*/
|
|
64
|
+
issuerUrl?: string;
|
|
50
65
|
};
|
|
51
66
|
export type HandleCallbackDeps = {
|
|
52
67
|
configStore: ConfigStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callback.d.ts","sourceRoot":"","sources":["../../../src/domain/callback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAw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ch.d.ts","sourceRoot":"","sources":["../../../src/domain/method-dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,KAAK,EACV,UAAU,EAEV,kBAAkB,EAClB,YAAY,
|
|
1
|
+
{"version":3,"file":"method-dispatch.d.ts","sourceRoot":"","sources":["../../../src/domain/method-dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,KAAK,EACV,UAAU,EAEV,kBAAkB,EAClB,YAAY,EAEb,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C,OAAO,KAAK,EAAE,aAAa,EAAY,MAAM,iBAAiB,CAAA;AAE9D,MAAM,MAAM,QAAQ,GAAG,GAAG,KAAK,GAAG,MAAM,IAAI,MAAM,EAAE,CAAA;AAEpD,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,UAAU,CAAA;IAClB,KAAK,EAAE,QAAQ,CAAA;IACf,MAAM,EAAE,aAAa,CAAA;IACrB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,UAAU,GAAG,IAAI,CAAA;IACvB,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpC,YAAY,EAAE,YAAY,CAAA;IAC1B,wDAAwD;IACxD,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAAA;CACpC,CAAA;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,KAAK,EAAE,aAAa,GACnB,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC,CAqD5D"}
|
|
@@ -31,10 +31,12 @@ import type { KeyStore } from "../ports/key-store";
|
|
|
31
31
|
import type { SessionStore } from "../ports/session-store";
|
|
32
32
|
import type { TokenStore } from "../ports/token-store";
|
|
33
33
|
import { type AuthError } from "../types/error";
|
|
34
|
-
import type {
|
|
34
|
+
import type { LogoutEventInput, LogoutHookResult } from "../types/idp";
|
|
35
|
+
import type { AuthMethod, CachePolicy, MethodDispatchData, SetCookie } from "../types/method";
|
|
35
36
|
import type { Result } from "../types/result";
|
|
36
37
|
import type { TenantContext } from "../types/tenant";
|
|
37
38
|
import { MethodCache } from "./method-cache";
|
|
39
|
+
import { type RouteKey } from "./method-dispatch";
|
|
38
40
|
export type MethodRouteOutput = {
|
|
39
41
|
kind: "issue-code";
|
|
40
42
|
code: string;
|
|
@@ -74,4 +76,58 @@ export type HandleMethodRouteDeps = {
|
|
|
74
76
|
newCodeId?: () => string;
|
|
75
77
|
};
|
|
76
78
|
export declare function handleMethodRoute(input: HandleMethodRouteInput, deps: HandleMethodRouteDeps): Promise<Result<MethodRouteOutput, AuthError>>;
|
|
79
|
+
/**
|
|
80
|
+
* Anonymous public method route — the fourth, deliberately narrow,
|
|
81
|
+
* pipeline. Used only for route keys a method explicitly lists in
|
|
82
|
+
* `AuthMethod.publicRoutes` (today: SAML SP `GET /metadata`). No flow
|
|
83
|
+
* cookie, no flow record, no `SessionStore` read: the handler is a pure
|
|
84
|
+
* function of `tenant` + `dispatch` + captured config.
|
|
85
|
+
*
|
|
86
|
+
* Security: this re-checks `publicRoutes` membership against the
|
|
87
|
+
* resolved method. The HTTP layer also checks before routing here, but
|
|
88
|
+
* a domain function guarding a no-auth path must not trust its caller —
|
|
89
|
+
* the gate is enforced here too, fail-closed.
|
|
90
|
+
*
|
|
91
|
+
* Only `challenge` (the metadata document) and `denied` are sensible
|
|
92
|
+
* outcomes; `success` from a flowless route is a programming error
|
|
93
|
+
* (there is no flow to consume into an auth code) and surfaces as an
|
|
94
|
+
* internal error rather than silently authenticating.
|
|
95
|
+
*/
|
|
96
|
+
export type HandlePublicMethodRouteInput = {
|
|
97
|
+
rawRequest: Request;
|
|
98
|
+
tenant: TenantContext;
|
|
99
|
+
/** Pre-resolved by the HTTP layer (it needed it to detect the public route). */
|
|
100
|
+
method: AuthMethod;
|
|
101
|
+
route: RouteKey;
|
|
102
|
+
subPath: string;
|
|
103
|
+
/** Issuer/callback context so the handler can derive stable URLs. */
|
|
104
|
+
dispatch: MethodDispatchData;
|
|
105
|
+
};
|
|
106
|
+
export type HandlePublicMethodRouteDeps = {
|
|
107
|
+
sessionStore: SessionStore;
|
|
108
|
+
/**
|
|
109
|
+
* Required for the upstream-logout path: when a public route returns a
|
|
110
|
+
* `challenge` carrying `logout`, the framework runs
|
|
111
|
+
* `revokeAllForSubject` for the host-named subject. Anonymous read-only
|
|
112
|
+
* public routes (`/metadata`-style) never touch this.
|
|
113
|
+
*/
|
|
114
|
+
tokenStore: TokenStore;
|
|
115
|
+
clock: () => number;
|
|
116
|
+
auditLog?: AuditLog;
|
|
117
|
+
/**
|
|
118
|
+
* See `IdPOptions.onLogout`. Absent ⇒ the framework still verifies +
|
|
119
|
+
* acknowledges the logout and audits it, but revokes nothing (it
|
|
120
|
+
* cannot resolve the upstream id to a subject without the host).
|
|
121
|
+
*/
|
|
122
|
+
onLogout?: (input: LogoutEventInput) => Promise<LogoutHookResult> | LogoutHookResult;
|
|
123
|
+
};
|
|
124
|
+
export type PublicMethodRouteOutput = {
|
|
125
|
+
kind: "challenge";
|
|
126
|
+
response: Response;
|
|
127
|
+
cache?: CachePolicy;
|
|
128
|
+
} | {
|
|
129
|
+
kind: "denied";
|
|
130
|
+
reason: string;
|
|
131
|
+
};
|
|
132
|
+
export declare function handlePublicMethodRoute(input: HandlePublicMethodRouteInput, deps: HandlePublicMethodRouteDeps): Promise<Result<PublicMethodRouteOutput, AuthError>>;
|
|
77
133
|
//# sourceMappingURL=method-route.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method-route.d.ts","sourceRoot":"","sources":["../../../src/domain/method-route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"method-route.d.ts","sourceRoot":"","sources":["../../../src/domain/method-route.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACtE,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,kBAAkB,EAElB,SAAS,EACV,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C,O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import type { MethodCache } from "../domain/method-cache";
|
|
16
16
|
import type { AuthError } from "../types/error";
|
|
17
|
-
import type { ExchangeAudience, PersistUpstreamTokens, RegisterClient, RenderPicker, SuccessMapInput } from "../types/idp";
|
|
17
|
+
import type { ExchangeAudience, LogoutEventInput, LogoutHookResult, PersistUpstreamTokens, RegisterClient, RenderPicker, SuccessMapInput } from "../types/idp";
|
|
18
18
|
import type { Result } from "../types/result";
|
|
19
19
|
import type { SubjectClaim } from "../types/subject";
|
|
20
20
|
import type { StateKeyRing, TenantContext, TenantId, TenantRecovery } from "../types/tenant";
|
|
@@ -35,6 +35,8 @@ export type HttpDeps = {
|
|
|
35
35
|
callbackHostFor?: (tenantId: TenantId) => string;
|
|
36
36
|
resolveTenant: (req: Request) => Promise<Result<TenantId, AuthError>>;
|
|
37
37
|
success: (input: SuccessMapInput) => Promise<SubjectClaim>;
|
|
38
|
+
/** See `IdPOptions.onLogout` — upstream Single Logout host hook. */
|
|
39
|
+
onLogout?: (input: LogoutEventInput) => Promise<LogoutHookResult> | LogoutHookResult;
|
|
38
40
|
persistUpstreamTokens?: PersistUpstreamTokens;
|
|
39
41
|
exchangeAudience?: ExchangeAudience;
|
|
40
42
|
renderPicker?: RenderPicker;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/http/context.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC,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,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AG,OAAO,CAAC,OAAO,CAAC,CAAA;AAE1C,qEAAqE;AACrE,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,QAAQ,CAEV"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* strip method-returned `Set-Cookie` / security / `Cache-Control` headers so
|
|
8
8
|
* methods cannot bypass policy.
|
|
9
9
|
*/
|
|
10
|
-
import type { SetCookie } from "../types/method";
|
|
10
|
+
import type { CachePolicy, SetCookie } from "../types/method";
|
|
11
11
|
/** Parse an incoming `Cookie:` header into a read-only map. */
|
|
12
12
|
export declare function parseCookieHeader(header: string | null): Map<string, string>;
|
|
13
13
|
export type CookieDefaults = {
|
|
@@ -26,6 +26,14 @@ export type CookieDefaults = {
|
|
|
26
26
|
* - `null` value → `Max-Age=0` to clear.
|
|
27
27
|
*/
|
|
28
28
|
export declare function serializeSetCookie(cookie: SetCookie, defaults?: CookieDefaults): string;
|
|
29
|
+
/**
|
|
30
|
+
* Serialize a `MethodResult.challenge`'s `CachePolicy` into a
|
|
31
|
+
* `Cache-Control` header value. The framework owns this header (methods
|
|
32
|
+
* cannot set it directly — see `STRIPPED_HEADERS`); a method opts into
|
|
33
|
+
* caching via the typed `cache` field and this renders it. Absent /
|
|
34
|
+
* `maxAge: 0` ⇒ `no-store` (the safe default for auth UI).
|
|
35
|
+
*/
|
|
36
|
+
export declare function cacheControlHeader(cache: CachePolicy | undefined): string;
|
|
29
37
|
export type ApplyOptions = {
|
|
30
38
|
setCookies?: SetCookie[];
|
|
31
39
|
cookieDefaults?: CookieDefaults;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../../src/http/cookies.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../../src/http/cookies.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE7D,+DAA+D;AAC/D,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAsB5E;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,0DAA0D;IAC1D,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAsBD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,EACjB,QAAQ,GAAE,cAAmB,GAC5B,MAAM,CA4BR;AAgBD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,MAAM,CASzE;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,CAAC,EAAE,SAAS,EAAE,CAAA;IACxB,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,iFAAiF;IACjF,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,QAAQ,EAClB,IAAI,GAAE,YAAiB,GACtB,QAAQ,CA4BV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callback.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/callback.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGvD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,OAC/B,WAAW,KAAG,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"callback.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/callback.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGvD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,OAC/B,WAAW,KAAG,OAAO,CAAC,QAAQ,CAAC,CAmEjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method-route.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/method-route.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"method-route.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/method-route.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGvD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,QAAQ,OAClC,WAAW,KAAG,OAAO,CAAC,QAAQ,CAAC,CA0JjD"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export type { AuthMethod, AuthMethodFactory, CachePolicy, ClientFn, MethodContex
|
|
|
20
20
|
export type { AuthorizationRequest, AuthorizationState, } from "./types/authorization";
|
|
21
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, RegisterClient, RegisterClientRequest, RegisterClientResponse, 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";
|
|
@@ -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;AAE9B,YAAY,EACV,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,GACd,MAAM,eAAe,CAAA;AAEtB,YAAY,EACV,YAAY,EACZ,cAAc,EACd,aAAa,GACd,MAAM,iBAAiB,CAAA;AAExB,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,GAAG,EACH,UAAU,EACV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a,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"}
|