@frontmcp/sdk 1.13.1 → 1.13.2
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/auth/auth-ui/auth-ui.render.d.ts +5 -2
- package/auth/auth-ui/auth-ui.render.d.ts.map +1 -1
- package/auth/auth-ui/index.d.ts +1 -1
- package/auth/auth-ui/index.d.ts.map +1 -1
- package/auth/flows/oauth.authorize.flow.d.ts +1 -0
- package/auth/flows/oauth.authorize.flow.d.ts.map +1 -1
- package/auth/flows/oauth.callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.register.flow.d.ts +18 -1
- package/auth/flows/oauth.register.flow.d.ts.map +1 -1
- package/auth/flows/well-known.prm.flow.d.ts +4 -0
- package/auth/flows/well-known.prm.flow.d.ts.map +1 -1
- package/auth/instances/instance.local-primary-auth.d.ts +4 -3
- package/auth/instances/instance.local-primary-auth.d.ts.map +1 -1
- package/auth/instances/instance.remote-primary-auth.d.ts.map +1 -1
- package/browser/auth/auth-ui/auth-ui.render.mjs +9 -8
- package/browser/auth/auth-ui/index.mjs +4 -2
- package/browser/auth/federated-steps.mjs +1 -1
- package/browser/auth/flows/oauth.authorize.flow.mjs +15 -8
- package/browser/auth/flows/oauth.callback.flow.mjs +10 -3
- package/browser/auth/flows/oauth.connect.flow.mjs +1 -1
- package/browser/auth/flows/oauth.provider-callback.flow.mjs +1 -1
- package/browser/auth/flows/oauth.register.flow.mjs +5 -1
- package/browser/auth/flows/well-known.prm.flow.mjs +22 -3
- package/browser/auth/instances/instance.local-primary-auth.mjs +20 -9
- package/browser/auth/instances/instance.remote-primary-auth.mjs +5 -0
- package/browser/common/decorators/http-route.decorator.mjs +9 -1
- package/browser/common/index.mjs +1 -1
- package/browser/common/metadata/index.mjs +1 -1
- package/browser/common/metadata/materialized.metadata.mjs +13 -0
- package/browser/common/metadata/resource.metadata.mjs +6 -5
- package/browser/common/tokens/resource.tokens.mjs +1 -0
- package/browser/common/types/options/http/schema.mjs +17 -1
- package/browser/common/types/options/transport/schema.mjs +11 -1
- package/browser/direct/direct-server.mjs +15 -11
- package/browser/errors/index.mjs +3 -1
- package/browser/errors/mcp.error.mjs +7 -0
- package/browser/errors/transport.errors.mjs +7 -1
- package/browser/event/event-scope.helper.mjs +4 -2
- package/browser/event/event-subscription-info.mjs +55 -0
- package/browser/event/event.registry.mjs +18 -0
- package/browser/event/flows/event-ended.flow.mjs +89 -0
- package/browser/event/flows/event-unsubscribe.flow.mjs +7 -1
- package/browser/event/poll/event-poll-leases.mjs +11 -0
- package/browser/event/stream/event-stream.mjs +4 -0
- package/browser/event/stream/event-streams.mjs +13 -0
- package/browser/event/subscription/event-subscription-termination.mjs +1 -0
- package/browser/event/subscription/event-subscriptions.mjs +18 -2
- package/browser/front-mcp/front-mcp.mjs +13 -0
- package/browser/http-route/flows/http.route.flow.mjs +71 -8
- package/browser/http-route/http-route.table.mjs +61 -15
- package/browser/http-route/people-session-store.mjs +47 -0
- package/browser/http-route/people-sign-in.routes.mjs +3 -2
- package/browser/http-route/sse-route.stream.mjs +19 -8
- package/browser/index.cjs +3011 -2017
- package/browser/index.mjs +24 -3
- package/browser/notification/notification.service.mjs +8 -1
- package/browser/resource/materialized/materialized-resource.context.mjs +3 -1
- package/browser/resource/materialized/materialized-resources.mjs +53 -27
- package/browser/resource/materialized/resource-store.mjs +269 -17
- package/browser/resource/resource.registry.mjs +31 -0
- package/browser/scope/http-scope.helper.mjs +2 -1
- package/browser/scope/scope.instance.mjs +2 -2
- package/browser/server/security/host-validation.mjs +4 -1
- package/browser/server/server.instance.mjs +22 -4
- package/browser/subsystems.mjs +21 -2
- package/browser/tool/flows/call-tool.flow.mjs +3 -3
- package/browser/tool/undeclared-arguments-message.mjs +10 -8
- package/browser/tool/undeclared-arguments.mjs +33 -0
- package/browser/transport/adapters/transport.sse.adapter.mjs +5 -2
- package/browser/transport/adapters/transport.streamable-http.adapter.mjs +3 -1
- package/browser/transport/flows/handle.mcp-20260728.flow.mjs +7 -2
- package/browser/transport/mcp-20260728/subscriptions.mjs +24 -4
- package/browser/transport/stream-keep-alive.mjs +70 -0
- package/browser/transport/transport.registry.mjs +9 -7
- package/browser/transport/web-standard-mcp.mjs +3 -1
- package/common/decorators/http-route.decorator.d.ts +2 -1
- package/common/decorators/http-route.decorator.d.ts.map +1 -1
- package/common/interfaces/http-route.interface.d.ts +9 -1
- package/common/interfaces/http-route.interface.d.ts.map +1 -1
- package/common/metadata/app.metadata.d.ts +8 -0
- package/common/metadata/app.metadata.d.ts.map +1 -1
- package/common/metadata/front-mcp.metadata.d.ts +197 -0
- package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
- package/common/metadata/http-route.metadata.d.ts +11 -3
- package/common/metadata/http-route.metadata.d.ts.map +1 -1
- package/common/metadata/materialized.metadata.d.ts +21 -0
- package/common/metadata/materialized.metadata.d.ts.map +1 -1
- package/common/metadata/resource.metadata.d.ts +8 -1
- package/common/metadata/resource.metadata.d.ts.map +1 -1
- package/common/tokens/resource.tokens.d.ts +1 -0
- package/common/tokens/resource.tokens.d.ts.map +1 -1
- package/common/types/options/auth/index.d.ts +1 -1
- package/common/types/options/auth/index.d.ts.map +1 -1
- package/common/types/options/http/index.d.ts +1 -1
- package/common/types/options/http/index.d.ts.map +1 -1
- package/common/types/options/http/interfaces.d.ts +41 -1
- package/common/types/options/http/interfaces.d.ts.map +1 -1
- package/common/types/options/http/schema.d.ts +12 -0
- package/common/types/options/http/schema.d.ts.map +1 -1
- package/common/types/options/transport/index.d.ts +1 -1
- package/common/types/options/transport/index.d.ts.map +1 -1
- package/common/types/options/transport/interfaces.d.ts +24 -0
- package/common/types/options/transport/interfaces.d.ts.map +1 -1
- package/common/types/options/transport/schema.d.ts +3 -0
- package/common/types/options/transport/schema.d.ts.map +1 -1
- package/direct/direct-server.d.ts +4 -2
- package/direct/direct-server.d.ts.map +1 -1
- package/direct/direct.types.d.ts +7 -0
- package/direct/direct.types.d.ts.map +1 -1
- package/errors/index.d.ts +1 -1
- package/errors/index.d.ts.map +1 -1
- package/errors/mcp.error.d.ts +4 -0
- package/errors/mcp.error.d.ts.map +1 -1
- package/errors/transport.errors.d.ts +4 -0
- package/errors/transport.errors.d.ts.map +1 -1
- package/esm/index.mjs +42 -42
- package/event/event-scope.helper.d.ts.map +1 -1
- package/event/event-subscription-info.d.ts +72 -0
- package/event/event-subscription-info.d.ts.map +1 -0
- package/event/event.registry.d.ts +7 -0
- package/event/event.registry.d.ts.map +1 -1
- package/event/flows/event-ended.flow.d.ts +56 -0
- package/event/flows/event-ended.flow.d.ts.map +1 -0
- package/event/flows/event-unsubscribe.flow.d.ts +4 -1
- package/event/flows/event-unsubscribe.flow.d.ts.map +1 -1
- package/event/index.d.ts +3 -1
- package/event/index.d.ts.map +1 -1
- package/event/poll/event-poll-leases.d.ts +3 -0
- package/event/poll/event-poll-leases.d.ts.map +1 -1
- package/event/stream/event-stream.d.ts +2 -0
- package/event/stream/event-stream.d.ts.map +1 -1
- package/event/stream/event-streams.d.ts +3 -0
- package/event/stream/event-streams.d.ts.map +1 -1
- package/event/subscription/event-subscription-termination.d.ts +4 -1
- package/event/subscription/event-subscription-termination.d.ts.map +1 -1
- package/event/subscription/event-subscriptions.d.ts +19 -1
- package/event/subscription/event-subscriptions.d.ts.map +1 -1
- package/front-mcp/front-mcp.d.ts.map +1 -1
- package/http-route/flows/http.route.flow.d.ts +12 -4
- package/http-route/flows/http.route.flow.d.ts.map +1 -1
- package/http-route/http-route.table.d.ts +10 -3
- package/http-route/http-route.table.d.ts.map +1 -1
- package/http-route/people-session-store.d.ts +24 -0
- package/http-route/people-session-store.d.ts.map +1 -0
- package/http-route/people-sign-in.routes.d.ts +2 -2
- package/http-route/people-sign-in.routes.d.ts.map +1 -1
- package/http-route/sse-route.stream.d.ts +6 -1
- package/http-route/sse-route.stream.d.ts.map +1 -1
- package/index.d.ts +16 -8
- package/index.d.ts.map +1 -1
- package/index.js +43 -43
- package/notification/notification.service.d.ts.map +1 -1
- package/package.json +10 -10
- package/resource/materialized/index.d.ts +1 -1
- package/resource/materialized/index.d.ts.map +1 -1
- package/resource/materialized/materialized-resource.context.d.ts +1 -0
- package/resource/materialized/materialized-resource.context.d.ts.map +1 -1
- package/resource/materialized/materialized-resources.d.ts +11 -5
- package/resource/materialized/materialized-resources.d.ts.map +1 -1
- package/resource/materialized/resource-store.d.ts +31 -1
- package/resource/materialized/resource-store.d.ts.map +1 -1
- package/resource/resource.registry.d.ts +11 -0
- package/resource/resource.registry.d.ts.map +1 -1
- package/scope/http-scope.helper.d.ts +1 -1
- package/scope/http-scope.helper.d.ts.map +1 -1
- package/scope/scope.instance.d.ts.map +1 -1
- package/server/adapters/polyfills/browser-express-host.d.ts +3 -0
- package/server/adapters/polyfills/browser-express-host.d.ts.map +1 -1
- package/server/adapters/polyfills/node-express-host.d.ts +1 -0
- package/server/adapters/polyfills/node-express-host.d.ts.map +1 -1
- package/server/adapters/user-content.listener.d.ts +26 -0
- package/server/adapters/user-content.listener.d.ts.map +1 -0
- package/server/security/host-validation.d.ts.map +1 -1
- package/server/server.instance.d.ts +1 -0
- package/server/server.instance.d.ts.map +1 -1
- package/subsystems.d.ts +1 -1
- package/subsystems.d.ts.map +1 -1
- package/tool/undeclared-arguments-message.d.ts +8 -5
- package/tool/undeclared-arguments-message.d.ts.map +1 -1
- package/tool/undeclared-arguments.d.ts +2 -0
- package/tool/undeclared-arguments.d.ts.map +1 -1
- package/transport/adapters/base-sse-transport.d.ts +4 -0
- package/transport/adapters/base-sse-transport.d.ts.map +1 -1
- package/transport/adapters/polyfills/browser-sse-transport.d.ts +1 -0
- package/transport/adapters/polyfills/browser-sse-transport.d.ts.map +1 -1
- package/transport/adapters/streamable-http-transport.d.ts +2 -0
- package/transport/adapters/streamable-http-transport.d.ts.map +1 -1
- package/transport/adapters/transport.sse.adapter.d.ts.map +1 -1
- package/transport/adapters/transport.streamable-http.adapter.d.ts.map +1 -1
- package/transport/flows/handle.mcp-20260728.flow.d.ts.map +1 -1
- package/transport/mcp-20260728/subscriptions.d.ts +2 -0
- package/transport/mcp-20260728/subscriptions.d.ts.map +1 -1
- package/transport/stream-keep-alive.d.ts +13 -0
- package/transport/stream-keep-alive.d.ts.map +1 -0
- package/transport/transport.registry.d.ts +1 -1
- package/transport/transport.registry.d.ts.map +1 -1
- package/transport/web-standard-mcp.d.ts.map +1 -1
|
@@ -14,10 +14,13 @@ export declare function authUiExtraPath(fullPath: string): string;
|
|
|
14
14
|
* - an `http(s)` URL: its origin (`https://app.example.com:8443`);
|
|
15
15
|
* - a native app's private-use scheme (RFC 8252 §7.1, `com.example.app:/cb`),
|
|
16
16
|
* which has no origin: that scheme;
|
|
17
|
-
* - anything else (unparseable,
|
|
18
|
-
* script or local scheme): nothing, so the redirect stays
|
|
17
|
+
* - anything else (unparseable, a host a CSP source can't express, such as
|
|
18
|
+
* an IPv6 literal, a script or local scheme): nothing, so the redirect stays
|
|
19
|
+
* blocked.
|
|
19
20
|
*/
|
|
20
21
|
export declare function formActionSource(target: string): string | undefined;
|
|
22
|
+
/** The distinct {@link formActionSource} of each of `targets`, leaving out those none can name. */
|
|
23
|
+
export declare function formActionSources(targets: readonly string[]): string[];
|
|
21
24
|
/**
|
|
22
25
|
* The Content-Security-Policy for an auth-UI page.
|
|
23
26
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-ui.render.d.ts","sourceRoot":"","sources":["../../../src/auth/auth-ui/auth-ui.render.ts"],"names":[],"mappings":"AA4CA,OAAO,EAAwB,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC5G,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;;;GAIG;AACH,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIxD;
|
|
1
|
+
{"version":3,"file":"auth-ui.render.d.ts","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AC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,SAAS,CAwChE"}
|
package/auth/auth-ui/index.d.ts
CHANGED
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
*/
|
|
20
20
|
export { AUTH_FLOW_GLOBAL_KEY, type AuthFlowState, type AuthSlot, type AuthProvider, type AuthTool, type FederatedStep, type AuthExtraResult, type AuthUiFileSource, } from './auth-ui.contract';
|
|
21
21
|
export { AuthUiRegistry, type AuthExtraRunResult } from './auth-ui.registry';
|
|
22
|
-
export { AUTH_MOUNT_ID, AUTH_UI_CSP, authUiExtraPath, authUiPageHeaders, authUiSecurityHeaders, buildAuthUiPage, } from './auth-ui.render';
|
|
22
|
+
export { AUTH_MOUNT_ID, AUTH_UI_CSP, authUiExtraPath, authUiPageHeaders, authUiSecurityHeaders, buildAuthUiPage, formActionSources, } from './auth-ui.render';
|
|
23
23
|
export { buildLoginState, buildConsentState, buildFederatedState, buildIncrementalState, buildErrorState, } from './auth-ui.state';
|
|
24
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/auth-ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EACL,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACtB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAG7E,OAAO,EACL,aAAa,EACb,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/auth-ui/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EACL,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACtB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAG7E,OAAO,EACL,aAAa,EACb,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,GAChB,MAAM,iBAAiB,CAAC"}
|
|
@@ -99,6 +99,7 @@ declare const stateSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
|
99
99
|
software_id: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
100
100
|
software_version: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
101
101
|
}, import("zod/v4/core").$strip>>;
|
|
102
|
+
registeredClientAuthMethod: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
102
103
|
}, import("zod/v4/core").$strip>;
|
|
103
104
|
declare const outputSchema: import("@frontmcp/lazy-zod").ZodUnion<readonly [import("@frontmcp/lazy-zod").ZodObject<{
|
|
104
105
|
kind: import("@frontmcp/lazy-zod").ZodLiteral<"redirect">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.authorize.flow.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/oauth.authorize.flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH;;;;;;GAMG;AACH,OAAO,EAiBL,KAAK,4BAA4B,
|
|
1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M,CAAC,QAAQ,CAAC,qBAAqB,CAqB1C;IAEH;;;;;OAKG;IACH;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAUrB,0EAA0E;IAC1E,OAAO,CAAC,SAAS;IAOjB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,uBAAuB;IA4B/B,OAAO,CAAC,kBAAkB;IAqB1B;;;;OAIG;YACW,eAAe;IAgC7B;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAQpB;;;;OAIG;YACW,iBAAiB;IAoB/B;;;;;;;OAOG;IACH,OAAO,CAAC,yBAAyB;IASjC;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IAqB5B;;;;;;;;OAQG;YACW,cAAc;IAgD5B;;;;;;;;;OASG;YACW,sBAAsB;IAgFpC;;;;;;;;;;;;OAYG;YACW,oBAAoB;IA4BlC;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,mBAAmB;IA0C3B,8EAA8E;IAC9E,OAAO,CAAC,QAAQ;IAIhB;;;OAGG;IACH,OAAO,CAAC,eAAe;IAQvB;;OAEG;IACH,OAAO,CAAC,eAAe;CAqDxB;AAYD,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -18,8 +18,24 @@
|
|
|
18
18
|
* allowed to register: 400 `invalid_redirect_uri` for a redirect URI that is not a URL, 400
|
|
19
19
|
* `invalid_client_metadata` for anything else (`redirect_uris` missing or empty, an unknown value).
|
|
20
20
|
* Registered clients are stored on the per-instance {@link DcrClientRegistry}
|
|
21
|
-
* (LocalPrimaryAuth), so the authorize/token flows can validate them
|
|
21
|
+
* (LocalPrimaryAuth), so the authorize/token flows can validate them, and in a
|
|
22
|
+
* Redis or SQLite `tokenStorage` too, so a restart or another instance on it
|
|
23
|
+
* knows them (#1478). A `Did('registerClient')` hook reads the accepted
|
|
24
|
+
* registration from `ctx.state.registered`.
|
|
22
25
|
*/
|
|
26
|
+
/**
|
|
27
|
+
* Quick checklist (security & correctness)
|
|
28
|
+
* - PKCE (S256) required for public clients (and basically for all).
|
|
29
|
+
* - Use authorization code grant only (no implicit/hybrid).
|
|
30
|
+
* - Rotate refresh tokens and bind them to client + user + scopes.
|
|
31
|
+
* - Prefer private_key_jwt or mTLS for confidential clients.
|
|
32
|
+
* - PAR + JAR recommended for higher security.
|
|
33
|
+
* - Consider DPoP (proof-of-possession) to reduce token replay.
|
|
34
|
+
* - Keep codes very short-lived (e.g., ≤60 s) and single-use.
|
|
35
|
+
* - Publish discovery and JWKS, rotate keys safely.
|
|
36
|
+
* - Decide JWT vs opaque access tokens; provide introspection if opaque.
|
|
37
|
+
*/
|
|
38
|
+
import { type RegisteredClient } from '@frontmcp/auth';
|
|
23
39
|
import { FlowBase, type FlowRunOptions } from '../../common';
|
|
24
40
|
declare const inputSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
25
41
|
request: import("zod").ZodCustom<Record<string, unknown>, Record<string, unknown>>;
|
|
@@ -74,6 +90,7 @@ declare const stateSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
|
74
90
|
}>>;
|
|
75
91
|
}, import("zod/v4/core").$loose>;
|
|
76
92
|
dcrEnabled: import("@frontmcp/lazy-zod").ZodBoolean;
|
|
93
|
+
registered: import("@frontmcp/lazy-zod").ZodOptional<import("zod").ZodCustom<RegisteredClient, RegisteredClient>>;
|
|
77
94
|
}, import("zod/v4/core").$strip>;
|
|
78
95
|
declare const plan: {
|
|
79
96
|
readonly pre: ["checkIpFilter", "acquireQuota", "parseInput", "validateInput"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.register.flow.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/oauth.register.flow.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"oauth.register.flow.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/oauth.register.flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,EAAyB,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAI9E,OAAO,EAIL,QAAQ,EAOR,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AAGtB,QAAA,MAAM,WAAW;;;;gCAAkB,CAAC;AACpC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;gCAAiB,CAAC;AA8BpC,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAMf,CAAC;AAEH,QAAA,MAAM,IAAI;;;;CAI2B,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,gBAAgB,EAAE,cAAc,CAC9B,iBAAiB,EACjB,OAAO,IAAI,EACX,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,OAAO,WAAW,CACnB,CAAC;KACH;CACF;AAED,QAAA,MAAM,IAAI,EAAG,gBAAyB,CAAC;AAkCvC,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,QAAQ,CAAC,OAAO,IAAI,CAAC;IAClE,OAAO,CAAC,UAAU,CAAC,CAAmB;IACtC,4GAA4G;IAC5G,OAAO,CAAC,eAAe,CAAC,CAAW;IAEnC,4EAA4E;IAC5E,OAAO,KAAK,SAAS,GAEpB;IAGK,aAAa;IAKb,YAAY;IAKZ,UAAU;IAaV,aAAa;IA8Ib,cAAc;IA+Cd,mBAAmB;IAiCnB,cAAc;CAGrB;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -10,6 +10,8 @@ declare const stateSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
|
10
10
|
baseUrl: import("@frontmcp/lazy-zod").ZodString;
|
|
11
11
|
authorizationServer: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
12
12
|
scopesSupported: import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>;
|
|
13
|
+
clientId: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
14
|
+
audience: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
13
15
|
isOrchestrated: import("@frontmcp/lazy-zod").ZodBoolean;
|
|
14
16
|
}, import("zod/v4/core").$strip>;
|
|
15
17
|
declare const outputSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
@@ -37,6 +39,8 @@ declare const outputSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
|
37
39
|
authorization_servers: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>>;
|
|
38
40
|
scopes_supported: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>>;
|
|
39
41
|
bearer_methods_supported: import("@frontmcp/lazy-zod").ZodDefault<import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>>;
|
|
42
|
+
client_id: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
43
|
+
audience: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
40
44
|
}, import("zod/v4/core").$loose>;
|
|
41
45
|
}, import("zod/v4/core").$strip>;
|
|
42
46
|
declare const plan: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"well-known.prm.flow.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/well-known.prm.flow.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,CAAC;AAK1B,OAAO,EAKL,QAAQ,
|
|
1
|
+
{"version":3,"file":"well-known.prm.flow.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/well-known.prm.flow.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,CAAC;AAK1B,OAAO,EAKL,QAAQ,EAQR,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAItB,QAAA,MAAM,WAAW;;;;gCAAkB,CAAC;AAEpC,QAAA,MAAM,WAAW;;;;;;;;gCAWf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAWhB,CAAC;AAEH,QAAA,MAAM,IAAI;;;;CAI2B,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,qCAAqC,EAAE,cAAc,CACnD,gBAAgB,EAChB,OAAO,IAAI,EACX,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,OAAO,WAAW,CACnB,CAAC;KACH;CACF;AAED,QAAA,MAAM,IAAI,EAAG,qCAA8C,CAAC;AAa5D,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,QAAQ,CAAC,OAAO,IAAI,CAAC;IACjE,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU;IAKtD,aAAa;IAKb,YAAY;IAKZ,UAAU;IA4CY,WAAW;CA+CxC"}
|
|
@@ -456,9 +456,10 @@ export declare class LocalPrimaryAuth extends FrontMcpAuth<LocalPrimaryAuthOptio
|
|
|
456
456
|
/**
|
|
457
457
|
* Refuse a grant the client did not declare in its `grant_types` (RFC 7591): in its registration, its
|
|
458
458
|
* `dcr.clients` entry or its client ID metadata document. A client that declared nothing (an unregistered
|
|
459
|
-
* id under `requireRegisteredClients: false`, or one registered on another instance or before a restart
|
|
460
|
-
* is not limited, and gets `grantTypes: undefined` and `authMethod: undefined`. A CIMD client whose document
|
|
461
|
-
* declares `private_key_jwt` must also present a valid client assertion.
|
|
459
|
+
* id under `requireRegisteredClients: false`, or one registered on another instance or before a restart
|
|
460
|
+
* with a memory token storage) is not limited, and gets `grantTypes: undefined` and `authMethod: undefined`. A CIMD client whose document
|
|
461
|
+
* declares `private_key_jwt` must also present a valid client assertion. `registered` is the registration the token
|
|
462
|
+
* request read with `load`.
|
|
462
463
|
*/
|
|
463
464
|
private checkDeclaredGrant;
|
|
464
465
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instance.local-primary-auth.d.ts","sourceRoot":"","sources":["../../../src/auth/instances/instance.local-primary-auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAcjB,sBAAsB,EAOtB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"instance.local-primary-auth.d.ts","sourceRoot":"","sources":["../../../src/auth/instances/instance.local-primary-auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAcjB,sBAAsB,EAOtB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,aAAa,EAGlB,KAAK,kBAAkB,EAEvB,KAAK,oBAAoB,EAEzB,KAAK,sBAAsB,IAAI,UAAU,EACzC,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAOL,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAGL,YAAY,EAIZ,KAAK,cAAc,EACnB,KAAK,GAAG,EACR,KAAK,UAAU,EACf,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAKL,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACvB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,KAAK,gBAAgB,MAAM,kCAAkC,CAAC;AA2BrE;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;AAiBnH;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ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C,6BAA6B;YAUvB,iBAAiB;CAQhC"}
|
|
@@ -5,6 +5,7 @@ function authUiExtraPath(fullPath) {
|
|
|
5
5
|
return `${fullPath.replace(/\/+$/, "")}/oauth/ui/extra`;
|
|
6
6
|
}
|
|
7
7
|
var UNSAFE_FORM_TARGET_SCHEMES = /* @__PURE__ */ new Set(["javascript:", "data:", "blob:", "filesystem:", "about:", "file:"]);
|
|
8
|
+
var CSP_SOURCE_HOST = /^[a-z0-9.-]+$/;
|
|
8
9
|
function formActionSource(target) {
|
|
9
10
|
let url;
|
|
10
11
|
try {
|
|
@@ -13,17 +14,16 @@ function formActionSource(target) {
|
|
|
13
14
|
return void 0;
|
|
14
15
|
}
|
|
15
16
|
if (url.protocol === "http:" || url.protocol === "https:") {
|
|
16
|
-
return url.hostname
|
|
17
|
+
return CSP_SOURCE_HOST.test(url.hostname) ? url.origin : void 0;
|
|
17
18
|
}
|
|
18
19
|
if (!/^[a-z][a-z0-9+.-]*:$/.test(url.protocol) || UNSAFE_FORM_TARGET_SCHEMES.has(url.protocol)) return void 0;
|
|
19
20
|
return url.protocol;
|
|
20
21
|
}
|
|
22
|
+
function formActionSources(targets) {
|
|
23
|
+
const sources = targets.map(formActionSource).filter((source) => source !== void 0);
|
|
24
|
+
return [...new Set(sources)];
|
|
25
|
+
}
|
|
21
26
|
function authUiCsp(formTargets = []) {
|
|
22
|
-
const formAction = /* @__PURE__ */ new Set(["'self'"]);
|
|
23
|
-
for (const target of formTargets) {
|
|
24
|
-
const source = formActionSource(target);
|
|
25
|
-
if (source) formAction.add(source);
|
|
26
|
-
}
|
|
27
27
|
return [
|
|
28
28
|
"default-src 'self'",
|
|
29
29
|
"script-src 'self' 'unsafe-inline' https://esm.sh",
|
|
@@ -32,7 +32,7 @@ function authUiCsp(formTargets = []) {
|
|
|
32
32
|
"img-src 'self' data: https:",
|
|
33
33
|
"frame-ancestors 'none'",
|
|
34
34
|
"base-uri 'self'",
|
|
35
|
-
`form-action ${[...
|
|
35
|
+
`form-action ${["'self'", ...formActionSources(formTargets)].join(" ")}`
|
|
36
36
|
].join("; ");
|
|
37
37
|
}
|
|
38
38
|
var AUTH_UI_CSP = authUiCsp();
|
|
@@ -120,5 +120,6 @@ export {
|
|
|
120
120
|
authUiPageHeaders,
|
|
121
121
|
authUiSecurityHeaders,
|
|
122
122
|
buildAuthUiPage,
|
|
123
|
-
formActionSource
|
|
123
|
+
formActionSource,
|
|
124
|
+
formActionSources
|
|
124
125
|
};
|
|
@@ -9,7 +9,8 @@ import {
|
|
|
9
9
|
authUiExtraPath,
|
|
10
10
|
authUiPageHeaders,
|
|
11
11
|
authUiSecurityHeaders,
|
|
12
|
-
buildAuthUiPage
|
|
12
|
+
buildAuthUiPage,
|
|
13
|
+
formActionSources
|
|
13
14
|
} from "./auth-ui.render.mjs";
|
|
14
15
|
import {
|
|
15
16
|
buildLoginState,
|
|
@@ -31,5 +32,6 @@ export {
|
|
|
31
32
|
buildErrorState,
|
|
32
33
|
buildFederatedState,
|
|
33
34
|
buildIncrementalState,
|
|
34
|
-
buildLoginState
|
|
35
|
+
buildLoginState,
|
|
36
|
+
formActionSources
|
|
35
37
|
};
|
|
@@ -174,7 +174,7 @@ function renderFederatedStep(scope, record, options) {
|
|
|
174
174
|
csrfToken,
|
|
175
175
|
error: options.error
|
|
176
176
|
});
|
|
177
|
-
return httpRespond.html(markup, 200, builtInAuthPageHeaders());
|
|
177
|
+
return httpRespond.html(markup, 200, builtInAuthPageHeaders({ csp: "inline" }));
|
|
178
178
|
}
|
|
179
179
|
function providerAuthorizationEndpoints(scope, providerIds) {
|
|
180
180
|
const localAuth = scope.auth;
|
|
@@ -50,7 +50,8 @@ import {
|
|
|
50
50
|
buildAuthUiPage,
|
|
51
51
|
buildFederatedState,
|
|
52
52
|
buildIncrementalState,
|
|
53
|
-
buildLoginState
|
|
53
|
+
buildLoginState,
|
|
54
|
+
formActionSources
|
|
54
55
|
} from "../auth-ui/index.mjs";
|
|
55
56
|
import { incrementalTicketAudience, initialAuthorizedApps } from "../authorized-apps.utils.mjs";
|
|
56
57
|
import { CimdDisabledError, CimdError, CimdService, clientMetadataDocumentSchema } from "../cimd/index.mjs";
|
|
@@ -137,7 +138,8 @@ var stateSchema = z.object({
|
|
|
137
138
|
requiresConsent: z.boolean().default(false).describe("Whether consent flow is enabled"),
|
|
138
139
|
// CIMD (Client ID Metadata Documents)
|
|
139
140
|
isCimdClient: z.boolean().default(false).describe("Whether client_id is a CIMD URL"),
|
|
140
|
-
cimdMetadata: clientMetadataDocumentSchema.optional().describe("CIMD metadata document for the client")
|
|
141
|
+
cimdMetadata: clientMetadataDocumentSchema.optional().describe("CIMD metadata document for the client"),
|
|
142
|
+
registeredClientAuthMethod: z.string().optional().describe("How the registered client validated here authenticates at the token endpoint")
|
|
141
143
|
});
|
|
142
144
|
var outputSchema = z.union([
|
|
143
145
|
HttpRedirectSchema,
|
|
@@ -371,7 +373,9 @@ var OauthAuthorizeFlow = class extends FlowBase {
|
|
|
371
373
|
this.respondWithError([redirectError], void 0, rawState);
|
|
372
374
|
return;
|
|
373
375
|
}
|
|
374
|
-
|
|
376
|
+
let loaded;
|
|
377
|
+
if (!isCimdClientId) loaded = registry?.load ? await registry.load(client_id) : registry?.get?.(client_id);
|
|
378
|
+
if (cimdService && !cimdService.enabled && cimdService.isCimdClientId(client_id) && !loaded) {
|
|
375
379
|
const disabled = new CimdDisabledError();
|
|
376
380
|
this.logger.warn(`OAuth authorize: CIMD client_id refused, CIMD is disabled: ${client_id}`);
|
|
377
381
|
this.respondWithError([disabled.message], void 0, rawState);
|
|
@@ -401,7 +405,7 @@ var OauthAuthorizeFlow = class extends FlowBase {
|
|
|
401
405
|
return;
|
|
402
406
|
}
|
|
403
407
|
}
|
|
404
|
-
const registered =
|
|
408
|
+
const registered = loaded;
|
|
405
409
|
if (registered) {
|
|
406
410
|
if (!registered.redirect_uris.includes(redirect_uri)) {
|
|
407
411
|
this.logger.warn(`OAuth authorize: redirect_uri "${redirect_uri}" not registered for client "${client_id}"`);
|
|
@@ -410,6 +414,7 @@ var OauthAuthorizeFlow = class extends FlowBase {
|
|
|
410
414
|
}
|
|
411
415
|
redirectVerified = true;
|
|
412
416
|
declaredClientScope = registered.scope;
|
|
417
|
+
this.state.set("registeredClientAuthMethod", registered.token_endpoint_auth_method);
|
|
413
418
|
}
|
|
414
419
|
const clientIdError = isCimdClientId ? void 0 : this.checkDcrClientIdAllowlist(client_id);
|
|
415
420
|
if (clientIdError) {
|
|
@@ -733,7 +738,7 @@ var OauthAuthorizeFlow = class extends FlowBase {
|
|
|
733
738
|
});
|
|
734
739
|
const auth = this.scope.metadata.auth;
|
|
735
740
|
const customRender = !!(auth && auth.mode === "local" && auth.login?.render);
|
|
736
|
-
this.respond(httpRespond.html(loginHtml, 200, builtInAuthPageHeaders({ csp:
|
|
741
|
+
this.respond(httpRespond.html(loginHtml, 200, builtInAuthPageHeaders({ csp: customRender ? false : "inline" })));
|
|
737
742
|
}
|
|
738
743
|
/**
|
|
739
744
|
* Render a custom `@AuthUi` slot when one is registered for this scope.
|
|
@@ -792,7 +797,7 @@ var OauthAuthorizeFlow = class extends FlowBase {
|
|
|
792
797
|
*/
|
|
793
798
|
/** How the client validated here authenticates at the token endpoint: its CIMD document's or registration's method. */
|
|
794
799
|
clientAuthMethodOf(clientId, localAuth) {
|
|
795
|
-
return this.state.cimdMetadata?.token_endpoint_auth_method ?? localAuth.dcrClientRegistry.get(clientId)?.token_endpoint_auth_method ?? "none";
|
|
800
|
+
return this.state.cimdMetadata?.token_endpoint_auth_method ?? this.state.registeredClientAuthMethod ?? localAuth.dcrClientRegistry.get(clientId)?.token_endpoint_auth_method ?? "none";
|
|
796
801
|
}
|
|
797
802
|
async startRemoteFederation(pendingAuthId, validatedRequest) {
|
|
798
803
|
const auth = this.scope.auth;
|
|
@@ -858,7 +863,7 @@ var OauthAuthorizeFlow = class extends FlowBase {
|
|
|
858
863
|
}
|
|
859
864
|
/** An HTML response with the built-in auth pages' security headers (#263). */
|
|
860
865
|
htmlPage(markup, status = 200) {
|
|
861
|
-
return httpRespond.html(markup, status, builtInAuthPageHeaders());
|
|
866
|
+
return httpRespond.html(markup, status, builtInAuthPageHeaders({ csp: "inline" }));
|
|
862
867
|
}
|
|
863
868
|
/**
|
|
864
869
|
* Enforce the local-AS DCR `allowedRedirectUris` (#462) at authorize time,
|
|
@@ -931,7 +936,7 @@ var OauthAuthorizeFlow = class extends FlowBase {
|
|
|
931
936
|
* callback error re-render stay in sync.
|
|
932
937
|
*/
|
|
933
938
|
renderLoginPage(params) {
|
|
934
|
-
const { pendingAuthId, clientId, clientName, scope, logoUri } = params;
|
|
939
|
+
const { pendingAuthId, clientId, clientName, scope, redirectUri, logoUri } = params;
|
|
935
940
|
const callbackPath = `${oauthBasePath(this.scope)}/oauth/callback`;
|
|
936
941
|
const auth = this.scope.metadata.auth;
|
|
937
942
|
const login = auth && auth.mode === "local" ? auth.login : void 0;
|
|
@@ -942,6 +947,8 @@ var OauthAuthorizeFlow = class extends FlowBase {
|
|
|
942
947
|
scopes: scope ? scope.split(" ").filter(Boolean) : [],
|
|
943
948
|
pendingAuthId,
|
|
944
949
|
callbackPath,
|
|
950
|
+
redirectUri,
|
|
951
|
+
formTargets: formActionSources([redirectUri]),
|
|
945
952
|
fields: login?.fields ?? {}
|
|
946
953
|
};
|
|
947
954
|
return renderLocalLoginPage(login, ctx);
|
|
@@ -43,7 +43,12 @@ import {
|
|
|
43
43
|
StageHookOf
|
|
44
44
|
} from "../../common/index.mjs";
|
|
45
45
|
import { oauthBasePath } from "../../flows/flow.http-path.mjs";
|
|
46
|
-
import {
|
|
46
|
+
import {
|
|
47
|
+
authUiExtraPath,
|
|
48
|
+
buildAuthUiPage,
|
|
49
|
+
buildConsentState,
|
|
50
|
+
formActionSources
|
|
51
|
+
} from "../auth-ui/index.mjs";
|
|
47
52
|
import { initialAuthorizedApps, withoutSkippedApps } from "../authorized-apps.utils.mjs";
|
|
48
53
|
import { projectConsentTools } from "../consent-tools.helper.mjs";
|
|
49
54
|
import {
|
|
@@ -300,7 +305,7 @@ var OauthCallbackFlow = class extends FlowBase {
|
|
|
300
305
|
httpRespond.html(
|
|
301
306
|
this.renderLoginRetryPage(pendingAuth, localOptions.login, loginFields ?? {}, result),
|
|
302
307
|
200,
|
|
303
|
-
builtInAuthPageHeaders({ csp:
|
|
308
|
+
builtInAuthPageHeaders({ csp: localOptions.login?.render ? false : "inline" })
|
|
304
309
|
)
|
|
305
310
|
);
|
|
306
311
|
return;
|
|
@@ -916,6 +921,8 @@ var OauthCallbackFlow = class extends FlowBase {
|
|
|
916
921
|
scopes: pendingAuth.scopes ?? [],
|
|
917
922
|
pendingAuthId: this.state.required.pendingAuthId,
|
|
918
923
|
callbackPath,
|
|
924
|
+
redirectUri: pendingAuth.redirectUri,
|
|
925
|
+
formTargets: formActionSources([pendingAuth.redirectUri]),
|
|
919
926
|
fields: login?.fields ?? {},
|
|
920
927
|
error: failure.message
|
|
921
928
|
};
|
|
@@ -1120,7 +1127,7 @@ var OauthCallbackFlow = class extends FlowBase {
|
|
|
1120
1127
|
}
|
|
1121
1128
|
/** An HTML response with the built-in auth pages' security headers (#263). */
|
|
1122
1129
|
htmlPage(markup, status = 200) {
|
|
1123
|
-
return httpRespond.html(markup, status, builtInAuthPageHeaders());
|
|
1130
|
+
return httpRespond.html(markup, status, builtInAuthPageHeaders({ csp: "inline" }));
|
|
1124
1131
|
}
|
|
1125
1132
|
/**
|
|
1126
1133
|
* Generate a stable user sub from email
|
|
@@ -165,7 +165,7 @@ var OauthConnectFlow = class extends FlowBase {
|
|
|
165
165
|
}
|
|
166
166
|
/** An HTML response with the built-in auth pages' security headers (#263). */
|
|
167
167
|
htmlPage(markup, status = 200) {
|
|
168
|
-
return httpRespond.html(markup, status, builtInAuthPageHeaders());
|
|
168
|
+
return httpRespond.html(markup, status, builtInAuthPageHeaders({ csp: "inline" }));
|
|
169
169
|
}
|
|
170
170
|
/** Render the single-field connect page (reusing the login field renderer). */
|
|
171
171
|
renderConnectPage(payload, login, token, error) {
|
|
@@ -786,7 +786,7 @@ var OauthProviderCallbackFlow = class extends FlowBase {
|
|
|
786
786
|
}
|
|
787
787
|
/** An HTML response with the built-in auth pages' security headers (#263). */
|
|
788
788
|
htmlPage(markup, status = 200) {
|
|
789
|
-
return httpRespond.html(markup, status, builtInAuthPageHeaders());
|
|
789
|
+
return httpRespond.html(markup, status, builtInAuthPageHeaders({ csp: "inline" }));
|
|
790
790
|
}
|
|
791
791
|
getStateValidation() {
|
|
792
792
|
const authOptions = this.scope.auth?.options;
|
|
@@ -50,7 +50,9 @@ var registrationRequestSchema = z.object({
|
|
|
50
50
|
var stateSchema = z.object({
|
|
51
51
|
body: registrationRequestSchema,
|
|
52
52
|
/** Whether DCR is active (explicit `dcr.enabled` or the dev/prod default). */
|
|
53
|
-
dcrEnabled: z.boolean()
|
|
53
|
+
dcrEnabled: z.boolean(),
|
|
54
|
+
/** The registration the server accepted, set by `registerClient`: a confidential client's `client_secret` included. */
|
|
55
|
+
registered: z.custom().optional()
|
|
54
56
|
});
|
|
55
57
|
var plan = {
|
|
56
58
|
pre: ["checkIpFilter", "acquireQuota", "parseInput", "validateInput"],
|
|
@@ -241,6 +243,8 @@ var OauthRegisterFlow = class extends FlowBase {
|
|
|
241
243
|
);
|
|
242
244
|
return;
|
|
243
245
|
}
|
|
246
|
+
await this.localAuth.dcrClientRegistry.persist(this.registered);
|
|
247
|
+
this.state.set("registered", this.registered);
|
|
244
248
|
}
|
|
245
249
|
async respondRegistration() {
|
|
246
250
|
const c = this.registered;
|
|
@@ -23,9 +23,11 @@ import {
|
|
|
23
23
|
httpInputSchema,
|
|
24
24
|
HttpJsonSchema,
|
|
25
25
|
makeWellKnownPaths,
|
|
26
|
+
normalizeEntryPrefix,
|
|
26
27
|
StageHookOf
|
|
27
28
|
} from "../../common/index.mjs";
|
|
28
29
|
import { FlowInputMissingError } from "../../errors/sdk.errors.mjs";
|
|
30
|
+
import { transparentTokenAudiences } from "../transparent-audience.mjs";
|
|
29
31
|
var inputSchema = httpInputSchema;
|
|
30
32
|
var stateSchema = z.object({
|
|
31
33
|
resource: z.string().min(1),
|
|
@@ -34,6 +36,9 @@ var stateSchema = z.object({
|
|
|
34
36
|
// public and static mode, which have no authorization server.
|
|
35
37
|
authorizationServer: z.string().min(1).optional(),
|
|
36
38
|
scopesSupported: z.array(z.string()),
|
|
39
|
+
// What a transparent server's `auth.resourceMetadata` publishes for its clients (#1360).
|
|
40
|
+
clientId: z.string().min(1).optional(),
|
|
41
|
+
audience: z.string().min(1).optional(),
|
|
37
42
|
isOrchestrated: z.boolean()
|
|
38
43
|
});
|
|
39
44
|
var outputSchema = HttpJsonSchema.extend({
|
|
@@ -41,7 +46,9 @@ var outputSchema = HttpJsonSchema.extend({
|
|
|
41
46
|
resource: z.string().min(1),
|
|
42
47
|
authorization_servers: z.array(z.string().min(1)).min(1).optional(),
|
|
43
48
|
scopes_supported: z.array(z.string()).optional(),
|
|
44
|
-
bearer_methods_supported: z.array(z.string()).default(["header"])
|
|
49
|
+
bearer_methods_supported: z.array(z.string()).default(["header"]),
|
|
50
|
+
client_id: z.string().min(1).optional(),
|
|
51
|
+
audience: z.string().min(1).optional()
|
|
45
52
|
}).passthrough()
|
|
46
53
|
});
|
|
47
54
|
var plan = {
|
|
@@ -74,12 +81,14 @@ var WellKnownPrmFlow = class extends FlowBase {
|
|
|
74
81
|
const orchestrated = authOptions?.mode === "local" || authOptions?.mode === "remote";
|
|
75
82
|
const hasAuthorizationServer = authOptions?.mode !== "public" && authOptions?.mode !== "static";
|
|
76
83
|
const scopesSupported = orchestrated ? granted : [.../* @__PURE__ */ new Set([...granted, ...scope.getAllSupportedScopes()])];
|
|
84
|
+
const signIn = authOptions?.mode === "transparent" ? transparentSignInDetails(authOptions, request, scope) : void 0;
|
|
77
85
|
this.state.set(
|
|
78
86
|
stateSchema.parse({
|
|
79
87
|
resource,
|
|
80
88
|
baseUrl,
|
|
81
89
|
authorizationServer: hasAuthorizationServer ? authorizationServer : void 0,
|
|
82
90
|
scopesSupported,
|
|
91
|
+
...signIn,
|
|
83
92
|
isOrchestrated: false
|
|
84
93
|
//scope.orchestrated,// TODO: fix
|
|
85
94
|
})
|
|
@@ -87,7 +96,7 @@ var WellKnownPrmFlow = class extends FlowBase {
|
|
|
87
96
|
}
|
|
88
97
|
async collectData() {
|
|
89
98
|
const { resource, scopesSupported, isOrchestrated } = this.state.required;
|
|
90
|
-
const { authorizationServer } = this.state;
|
|
99
|
+
const { authorizationServer, clientId, audience } = this.state;
|
|
91
100
|
const scopes = scopesSupported.length > 0 ? { scopes_supported: scopesSupported } : {};
|
|
92
101
|
const authorizationServers = authorizationServer ? { authorization_servers: [authorizationServer] } : {};
|
|
93
102
|
if (isOrchestrated) {
|
|
@@ -108,6 +117,7 @@ var WellKnownPrmFlow = class extends FlowBase {
|
|
|
108
117
|
});
|
|
109
118
|
return;
|
|
110
119
|
}
|
|
120
|
+
const signIn = { ...clientId ? { client_id: clientId } : {}, ...audience ? { audience } : {} };
|
|
111
121
|
this.respond({
|
|
112
122
|
kind: "json",
|
|
113
123
|
status: 200,
|
|
@@ -117,7 +127,8 @@ var WellKnownPrmFlow = class extends FlowBase {
|
|
|
117
127
|
resource,
|
|
118
128
|
...authorizationServers,
|
|
119
129
|
...scopes,
|
|
120
|
-
bearer_methods_supported: ["header"]
|
|
130
|
+
bearer_methods_supported: ["header"],
|
|
131
|
+
...signIn
|
|
121
132
|
}
|
|
122
133
|
});
|
|
123
134
|
}
|
|
@@ -146,6 +157,14 @@ WellKnownPrmFlow = __decorateClass([
|
|
|
146
157
|
}
|
|
147
158
|
})
|
|
148
159
|
], WellKnownPrmFlow);
|
|
160
|
+
function transparentSignInDetails(options, request, scope) {
|
|
161
|
+
const { clientId, audience } = options.resourceMetadata ?? {};
|
|
162
|
+
const requestBaseUrl = getRequestBaseUrl(request, normalizeEntryPrefix(scope.entryPath));
|
|
163
|
+
return {
|
|
164
|
+
clientId: (clientId === true ? options.clientId : clientId) || void 0,
|
|
165
|
+
audience: audience === true ? transparentTokenAudiences(options, requestBaseUrl, scope).find((value) => value.length > 0) : audience
|
|
166
|
+
};
|
|
167
|
+
}
|
|
149
168
|
export {
|
|
150
169
|
WellKnownPrmFlow as default
|
|
151
170
|
};
|