@frontmcp/sdk 1.8.2 → 1.8.3
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/agent/agent.instance.d.ts +14 -3
- package/agent/agent.instance.d.ts.map +1 -1
- package/agent/agent.scope.d.ts +6 -0
- package/agent/agent.scope.d.ts.map +1 -1
- package/agent/agent.utils.d.ts.map +1 -1
- package/auth/auth-ui/auth-ui.render.d.ts +31 -0
- package/auth/auth-ui/auth-ui.render.d.ts.map +1 -1
- package/auth/auth-ui/auth-ui.state.d.ts.map +1 -1
- package/auth/flows/form-body.utils.d.ts +9 -0
- package/auth/flows/form-body.utils.d.ts.map +1 -0
- package/auth/flows/oauth.authorize.flow.d.ts +21 -3
- package/auth/flows/oauth.authorize.flow.d.ts.map +1 -1
- package/auth/flows/oauth.callback.flow.d.ts +29 -10
- package/auth/flows/oauth.callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.connect.flow.d.ts +2 -0
- package/auth/flows/oauth.connect.flow.d.ts.map +1 -1
- package/auth/flows/oauth.provider-callback.flow.d.ts +30 -10
- package/auth/flows/oauth.provider-callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.register.flow.d.ts.map +1 -1
- package/auth/flows/oauth.token.flow.d.ts +5 -0
- package/auth/flows/oauth.token.flow.d.ts.map +1 -1
- package/auth/flows/session.verify.flow.d.ts.map +1 -1
- package/auth/flows/signin-binding.utils.d.ts +44 -0
- package/auth/flows/signin-binding.utils.d.ts.map +1 -0
- package/auth/instances/instance.local-primary-auth.d.ts +58 -15
- package/auth/instances/instance.local-primary-auth.d.ts.map +1 -1
- package/common/availability/availability.utils.d.ts +28 -0
- package/common/availability/availability.utils.d.ts.map +1 -1
- package/common/availability/index.d.ts +1 -1
- package/common/availability/index.d.ts.map +1 -1
- package/common/decorators/plugin.decorator.d.ts.map +1 -1
- package/common/interfaces/internal/primary-auth-provider.interface.d.ts +8 -6
- package/common/interfaces/internal/primary-auth-provider.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 +32 -0
- package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
- package/common/metadata/hook.metadata.d.ts +13 -0
- package/common/metadata/hook.metadata.d.ts.map +1 -1
- package/common/metadata/plugin.metadata.d.ts +11 -0
- package/common/metadata/plugin.metadata.d.ts.map +1 -1
- package/common/schemas/http-output.schema.d.ts +5 -0
- package/common/schemas/http-output.schema.d.ts.map +1 -1
- package/common/tokens/plugin.tokens.d.ts +1 -0
- package/common/tokens/plugin.tokens.d.ts.map +1 -1
- package/common/utils/enforced-metadata.utils.d.ts +17 -0
- package/common/utils/enforced-metadata.utils.d.ts.map +1 -0
- package/completion/flows/complete.flow.d.ts.map +1 -1
- package/context/call-surface.d.ts +9 -0
- package/context/call-surface.d.ts.map +1 -0
- package/context/index.d.ts +2 -0
- package/context/index.d.ts.map +1 -1
- package/context/running-tool.d.ts +14 -0
- package/context/running-tool.d.ts.map +1 -0
- package/direct/connect.d.ts.map +1 -1
- package/direct/direct-server.d.ts +2 -1
- package/direct/direct-server.d.ts.map +1 -1
- package/elicitation/elicitation.types.d.ts +6 -0
- package/elicitation/elicitation.types.d.ts.map +1 -1
- package/elicitation/helpers/fallback.helper.d.ts +18 -0
- package/elicitation/helpers/fallback.helper.d.ts.map +1 -1
- package/elicitation/send-elicitation-result.tool.d.ts.map +1 -1
- package/errors/elicitation.error.d.ts +23 -1
- package/errors/elicitation.error.d.ts.map +1 -1
- package/errors/index.d.ts +2 -1
- package/errors/index.d.ts.map +1 -1
- package/errors/plugin.errors.d.ts +14 -0
- package/errors/plugin.errors.d.ts.map +1 -0
- package/esm/index.mjs +2385 -1212
- package/front-mcp/front-mcp.d.ts +6 -0
- package/front-mcp/front-mcp.d.ts.map +1 -1
- package/hooks/hook.registry.d.ts +2 -0
- package/hooks/hook.registry.d.ts.map +1 -1
- package/index.d.ts +5 -4
- package/index.d.ts.map +1 -1
- package/index.js +3046 -1888
- package/package.json +11 -11
- package/plugin/enforced-metadata.check.d.ts +29 -0
- package/plugin/enforced-metadata.check.d.ts.map +1 -0
- package/plugin/plugin.registry.d.ts.map +1 -1
- package/prompt/flows/get-prompt.flow.d.ts.map +1 -1
- package/prompt/flows/prompts-list.flow.d.ts.map +1 -1
- package/provider/provider.registry.d.ts +11 -0
- package/provider/provider.registry.d.ts.map +1 -1
- package/resource/flows/read-resource.flow.d.ts.map +1 -1
- package/resource/flows/resource-templates-list.flow.d.ts.map +1 -1
- package/resource/flows/resources-list.flow.d.ts.map +1 -1
- package/scope/flows/http.request.flow.d.ts.map +1 -1
- package/scope/flows/request-log.redaction.d.ts +13 -0
- package/scope/flows/request-log.redaction.d.ts.map +1 -0
- package/scope/scope.instance.d.ts.map +1 -1
- package/scope/scope.registry.d.ts +7 -0
- package/scope/scope.registry.d.ts.map +1 -1
- package/server/server.validation.d.ts.map +1 -1
- package/skill/auth/index.d.ts +2 -2
- package/skill/auth/index.d.ts.map +1 -1
- package/skill/auth/skill-http-auth.d.ts +44 -13
- package/skill/auth/skill-http-auth.d.ts.map +1 -1
- package/skill/flows/http/llm-full-txt.flow.d.ts +1 -0
- package/skill/flows/http/llm-full-txt.flow.d.ts.map +1 -1
- package/skill/flows/http/llm-txt.flow.d.ts +1 -0
- package/skill/flows/http/llm-txt.flow.d.ts.map +1 -1
- package/skill/flows/http/skills-api.flow.d.ts +5 -8
- package/skill/flows/http/skills-api.flow.d.ts.map +1 -1
- package/skill/index.d.ts +2 -2
- package/skill/index.d.ts.map +1 -1
- package/skill/skill-filter.helper.d.ts +17 -4
- package/skill/skill-filter.helper.d.ts.map +1 -1
- package/skill/skill-instructions.helper.d.ts.map +1 -1
- package/skill/skill.registry.d.ts +6 -1
- package/skill/skill.registry.d.ts.map +1 -1
- package/task/runtime/execute-task.d.ts.map +1 -1
- package/task/task.types.d.ts +6 -0
- package/task/task.types.d.ts.map +1 -1
- package/tool/flows/call-tool.flow.d.ts.map +1 -1
- package/tool/flows/tools-list.flow.d.ts.map +1 -1
- package/transport/mcp-20260728/result-decorator.d.ts +14 -4
- package/transport/mcp-20260728/result-decorator.d.ts.map +1 -1
- package/transport/mcp-handlers/call-tool-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/complete-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/get-prompt-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/list-prompts-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/list-resource-templates-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/list-resources-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/list-tools-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/mcp-surface.d.ts +22 -0
- package/transport/mcp-handlers/mcp-surface.d.ts.map +1 -0
- package/transport/mcp-handlers/read-resource-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/skills-list-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/skills-load-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/skills-search-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/subscribe-request.handler.d.ts.map +1 -1
- package/transport/web-response.renderer.d.ts.map +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CallToolRequest, type Tool } from '@frontmcp/protocol';
|
|
2
|
-
import { AgentContext, AgentEntry, type AgentCallArgs, type AgentCallExtra, type AgentInputOf, type AgentLlmAdapter, type AgentOutputOf, type AgentRecord, type EntryOwnerRef, type ParsedAgentResult, type SafeTransformResult, type ScopeEntry, type ToolInputType, type ToolOutputType } from '../common';
|
|
2
|
+
import { AgentContext, AgentEntry, type AgentCallArgs, type AgentCallExtra, type AgentInputOf, type AgentLlmAdapter, type AgentOutputOf, type AgentRecord, type EntryOwnerRef, type ParsedAgentResult, type SafeTransformResult, type ScopeEntry, type ToolEntry, type ToolInputType, type ToolOutputType } from '../common';
|
|
3
3
|
import type HookRegistry from '../hooks/hook.registry';
|
|
4
4
|
import type ProviderRegistry from '../provider/provider.registry';
|
|
5
5
|
import { ToolInstance } from '../tool/tool.instance';
|
|
@@ -104,8 +104,9 @@ export declare class AgentInstance<InSchema extends ToolInputType = ToolInputTyp
|
|
|
104
104
|
/**
|
|
105
105
|
* Build ToolMetadata from AgentMetadata.
|
|
106
106
|
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
107
|
+
* The agent is listed and called only through this tool, so everything the agent declares
|
|
108
|
+
* that gates a tool (availability, limits, and every plugin extension such as `authorities`,
|
|
109
|
+
* `approval` or `featureFlag`) is copied onto it.
|
|
109
110
|
*/
|
|
110
111
|
private buildAgentToolMetadata;
|
|
111
112
|
/**
|
|
@@ -124,6 +125,11 @@ export declare class AgentInstance<InSchema extends ToolInputType = ToolInputTyp
|
|
|
124
125
|
* @returns The agent's ToolInstance, or null if not created
|
|
125
126
|
*/
|
|
126
127
|
getToolInstance(): ToolInstance | null;
|
|
128
|
+
/**
|
|
129
|
+
* The tools this agent can call: those it declares and those its plugins contribute, as its private
|
|
130
|
+
* scope holds them. Empty until the agent is initialized.
|
|
131
|
+
*/
|
|
132
|
+
getAgentTools(): readonly ToolEntry[];
|
|
127
133
|
getMetadata(): import("../common").AgentMetadata<Readonly<{
|
|
128
134
|
[k: string]: import("zod/v4/core").$ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
129
135
|
}>, ToolOutputType>;
|
|
@@ -173,6 +179,11 @@ export declare class AgentInstance<InSchema extends ToolInputType = ToolInputTyp
|
|
|
173
179
|
* @returns A function that executes tools by name
|
|
174
180
|
*/
|
|
175
181
|
private createToolExecutor;
|
|
182
|
+
/**
|
|
183
|
+
* The `checkEntryAuthorities` stage of tools:call-tool, for a tool this agent runs directly
|
|
184
|
+
* (`execution.useToolFlow: false`): the caller the agent runs for must satisfy the tool's `authorities`.
|
|
185
|
+
*/
|
|
186
|
+
private assertToolAuthorized;
|
|
176
187
|
/**
|
|
177
188
|
* Extract the actual result from MCP CallToolResult format.
|
|
178
189
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.instance.d.ts","sourceRoot":"","sources":["../../src/agent/agent.instance.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent.instance.d.ts","sourceRoot":"","sources":["../../src/agent/agent.instance.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,eAAe,EAAyC,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG5G,OAAO,EACL,YAAY,EACZ,UAAU,EAEV,KAAK,aAAa,EAClB,KAAK,cAAc,EAGnB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,WAAW,EAEhB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,aAAa,EAElB,KAAK,cAAc,EACpB,MAAM,WAAW,CAAC;AAUnB,OAAO,KAAK,YAAY,MAAM,wBAAwB,CAAC;AAEvD,OAAO,KAAK,gBAAgB,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AA8CrD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,aAAa,CACxB,QAAQ,SAAS,aAAa,GAAG,aAAa,EAC9C,SAAS,SAAS,cAAc,GAAG,cAAc,EACjD,EAAE,GAAG,YAAY,CAAC;IAAE,WAAW,EAAE,QAAQ,CAAA;CAAE,CAAC,EAC5C,GAAG,GAAG,aAAa,CAAC;IAAE,YAAY,EAAE,SAAS,CAAA;CAAE,CAAC,CAChD,SAAQ,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,GAAG,CAAC;IAChD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAmB;IAC7C,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CA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AE,eAAe,CAAC,QAAQ,CAAC,GAAG,aAAa;IAK3D,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,GAAG,iBAAiB;IAKjE,eAAe,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,GAAG,mBAAmB,CAAC,iBAAiB,CAAC;IAQnG;;;;;OAKG;IACM,iBAAiB,IAAI,IAAI;IA+BlC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAanB,gBAAgB,IAAI,OAAO;IAI3B,WAAW,IAAI,OAAO;IAItB,kBAAkB,IAAI,MAAM,EAAE;CAGxC"}
|
package/agent/agent.scope.d.ts
CHANGED
|
@@ -76,6 +76,12 @@ export declare class AgentScope {
|
|
|
76
76
|
get toolUI(): import("../tool/ui").ToolUIRegistry | undefined;
|
|
77
77
|
get skills(): import("@frontmcp/sdk").SkillRegistryInterface;
|
|
78
78
|
get scopeMetadata(): import("../common").ScopeMetadata;
|
|
79
|
+
/** The server's authorities engine: the agent's tools answer to its rules like every other tool. */
|
|
80
|
+
get authoritiesEngine(): import("@frontmcp/auth").AuthoritiesEngine | undefined;
|
|
81
|
+
/** The server's builder for the context `authorities` rules are evaluated against (claims mapping included). */
|
|
82
|
+
get authoritiesContextBuilder(): import("@frontmcp/auth").AuthoritiesContextBuilder | undefined;
|
|
83
|
+
/** The server's mapping from authority denials to OAuth scope challenges. */
|
|
84
|
+
get authoritiesScopeMapping(): import("@frontmcp/auth").AuthoritiesScopeMapping | undefined;
|
|
79
85
|
registryFlows(...flows: FlowType[]): Promise<void>;
|
|
80
86
|
runFlow<Name extends FlowName>(name: Name, input: FlowInputOf<Name>, deps?: Map<Token, Type>): Promise<FlowOutputOf<Name> | undefined>;
|
|
81
87
|
runFlowForOutput<Name extends FlowName>(name: Name, input: FlowInputOf<Name>, deps?: Map<Token, Type>): Promise<FlowOutputOf<Name>>;
|
|
@@ -1 +1 @@
|
|
|
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CAAC,KAAK,EAAE,IAAI,CAAC,GACtB,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;IAIpC,gBAAgB,CAAC,IAAI,SAAS,QAAQ,EAC1C,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,EACxB,IAAI,CAAC,EAAE,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,GACtB,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;CAO/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.utils.d.ts","sourceRoot":"","sources":["../../src/agent/agent.utils.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,KAAK,EAAa,MAAM,cAAc,CAAC;AAErD,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,MAAM,WAAW,CAAC;AAQnB;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAGzF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAIlG;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,QAAQ,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"agent.utils.d.ts","sourceRoot":"","sources":["../../src/agent/agent.utils.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,KAAK,KAAK,EAAa,MAAM,cAAc,CAAC;AAErD,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,MAAM,WAAW,CAAC;AAQnB;;GAE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AuthUiRegistry } from './auth-ui.registry';
|
|
|
8
8
|
export { AUTH_MOUNT_ID };
|
|
9
9
|
/** Path the auth extra submissions POST to (action discriminates the extra). */
|
|
10
10
|
export declare function authUiExtraPath(fullPath: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* The CSP source expression that lets a form submission end at `target`, or
|
|
13
|
+
* `undefined` when none can name it exactly:
|
|
14
|
+
* - an `http(s)` URL: its origin (`https://app.example.com:8443`);
|
|
15
|
+
* - a native app's private-use scheme (RFC 8252 §7.1, `com.example.app:/cb`),
|
|
16
|
+
* which has no origin: that scheme;
|
|
17
|
+
* - anything else (unparseable, an IPv6 host a CSP source can't express, a
|
|
18
|
+
* script or local scheme): nothing, so the redirect stays blocked.
|
|
19
|
+
*/
|
|
20
|
+
export declare function formActionSource(target: string): string | undefined;
|
|
11
21
|
/**
|
|
12
22
|
* The Content-Security-Policy for an auth-UI page.
|
|
13
23
|
*
|
|
@@ -17,11 +27,26 @@ export declare function authUiExtraPath(fullPath: string): string;
|
|
|
17
27
|
* user input). It does NOT include `'unsafe-eval'` — the TSX→JS transform is
|
|
18
28
|
* done server-side, so the browser never evals source. Framing is denied to
|
|
19
29
|
* prevent clickjacking of the login / consent form.
|
|
30
|
+
*
|
|
31
|
+
* `form-action` allows this server plus the origin of each of `formTargets`:
|
|
32
|
+
* the URLs the server may redirect a submission of the page's form to (the
|
|
33
|
+
* client's validated `redirect_uri`, an upstream provider's authorization
|
|
34
|
+
* endpoint). Browsers apply `form-action` to those redirects, so with `'self'`
|
|
35
|
+
* alone the sign-in would stop at the callback.
|
|
36
|
+
*
|
|
37
|
+
* @param formTargets - Where a submission of the page's form may be redirected
|
|
20
38
|
*/
|
|
39
|
+
export declare function authUiCsp(formTargets?: readonly string[]): string;
|
|
40
|
+
/** The auth-UI CSP for a page whose form can only reach this server (see {@link authUiCsp}). */
|
|
21
41
|
export declare const AUTH_UI_CSP: string;
|
|
22
42
|
/**
|
|
23
43
|
* Build the auth security headers for an auth-UI page (CSP + anti-clickjacking).
|
|
24
44
|
*
|
|
45
|
+
* `Referrer-Policy: same-origin`, as on the built-in pages: the page's URL
|
|
46
|
+
* stays away from esm.sh, while a POST of its form still carries its `Origin`,
|
|
47
|
+
* which `/oauth/callback` checks (`no-referrer` would send `Origin: null`, and
|
|
48
|
+
* the callback would refuse every sign-in as cross-origin).
|
|
49
|
+
*
|
|
25
50
|
* @param csp - Override the CSP value (defaults to {@link AUTH_UI_CSP}).
|
|
26
51
|
*/
|
|
27
52
|
export declare function authUiPageHeaders(csp?: string): Record<string, string>;
|
|
@@ -42,6 +67,12 @@ export declare function buildAuthUiPage(options: {
|
|
|
42
67
|
fullPath: string;
|
|
43
68
|
/** Page <title> (defaults to a slot-appropriate label). */
|
|
44
69
|
title?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Where the server may redirect a submission of the page's form (the
|
|
72
|
+
* validated `redirect_uri`, upstream authorization endpoints); their origins
|
|
73
|
+
* are allowed in the CSP `form-action` (see {@link authUiCsp}).
|
|
74
|
+
*/
|
|
75
|
+
formTargets?: readonly string[];
|
|
45
76
|
}): {
|
|
46
77
|
html: string;
|
|
47
78
|
headers: Record<string, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-ui.render.d.ts","sourceRoot":"","sources":["../../../src/auth/auth-ui/auth-ui.render.ts"],"names":[],"mappings":"AA+CA,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;AAED
|
|
1
|
+
{"version":3,"file":"auth-ui.render.d.ts","sourceRoot":"","sources":["../../../src/auth/auth-ui/auth-ui.render.ts"],"names":[],"mappings":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"","sources":["../../../src/auth/auth-ui/auth-ui.state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"auth-ui.state.d.ts","sourceRoot":"","sources":["../../../src/auth/auth-ui/auth-ui.state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,YAAY,EAEjB,KAAK,QAAQ,EACd,MAAM,oBAAoB,CAAC;AAS5B,+DAA+D;AAC/D,UAAU,UAAU;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,8DAA8D;IAC9D,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;CACxC;AAED,oCAAoC;AACpC,wBAAgB,eAAe,CAC7B,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACvG,aAAa,CAef;AAED,sCAAsC;AACtC,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,QAAQ,EAAE,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GACvF,aAAa,CAcf;AAED,wCAAwC;AACxC,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,YAAY,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAC9F,aAAa,CAgBf;AAED,0CAA0C;AAC1C,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,UAAU,EAClB,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACtG,aAAa,CAkBf;AAED,mEAAmE;AACnE,wBAAgB,eAAe,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,aAAa,CAM9F"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A POSTed HTML form body as a record.
|
|
3
|
+
*
|
|
4
|
+
* The Node host hands the flows an already-parsed object; the fetch handler
|
|
5
|
+
* hands over the raw `application/x-www-form-urlencoded` string. Repeated keys
|
|
6
|
+
* (checkbox groups such as `tools`) become arrays.
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseFormBody(body: unknown): Record<string, unknown>;
|
|
9
|
+
//# sourceMappingURL=form-body.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-body.utils.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/form-body.utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASpE"}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { type IncrementalAuthTicketPayload } from '@frontmcp/auth';
|
|
20
20
|
import { z } from '@frontmcp/lazy-zod';
|
|
21
|
-
import { FlowBase, type FlowRunOptions } from '../../common';
|
|
21
|
+
import { FlowBase, type FlowOutputOf, type FlowRunOptions } from '../../common';
|
|
22
22
|
/**
|
|
23
23
|
* Validated OAuth authorization request for orchestrated mode
|
|
24
24
|
*/
|
|
@@ -184,6 +184,17 @@ export default class OauthAuthorizeFlow extends FlowBase<typeof name> {
|
|
|
184
184
|
*/
|
|
185
185
|
private resolveIssuer;
|
|
186
186
|
private logger;
|
|
187
|
+
/** The sign-in binding cookie, once the pending authorization exists (see `prepareAuthorizationRequest`). */
|
|
188
|
+
private signinCookie;
|
|
189
|
+
/** Its hash, kept on the pending authorization and on remote mode's federated session. */
|
|
190
|
+
private signinBindingHash;
|
|
191
|
+
/**
|
|
192
|
+
* Respond, giving the browser the sign-in binding cookie once a pending
|
|
193
|
+
* authorization was created: the sign-in page, the provider-selection and
|
|
194
|
+
* incremental pages, a custom `auth.ui` page and remote mode's redirect to the
|
|
195
|
+
* upstream provider all carry it.
|
|
196
|
+
*/
|
|
197
|
+
respond(output: FlowOutputOf<typeof name>): void;
|
|
187
198
|
checkIpFilter(): Promise<void>;
|
|
188
199
|
parseInput(): Promise<void>;
|
|
189
200
|
validateInput(): Promise<void>;
|
|
@@ -207,10 +218,15 @@ export default class OauthAuthorizeFlow extends FlowBase<typeof name> {
|
|
|
207
218
|
* pending authorization record (so the callback can verify it across nodes),
|
|
208
219
|
* builds the {@link AuthFlowState} via `buildState`, SSRs the registered
|
|
209
220
|
* component, and responds with the assembled page + CSP / anti-clickjacking
|
|
210
|
-
* headers.
|
|
211
|
-
*
|
|
221
|
+
* headers. `formTargets` are where the callback may redirect a submission of
|
|
222
|
+
* the page (the validated `redirect_uri`, upstream authorization endpoints):
|
|
223
|
+
* the page's CSP `form-action` allows their origins. Returns `true` when it
|
|
224
|
+
* handled the slot (caller should `return`), `false` to fall through to the
|
|
225
|
+
* built-in page (no renderer / build failed).
|
|
212
226
|
*/
|
|
213
227
|
private tryRenderCustomSlot;
|
|
228
|
+
/** The authorization endpoints of the upstream providers among `providerIds` (others have none). */
|
|
229
|
+
private providerAuthorizationEndpoints;
|
|
214
230
|
/**
|
|
215
231
|
* Remote mode (`mode: 'remote'`) auto-federation.
|
|
216
232
|
*
|
|
@@ -229,6 +245,8 @@ export default class OauthAuthorizeFlow extends FlowBase<typeof name> {
|
|
|
229
245
|
*/
|
|
230
246
|
private startRemoteFederation;
|
|
231
247
|
validateOutput(): Promise<void>;
|
|
248
|
+
/** An HTML response with the built-in auth pages' security headers (#263). */
|
|
249
|
+
private htmlPage;
|
|
232
250
|
/**
|
|
233
251
|
* Enforce the local-AS DCR allowlists (#462) at authorize time. Returns a
|
|
234
252
|
* human-readable rejection reason, or `undefined` when the request is allowed
|
|
@@ -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,
|
|
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,EAgBL,KAAK,4BAA4B,EAIlC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,CAAC,EAAiB,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAIL,QAAQ,EAUR,KAAK,YAAY,EAEjB,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;AAyEtB;;GAEG;AACH,QAAA,MAAM,2BAA2B;;;;;;;;;gCAS/B,CAAC;AAEH;;GAEG;AACH,QAAA,MAAM,+BAA+B;;;gCAGnC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,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AAC,iBAAiB;IAkBzB;;OAEG;IACH,OAAO,CAAC,eAAe;IAOvB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAuBxB;;;;;;;;OAQG;IACH,OAAO,CAAC,eAAe;IA+BvB;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAyBjC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IA2BhC;;OAEG;IACH,OAAO,CAAC,eAAe;CAyCxB"}
|
|
@@ -50,6 +50,7 @@ declare const stateSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
|
50
50
|
selectedTools: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>>;
|
|
51
51
|
consentSubmitted: import("@frontmcp/lazy-zod").ZodDefault<import("@frontmcp/lazy-zod").ZodBoolean>;
|
|
52
52
|
csrf: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
53
|
+
signinBinding: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
53
54
|
}, import("zod/v4/core").$strip>;
|
|
54
55
|
declare const outputSchema: import("@frontmcp/lazy-zod").ZodUnion<readonly [import("@frontmcp/lazy-zod").ZodObject<{
|
|
55
56
|
kind: import("@frontmcp/lazy-zod").ZodLiteral<"redirect">;
|
|
@@ -168,13 +169,14 @@ export default class OauthCallbackFlow extends FlowBase<typeof name> {
|
|
|
168
169
|
* to the verifier as if they were login fields. Only string values are kept.
|
|
169
170
|
*/
|
|
170
171
|
/**
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
* keys keep all values so checkbox groups (`tools`) survive a POST.
|
|
172
|
+
* Read a single param from the POSTed form body. The built-in sign-in and
|
|
173
|
+
* consent forms POST here; the Node host hands the body over parsed, the fetch
|
|
174
|
+
* handler as the raw urlencoded string. Multi-valued keys keep all values so
|
|
175
|
+
* checkbox groups (`tools`, `providers`) survive.
|
|
176
176
|
*/
|
|
177
177
|
private readBodyParam;
|
|
178
|
+
/** A single-valued param from the query (GET) or the form body (POST). */
|
|
179
|
+
private readParam;
|
|
178
180
|
/**
|
|
179
181
|
* Same-origin (CSRF) check for a state-changing login/consent submission.
|
|
180
182
|
*
|
|
@@ -229,16 +231,31 @@ export default class OauthCallbackFlow extends FlowBase<typeof name> {
|
|
|
229
231
|
* custom page already set on the record, so a consent re-render keeps the same
|
|
230
232
|
* token), builds the consent {@link AuthFlowState} from the SAME tool
|
|
231
233
|
* projection the built-in screen uses, SSRs the component, and responds with
|
|
232
|
-
* the assembled page + CSP headers
|
|
234
|
+
* the assembled page + CSP headers (its `form-action` allows the client's
|
|
235
|
+
* `redirect_uri`, where the submission is redirected). Returns `true` when handled.
|
|
233
236
|
*/
|
|
234
237
|
private tryRenderCustomConsent;
|
|
238
|
+
/**
|
|
239
|
+
* Keep the sign-in this request verified on the pending record while the
|
|
240
|
+
* consent screen is shown (#263), and give that screen a CSRF token.
|
|
241
|
+
*
|
|
242
|
+
* The consent form then needs only `pending_auth_id`, the token and the
|
|
243
|
+
* chosen tools: no login field (a password included) is written into the page
|
|
244
|
+
* or sent back through the browser. The sign-in is sealed with the server
|
|
245
|
+
* secret because it may carry `authenticate()` credentials and the record may
|
|
246
|
+
* live in a shared store. Fails closed: when the record can't be written the
|
|
247
|
+
* consent screen is not shown.
|
|
248
|
+
*
|
|
249
|
+
* @returns false when it already responded with an error.
|
|
250
|
+
*/
|
|
251
|
+
private keepSignInForConsent;
|
|
235
252
|
/**
|
|
236
253
|
* Render the tool-consent screen.
|
|
237
254
|
*
|
|
238
|
-
* The form
|
|
239
|
-
* `consent_submitted=1
|
|
240
|
-
*
|
|
241
|
-
*
|
|
255
|
+
* The form POSTs back to `/oauth/callback` carrying `pending_auth_id`, the
|
|
256
|
+
* CSRF token, `consent_submitted=1` and the chosen `tools=` checkboxes. It
|
|
257
|
+
* carries no sign-in fields: {@link keepSignInForConsent} kept the verified
|
|
258
|
+
* sign-in on the pending record, and the resubmit completes it from there.
|
|
242
259
|
*
|
|
243
260
|
* Honors the `auth.consent` flags: `groupByApp`, `showDescriptions`,
|
|
244
261
|
* `customMessage`, `allowSelectAll`, `requireSelection`, `defaultSelectedTools`
|
|
@@ -247,6 +264,8 @@ export default class OauthCallbackFlow extends FlowBase<typeof name> {
|
|
|
247
264
|
* (used for an empty `requireSelection` submit).
|
|
248
265
|
*/
|
|
249
266
|
private renderConsentScreen;
|
|
267
|
+
/** An HTML response with the built-in auth pages' security headers (#263). */
|
|
268
|
+
private htmlPage;
|
|
250
269
|
/**
|
|
251
270
|
* Generate a stable user sub from email
|
|
252
271
|
* In production, this would be the user's ID from the database
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.callback.flow.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/oauth.callback.flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"oauth.callback.flow.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/oauth.callback.flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAoBH,OAAO,EAAE,CAAC,EAAE,MAAM,oBAAoB,CAAC;AAUvC,OAAO,EAGL,QAAQ,EAQR,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AAatB,QAAA,MAAM,WAAW;;;;gCAAkB,CAAC;AAEpC,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA8Df,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAAgD,CAAC;AAEnE,QAAA,MAAM,IAAI;;;CAG2B,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;AAevC,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,QAAQ,CAAC,OAAO,IAAI,CAAC;IAClE,OAAO,CAAC,MAAM,CAAgD;IAE9D;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IAMf,aAAa;IAKb,UAAU;IA4EV,mBAAmB;IA+bzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IAEG,qBAAqB;IA2D3B;;;;;;OAMG;IAEG,mBAAmB;IAiInB,uBAAuB;IA2GvB,gBAAgB;IAyDtB;;;OAGG;IACH,OAAO,CAAC,MAAM,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;IAYjC;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IAmB5B;;;;;;;;;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"}
|
|
@@ -68,6 +68,8 @@ export default class OauthConnectFlow extends FlowBase<typeof name> {
|
|
|
68
68
|
private verifyToken;
|
|
69
69
|
/** Resolve the single credential field to render from `login.fields` (first field), or a default. */
|
|
70
70
|
private resolveConnectField;
|
|
71
|
+
/** An HTML response with the built-in auth pages' security headers (#263). */
|
|
72
|
+
private htmlPage;
|
|
71
73
|
/** Render the single-field connect page (reusing the login field renderer). */
|
|
72
74
|
private renderConnectPage;
|
|
73
75
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.connect.flow.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/oauth.connect.flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;
|
|
1
|
+
{"version":3,"file":"oauth.connect.flow.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/oauth.connect.flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAiBH,OAAO,EAGL,QAAQ,EAMR,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;AAGtB,QAAA,MAAM,WAAW;;;;gCAAkB,CAAC;AAEpC,QAAA,MAAM,WAAW;;;;gCAOf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;gCAAiB,CAAC;AAEpC,QAAA,MAAM,IAAI;;;CAG2B,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,eAAe,EAAE,cAAc,CAC7B,gBAAgB,EAChB,OAAO,IAAI,EACX,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,OAAO,WAAW,CACnB,CAAC;KACH;CACF;AAED,QAAA,MAAM,IAAI,EAAG,eAAwB,CAAC;AAiBtC,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,QAAQ,CAAC,OAAO,IAAI,CAAC;IACjE,OAAO,CAAC,MAAM,CAA+C;IAGvD,aAAa;IAKb,UAAU;IAeV,aAAa;IAqHnB,yFAAyF;IACzF,OAAO,CAAC,WAAW;IAKnB,qGAAqG;IACrG,OAAO,CAAC,mBAAmB;IAW3B,8EAA8E;IAC9E,OAAO,CAAC,QAAQ;IAIhB,+EAA+E;IAC/E,OAAO,CAAC,iBAAiB;IAoBzB;;;OAGG;YACW,eAAe;IA4B7B,+FAA+F;IAC/F,OAAO,CAAC,YAAY;IAQpB,oFAAoF;IACpF,OAAO,CAAC,sBAAsB;IAiB9B,4DAA4D;IAC5D,OAAO,CAAC,UAAU;IAyBlB,+FAA+F;IAC/F,OAAO,CAAC,aAAa;IAerB,2CAA2C;IAC3C,OAAO,CAAC,WAAW;CAQpB"}
|
|
@@ -36,6 +36,7 @@ declare const stateSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
|
36
36
|
providerTokens: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodUnknown>;
|
|
37
37
|
providerUserInfo: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodUnknown>;
|
|
38
38
|
consentSessionId: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
39
|
+
consentCsrf: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
39
40
|
consentSubmitted: import("@frontmcp/lazy-zod").ZodDefault<import("@frontmcp/lazy-zod").ZodBoolean>;
|
|
40
41
|
selectedTools: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>>;
|
|
41
42
|
}, import("zod/v4/core").$strip>;
|
|
@@ -105,13 +106,20 @@ export default class OauthProviderCallbackFlow extends FlowBase<typeof name> {
|
|
|
105
106
|
*
|
|
106
107
|
* Federated logins complete (mint the code) here, AFTER all providers are
|
|
107
108
|
* linked. When consent mode is enabled, {@link completeFederatedAuth} first
|
|
108
|
-
* renders the consent screen, which
|
|
109
|
-
* `consent_session=<sessionId
|
|
110
|
-
* session,
|
|
111
|
-
*
|
|
109
|
+
* renders the consent screen, which POSTs back to this endpoint with
|
|
110
|
+
* `consent_session=<sessionId>`, the screen's `csrf` token and `tools=`. This
|
|
111
|
+
* stage loads that still alive session, checks the token, applies the
|
|
112
|
+
* selection (validating + `requireSelection`), and completes the mint —
|
|
113
|
+
* short-circuiting the provider-code path entirely.
|
|
112
114
|
*/
|
|
113
115
|
handleConsentSubmission(): Promise<void>;
|
|
114
116
|
loadFederatedSession(): Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Whether this request comes from the browser that started the sign-in of
|
|
119
|
+
* `session` (it carries the session's binding cookie). Responds with a 400
|
|
120
|
+
* page, and returns false, when it doesn't.
|
|
121
|
+
*/
|
|
122
|
+
private fromBrowserThatStarted;
|
|
115
123
|
validateProviderCallback(): Promise<void>;
|
|
116
124
|
exchangeProviderCode(): Promise<void>;
|
|
117
125
|
storeProviderTokens(): Promise<void>;
|
|
@@ -121,8 +129,9 @@ export default class OauthProviderCallbackFlow extends FlowBase<typeof name> {
|
|
|
121
129
|
*
|
|
122
130
|
* When consent mode is enabled this runs in two passes:
|
|
123
131
|
* 1. First reach (no `consent.consentSubmitted`): render the consent screen,
|
|
124
|
-
* which
|
|
125
|
-
* federated session is kept ALIVE
|
|
132
|
+
* which POSTs back to this endpoint with `consent_session`, the CSRF token
|
|
133
|
+
* kept on the session and `tools=`. The federated session is kept ALIVE
|
|
134
|
+
* for the round-trip.
|
|
126
135
|
* 2. Resubmit (`consent.consentSubmitted` true): validate the selection
|
|
127
136
|
* (honoring `requireSelection`) and mint the code with the consented set.
|
|
128
137
|
*
|
|
@@ -130,20 +139,31 @@ export default class OauthProviderCallbackFlow extends FlowBase<typeof name> {
|
|
|
130
139
|
*/
|
|
131
140
|
private completeFederatedAuth;
|
|
132
141
|
/**
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* (
|
|
136
|
-
|
|
142
|
+
* Give the federated session the consent screen's CSRF token and persist it
|
|
143
|
+
* before the screen is shown. Fails closed: when the session can't be
|
|
144
|
+
* written, no consent screen goes out (its submission could not be checked).
|
|
145
|
+
*/
|
|
146
|
+
private keepConsentCsrf;
|
|
147
|
+
/**
|
|
148
|
+
* Render the federated consent screen. The form POSTs back to this provider
|
|
149
|
+
* callback endpoint with `consent_session=<sessionId>`, the session's `csrf`
|
|
150
|
+
* token and the chosen `tools=` (and `consent_submitted=1`), so
|
|
151
|
+
* {@link handleConsentSubmission} completes the mint. Honors the same
|
|
152
|
+
* `auth.consent` flags as the non-federated path.
|
|
137
153
|
*/
|
|
138
154
|
private renderConsentScreen;
|
|
139
155
|
/**
|
|
140
156
|
* Generate a deterministic user sub from email
|
|
141
157
|
*/
|
|
142
158
|
private generateUserSub;
|
|
159
|
+
/** End a federated sign-in that won't complete: drop its session and pending authorization. */
|
|
160
|
+
private abandon;
|
|
143
161
|
/**
|
|
144
162
|
* Render an error page
|
|
145
163
|
*/
|
|
146
164
|
private renderErrorPage;
|
|
165
|
+
/** An HTML response with the built-in auth pages' security headers (#263). */
|
|
166
|
+
private htmlPage;
|
|
147
167
|
private getStateValidation;
|
|
148
168
|
}
|
|
149
169
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.provider-callback.flow.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/oauth.provider-callback.flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"oauth.provider-callback.flow.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/oauth.provider-callback.flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAgBH,OAAO,EAAE,CAAC,EAAE,MAAM,oBAAoB,CAAC;AAWvC,OAAO,EAGL,QAAQ,EASR,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AAatB,QAAA,MAAM,WAAW;;;;gCAAkB,CAAC;AAEpC,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;gCAuBf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAAgD,CAAC;AAEnE,QAAA,MAAM,IAAI;;;CAG2B,CAAC;AAEt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;;;;;;;gCAIf,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;
|
|
1
|
+
{"version":3,"file":"oauth.register.flow.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/oauth.register.flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAmBH,OAAO,EAGL,QAAQ,EAMR,KAAK,cAAc,EACpB,MAAM,cAAc,CAAC;AAGtB,QAAA,MAAM,WAAW;;;;gCAAkB,CAAC;AACpC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;gCAAiB,CAAC;AA6BpC,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;gCAIf,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;AAsBvC,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,QAAQ,CAAC,OAAO,IAAI,CAAC;IAClE,OAAO,CAAC,UAAU,CAAC,CAAmB;IAEtC,4EAA4E;IAC5E,OAAO,KAAK,SAAS,GAEpB;IAGK,aAAa;IAKb,UAAU;IAeV,aAAa;IAyIb,cAAc;IA6Cd,mBAAmB;IAiCnB,cAAc;CAGrB"}
|
|
@@ -112,6 +112,11 @@ export default class OauthTokenFlow extends FlowBase<typeof name> {
|
|
|
112
112
|
handleAnonymousGrant(): Promise<void>;
|
|
113
113
|
buildTokenResponse(): Promise<void>;
|
|
114
114
|
validateOutput(): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* This server's protected-resource URI (RFC 8707), the audience of the tokens
|
|
117
|
+
* it issues when the grant named none (#269).
|
|
118
|
+
*/
|
|
119
|
+
private canonicalResource;
|
|
115
120
|
}
|
|
116
121
|
export {};
|
|
117
122
|
//# sourceMappingURL=oauth.token.flow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.token.flow.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/oauth.token.flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH;;;;;;;;GAQG;AACH;;;;;;;;;;;GAWG;AAgCH,OAAO,EAKL,QAAQ,EAOR,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;AAGtB,QAAA,MAAM,WAAW;;;;gCAAkB,CAAC;AA2HpC,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAkBf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;gCAAiB,CAAC;AAEpC,QAAA,MAAM,IAAI;;;;CAI2B,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,aAAa,EAAE,cAAc,CAC3B,cAAc,EACd,OAAO,IAAI,EACX,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,OAAO,WAAW,CACnB,CAAC;KACH;CACF;AAED,QAAA,MAAM,IAAI,EAAG,aAAsB,CAAC;AAcpC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,QAAQ,CAAC,OAAO,IAAI,CAAC;IAC/D,OAAO,CAAC,MAAM,CAA6C;IAGrD,aAAa;IAKb,UAAU;IAoDV,aAAa;IAmBb,4BAA4B;
|
|
1
|
+
{"version":3,"file":"oauth.token.flow.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/oauth.token.flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH;;;;;;;;GAQG;AACH;;;;;;;;;;;GAWG;AAgCH,OAAO,EAKL,QAAQ,EAOR,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAC;AAGtB,QAAA,MAAM,WAAW;;;;gCAAkB,CAAC;AA2HpC,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAkBf,CAAC;AAEH,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;gCAAiB,CAAC;AAEpC,QAAA,MAAM,IAAI;;;;CAI2B,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,aAAa,EAAE,cAAc,CAC3B,cAAc,EACd,OAAO,IAAI,EACX,OAAO,WAAW,EAClB,OAAO,YAAY,EACnB,OAAO,WAAW,CACnB,CAAC;KACH;CACF;AAED,QAAA,MAAM,IAAI,EAAG,aAAsB,CAAC;AAcpC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,QAAQ,CAAC,OAAO,IAAI,CAAC;IAC/D,OAAO,CAAC,MAAM,CAA6C;IAGrD,aAAa;IAKb,UAAU;IAoDV,aAAa;IAmBb,4BAA4B;IA2D5B,uBAAuB;IAmEvB,oBAAoB;IAsDpB,kBAAkB;IAqBlB,cAAc;IAIpB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;CAG1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.verify.flow.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/session.verify.flow.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"session.verify.flow.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/session.verify.flow.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,QAAQ,EAcR,KAAK,cAAc,EAGpB,MAAM,cAAc,CAAC;AAEtB,OAAO,kBAAkB,CAAC;AAsB1B,QAAA,MAAM,WAAW;;gCAAyB,CAAC;AAE3C,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAaf,CAAC;AAuBH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAAmE,CAAC;AAE1G,QAAA,MAAM,IAAI;;;CAU2B,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,WAAW;QACnB,gBAAgB,EAAE,cAAc,CAC9B,iBAAiB,EACjB,OAAO,IAAI,EACX,OAAO,WAAW,EAClB,OAAO,yBAAyB,EAChC,OAAO,WAAW,CACnB,CAAC;KACH;CACF;AAED,QAAA,MAAM,IAAI,EAAG,gBAAyB,CAAC;AAgFvC,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,QAAQ,CAAC,OAAO,IAAI,CAAC;IAClE,MAAM,wCAA+C;IAErD,OAAO,CAAC,OAAO;IAMf;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IA8FxB,UAAU;IAsDhB;;;;;;;;;;;OAWG;IAOG,iBAAiB;IA8CvB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAgB5B;;;;;;;OAOG;IAEG,gBAAgB;IAuCtB;;;OAGG;IAUG,uBAAuB;IA4BvB,+BAA+B;IAQrC;;;;;;;OAOG;IAEG,WAAW;IA0KX,UAAU;IAIhB;;;;;OAKG;IAEG,kBAAkB;IAclB,qBAAqB;CAoB5B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The HTTP side of the sign-in binding (see `createSigninBinding` in
|
|
3
|
+
* `@frontmcp/auth`): the cookie `/oauth/authorize` sets, and the check the
|
|
4
|
+
* callbacks run before resuming a sign-in.
|
|
5
|
+
*/
|
|
6
|
+
import { type SigninBinding } from '@frontmcp/auth';
|
|
7
|
+
import { type HttpCookie, type ServerRequest } from '../../common';
|
|
8
|
+
/**
|
|
9
|
+
* Path of the binding cookie: `/oauth`, where the OAuth endpoints live, unless
|
|
10
|
+
* the server's issuer or scope carries a path prefix, which the provider
|
|
11
|
+
* callback URL (`<issuer>/oauth/provider/<id>/callback`) and the federated
|
|
12
|
+
* consent form include. Then `/`, so the cookie still reaches them.
|
|
13
|
+
*/
|
|
14
|
+
export declare function signinCookiePath(issuer: string, scopePath: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the browser reached this request over https. The binding cookie is then a `__Host-`
|
|
17
|
+
* cookie (`Secure`, `Path=/`, no `Domain`), which no other host can set in the browser.
|
|
18
|
+
*/
|
|
19
|
+
export declare function signinOverHttps(request: ServerRequest): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The binding for a new sign-in started by `request`: named `__Host-…` when the browser came over
|
|
22
|
+
* https (see {@link signinOverHttps}).
|
|
23
|
+
*/
|
|
24
|
+
export declare function createRequestSigninBinding(request: ServerRequest, pendingAuthId: string): SigninBinding;
|
|
25
|
+
/**
|
|
26
|
+
* The cookie that gives the browser its binding: HttpOnly and SameSite=Lax. Over https it is the
|
|
27
|
+
* `__Host-` cookie, so `Secure` with `Path=/` (the prefix requires both); otherwise it is scoped to `path`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function signinBindingCookie(request: ServerRequest, binding: SigninBinding, path: string): HttpCookie;
|
|
30
|
+
/** A `Set-Cookie` that removes the binding cookie of `pendingAuthId` once its sign-in is over. */
|
|
31
|
+
export declare function clearedSigninBindingCookie(request: ServerRequest, pendingAuthId: string, path: string): HttpCookie;
|
|
32
|
+
/**
|
|
33
|
+
* Whether `request` comes from the browser that started the sign-in `pendingAuthId` (its binding hash
|
|
34
|
+
* is `hash`). Over https only the `__Host-` cookie counts: a same-named cookie without the prefix may
|
|
35
|
+
* have been planted by a sibling host.
|
|
36
|
+
*/
|
|
37
|
+
export declare function requestHoldsSigninBinding(request: ServerRequest, pendingAuthId: string, hash: string | undefined): boolean;
|
|
38
|
+
/** `output` with `cookie` added to the cookies it sets. */
|
|
39
|
+
export declare function withCookie<T extends {
|
|
40
|
+
cookies?: HttpCookie[];
|
|
41
|
+
}>(output: T, cookie: HttpCookie): T;
|
|
42
|
+
/** The error text for a sign-in resumed without its binding cookie. */
|
|
43
|
+
export declare const SIGNIN_BINDING_REFUSED = "This sign-in was started in another browser, or at another address. Start it again from the app.";
|
|
44
|
+
//# sourceMappingURL=signin-binding.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signin-binding.utils.d.ts","sourceRoot":"","sources":["../../../src/auth/flows/signin-binding.utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAA0C,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAE3G;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAQ1E;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAK/D;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,GAAG,aAAa,CAEvG;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAa5G;AAED,kGAAkG;AAClG,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAWlH;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,aAAa,EACtB,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,OAAO,CAIT;AAED,2DAA2D;AAC3D,wBAAgB,UAAU,CAAC,CAAC,SAAS;IAAE,OAAO,CAAC,EAAE,UAAU,EAAE,CAAA;CAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,GAAG,CAAC,CAEjG;AAED,uEAAuE;AACvE,eAAO,MAAM,sBAAsB,qGACiE,CAAC"}
|