@frontmcp/sdk 1.7.0 → 1.7.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/agent/flows/call-agent.flow.d.ts +2 -6
- package/agent/flows/call-agent.flow.d.ts.map +1 -1
- package/auth/flows/oauth.authorize.flow.d.ts +30 -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/instances/instance.local-primary-auth.d.ts +35 -0
- package/auth/instances/instance.local-primary-auth.d.ts.map +1 -1
- package/builtin/config/providers/config-loader.d.ts +5 -0
- package/builtin/config/providers/config-loader.d.ts.map +1 -1
- package/common/metadata/agent.metadata.d.ts +2 -2
- package/common/metadata/app.metadata.d.ts +6 -6
- package/common/metadata/flow.metadata.d.ts +4 -4
- package/common/metadata/front-mcp.metadata.d.ts +43 -31
- package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
- package/common/metadata/job.metadata.d.ts +2 -2
- package/common/metadata/tool.metadata.d.ts +3 -3
- package/common/metadata/workflow.metadata.d.ts +2 -2
- package/common/schemas/http-output.schema.d.ts +4 -4
- package/common/types/options/http/interfaces.d.ts +26 -10
- package/common/types/options/http/interfaces.d.ts.map +1 -1
- package/common/types/options/http/schema.d.ts.map +1 -1
- package/common/types/options/session/schema.d.ts +3 -3
- package/common/types/options/transport/schema.d.ts +3 -1
- package/common/types/options/transport/schema.d.ts.map +1 -1
- package/common/utils/index.d.ts +1 -0
- package/common/utils/index.d.ts.map +1 -1
- package/common/utils/principal.utils.d.ts +29 -0
- package/common/utils/principal.utils.d.ts.map +1 -0
- package/direct/llm-platform.d.ts +2 -2
- package/direct/llm-platform.d.ts.map +1 -1
- package/errors/index.d.ts +1 -0
- package/errors/index.d.ts.map +1 -1
- package/errors/job.errors.d.ts +26 -0
- package/errors/job.errors.d.ts.map +1 -0
- package/esm/index.mjs +928 -207
- package/front-mcp/front-mcp.providers.d.ts +4 -4
- package/index.js +1041 -320
- package/job/execution/job-execution.manager.d.ts +15 -0
- package/job/execution/job-execution.manager.d.ts.map +1 -1
- package/job/job-permission.guard.d.ts +23 -4
- package/job/job-permission.guard.d.ts.map +1 -1
- package/job/job-scope.helper.d.ts +12 -0
- package/job/job-scope.helper.d.ts.map +1 -1
- package/job/store/job-state.interface.d.ts +6 -0
- package/job/store/job-state.interface.d.ts.map +1 -1
- package/job/tools/execute-job.tool.d.ts.map +1 -1
- package/job/tools/get-job-status.tool.d.ts +12 -0
- package/job/tools/get-job-status.tool.d.ts.map +1 -1
- package/job/tools/list-jobs.tool.d.ts +6 -0
- package/job/tools/list-jobs.tool.d.ts.map +1 -1
- package/job/tools/register-job.tool.d.ts +1 -0
- package/job/tools/register-job.tool.d.ts.map +1 -1
- package/job/tools/remove-job.tool.d.ts.map +1 -1
- package/package.json +10 -10
- package/resource/flows/resource-templates-list.flow.d.ts +2 -2
- package/resource/flows/resources-list.flow.d.ts +2 -2
- package/scope/scope.utils.d.ts.map +1 -1
- package/server/adapters/express.host.adapter.d.ts +34 -2
- package/server/adapters/express.host.adapter.d.ts.map +1 -1
- package/server/middleware/host-validation.middleware.d.ts +8 -4
- package/server/middleware/host-validation.middleware.d.ts.map +1 -1
- package/server/security/host-validation.d.ts +66 -0
- package/server/security/host-validation.d.ts.map +1 -0
- package/server/security/resolve-allowed-hosts.d.ts +63 -0
- package/server/security/resolve-allowed-hosts.d.ts.map +1 -0
- package/server/security/security-audit.d.ts +7 -4
- package/server/security/security-audit.d.ts.map +1 -1
- package/server/server.instance.d.ts.map +1 -1
- package/server/server.types.d.ts +11 -6
- package/server/server.types.d.ts.map +1 -1
- package/tool/flows/call-tool.flow.d.ts +19 -7
- package/tool/flows/call-tool.flow.d.ts.map +1 -1
- package/tool/flows/tools-list.flow.d.ts +2 -6
- package/tool/flows/tools-list.flow.d.ts.map +1 -1
- package/transport/adapters/base-sse-transport.d.ts +7 -0
- package/transport/adapters/base-sse-transport.d.ts.map +1 -1
- package/transport/adapters/transport.local.adapter.d.ts.map +1 -1
- package/transport/adapters/transport.streamable-http.adapter.d.ts.map +1 -1
- package/transport/event-stores/index.d.ts +2 -0
- package/transport/event-stores/index.d.ts.map +1 -1
- package/transport/event-stores/memory.event-store.d.ts +9 -2
- package/transport/event-stores/memory.event-store.d.ts.map +1 -1
- package/transport/event-stores/redis.event-store.d.ts +24 -3
- package/transport/event-stores/redis.event-store.d.ts.map +1 -1
- package/transport/event-stores/session-scoped.event-store.d.ts +17 -0
- package/transport/event-stores/session-scoped.event-store.d.ts.map +1 -0
- package/transport/web-fetch-handler.d.ts.map +1 -1
- package/workflow/tools/execute-workflow.tool.d.ts.map +1 -1
- package/workflow/tools/get-workflow-status.tool.d.ts +12 -0
- package/workflow/tools/get-workflow-status.tool.d.ts.map +1 -1
- package/workflow/tools/list-workflows.tool.d.ts +1 -0
- package/workflow/tools/list-workflows.tool.d.ts.map +1 -1
- package/workflow/tools/register-workflow.tool.d.ts +1 -0
- package/workflow/tools/register-workflow.tool.d.ts.map +1 -1
- package/workflow/tools/remove-workflow.tool.d.ts.map +1 -1
|
@@ -8,6 +8,13 @@ export interface ExecuteJobOptions {
|
|
|
8
8
|
sessionId?: string;
|
|
9
9
|
authInfo?: Partial<Record<string, unknown>>;
|
|
10
10
|
contextProviders?: unknown;
|
|
11
|
+
/**
|
|
12
|
+
* The scope's authorities context builder, when one is configured. Passed
|
|
13
|
+
* through so the permission guard resolves roles/claims using the server's
|
|
14
|
+
* own `claimsMapping` rather than a second, divergent notion of where roles
|
|
15
|
+
* live.
|
|
16
|
+
*/
|
|
17
|
+
authoritiesContextBuilder?: import('@frontmcp/auth').AuthoritiesContextBuilder;
|
|
11
18
|
}
|
|
12
19
|
export interface ExecuteWorkflowOptions extends ExecuteJobOptions {
|
|
13
20
|
workflowInput?: Record<string, unknown>;
|
|
@@ -39,6 +46,14 @@ export declare class JobExecutionManager {
|
|
|
39
46
|
* Execute a workflow inline or in background.
|
|
40
47
|
*/
|
|
41
48
|
executeWorkflow(workflow: WorkflowEntry, jobRegistry: JobRegistryInterface, opts?: ExecuteWorkflowOptions): Promise<InlineJobResult | BackgroundJobResult>;
|
|
49
|
+
/**
|
|
50
|
+
* Throw unless the caller may execute the entry.
|
|
51
|
+
*
|
|
52
|
+
* Uses the same error for "not authorized" as the tools use for "not found",
|
|
53
|
+
* so a caller cannot enumerate which restricted jobs exist by comparing
|
|
54
|
+
* responses.
|
|
55
|
+
*/
|
|
56
|
+
private assertMayExecute;
|
|
42
57
|
/**
|
|
43
58
|
* Get execution status.
|
|
44
59
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job-execution.manager.d.ts","sourceRoot":"","sources":["../../../src/job/execution/job-execution.manager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"job-execution.manager.d.ts","sourceRoot":"","sources":["../../../src/job/execution/job-execution.manager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAM/E,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACvB,MAAM,8BAA8B,CAAC;AAEtC,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC,M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K,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,iBAAiB,GAAG,IAAI,CAAC;IAIhF;;OAEG;IACG,QAAQ,CAAC,IAAI,CAAC,EAAE;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,iBAAiB,CAAC;QAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,CAAC,YAAY,GAAG,iBAAiB,CAAC,EAAE,CAAC;YAMnC,gBAAgB;YA+DhB,oBAAoB;YAapB,qBAAqB;YA2CrB,yBAAyB;YAezB,WAAW;YAIX,MAAM;CASrB"}
|
|
@@ -1,14 +1,33 @@
|
|
|
1
|
+
import type { AuthoritiesContextBuilder } from '@frontmcp/auth';
|
|
1
2
|
import { type JobPermission, type JobPermissionAction } from '../common/metadata/job.metadata';
|
|
2
3
|
/**
|
|
3
4
|
* Permission guard for jobs and workflows.
|
|
4
|
-
*
|
|
5
|
+
*
|
|
6
|
+
* Evaluates the `permissions` declared by `@Job` / `@Workflow` against the
|
|
7
|
+
* caller. The contract is deliberately permissive at the edges and strict in the
|
|
8
|
+
* middle:
|
|
9
|
+
*
|
|
10
|
+
* - no `permissions` at all, or none matching the action → ALLOW. This is the
|
|
11
|
+
* documented behaviour ("when no permissions are defined, the job is
|
|
12
|
+
* accessible to all authenticated users") and changing it would break every
|
|
13
|
+
* existing server.
|
|
14
|
+
* - one or more rules match the action → ALL of them must pass, and within a
|
|
15
|
+
* rule the roles/scopes lists are ANY-of.
|
|
16
|
+
*
|
|
17
|
+
* Claims are resolved through {@link resolvePrincipal}, so a server that
|
|
18
|
+
* configured `authorities.claimsMapping` gets its own mapping honoured here
|
|
19
|
+
* rather than a second, divergent notion of where roles live.
|
|
5
20
|
*/
|
|
6
21
|
export declare class JobPermissionGuard {
|
|
7
22
|
/**
|
|
8
|
-
* Check
|
|
9
|
-
*
|
|
23
|
+
* Check whether the caller may perform `action`.
|
|
24
|
+
*
|
|
25
|
+
* @param permissions - the entry's declared rules (undefined = unrestricted).
|
|
26
|
+
* @param action - the action being attempted.
|
|
27
|
+
* @param authInfo - the request's AuthInfo.
|
|
28
|
+
* @param contextBuilder - the scope's authorities context builder, when configured.
|
|
10
29
|
*/
|
|
11
|
-
static check(permissions: JobPermission[] | undefined, action: JobPermissionAction, authInfo: Partial<Record<string, unknown>>): Promise<boolean>;
|
|
30
|
+
static check(permissions: JobPermission[] | undefined, action: JobPermissionAction, authInfo: Partial<Record<string, unknown>> | undefined, contextBuilder?: AuthoritiesContextBuilder): Promise<boolean>;
|
|
12
31
|
private static checkSingle;
|
|
13
32
|
}
|
|
14
33
|
//# sourceMappingURL=job-permission.guard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job-permission.guard.d.ts","sourceRoot":"","sources":["../../src/job/job-permission.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"job-permission.guard.d.ts","sourceRoot":"","sources":["../../src/job/job-permission.guard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAG/F;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,kBAAkB;IAC7B;;;;;;;OAOG;WACU,KAAK,CAChB,WAAW,EAAE,aAAa,EAAE,GAAG,SAAS,EACxC,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,SAAS,EACtD,cAAc,CAAC,EAAE,yBAAyB,GACzC,OAAO,CAAC,OAAO,CAAC;mBAsBE,WAAW;CAuBjC"}
|
|
@@ -10,6 +10,18 @@ import { type JobDefinitionStore } from './store/job-definition.interface';
|
|
|
10
10
|
import { type JobStateStore } from './store/job-state.interface';
|
|
11
11
|
export interface JobsConfig {
|
|
12
12
|
enabled: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Allow `register_job` / `register_workflow` — which take a raw script string
|
|
15
|
+
* and register it as an executable job — to be called at runtime.
|
|
16
|
+
*
|
|
17
|
+
* Off by default (GHSA-58v2-gpcc-jmqv): combined with an unguarded
|
|
18
|
+
* `execute_job` this was register-and-run-arbitrary-JS for any caller who
|
|
19
|
+
* could reach the tool list. Turn it on only when an agent is genuinely meant
|
|
20
|
+
* to author jobs, and pair it with `permissions` on the surrounding surface.
|
|
21
|
+
*
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
allowDynamicRegistration?: boolean;
|
|
13
25
|
store?: {
|
|
14
26
|
redis?: {
|
|
15
27
|
provider: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job-scope.helper.d.ts","sourceRoot":"","sources":["../../src/job/job-scope.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,KAAK,gBAAgB,MAAM,+BAA+B,CAAC;AAMlE,OAAyB,EAAE,KAAK,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AACjG,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAoB,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAExE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,6BAA6B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BAAqB;IACpC,WAAW,EAAE,oBAAoB,CAAC;IAClC,gBAAgB,EAAE,yBAAyB,CAAC;IAC5C,gBAAgB,EAAE,mBAAmB,CAAC;IACtC,UAAU,EAAE,aAAa,CAAC;IAC1B,eAAe,EAAE,kBAAkB,CAAC;IACpC,eAAe,EAAE,GAAG,EAAE,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA8E/G"}
|
|
@@ -4,6 +4,12 @@ export interface JobRunRecord {
|
|
|
4
4
|
jobId: string;
|
|
5
5
|
jobName: string;
|
|
6
6
|
sessionId?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Subject that started the run. Run status carries the job's inputs and
|
|
9
|
+
* results, so reads are scoped to the owner rather than to whoever guesses a
|
|
10
|
+
* runId (GHSA-58v2-gpcc-jmqv).
|
|
11
|
+
*/
|
|
12
|
+
ownerSub?: string;
|
|
7
13
|
state: JobExecutionState;
|
|
8
14
|
input: unknown;
|
|
9
15
|
result?: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job-state.interface.d.ts","sourceRoot":"","sources":["../../../src/job/store/job-state.interface.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC;AAE1G,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,iBAAiB,CAAC;IACzB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAA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MAAM,CAAA;SAAE,CAAC;QAC5B,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CACF,CAAC;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,YAAY,GAAG,iBAAiB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5F,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,iBAAiB,GAAG,IAAI,CAAC,CAAC;IACxE,QAAQ,CAAC,IAAI,CAAC,EAAE;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,iBAAiB,CAAC;QAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,CAAC,YAAY,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAC;IAClD,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9C,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-job.tool.d.ts","sourceRoot":"","sources":["../../../src/job/tools/execute-job.tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"execute-job.tool.d.ts","sourceRoot":"","sources":["../../../src/job/tools/execute-job.tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,WAAW,EAAE,MAAM,cAAc,CAAC;AAoBjD,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,WAAW;IAC/C,OAAO,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAAC,UAAU,EAAE,OAAO,CAAA;KAAE;CA2B5F"}
|
|
@@ -17,5 +17,17 @@ export default class GetJobStatusTool extends ToolContext {
|
|
|
17
17
|
attempt: number;
|
|
18
18
|
logs: string[];
|
|
19
19
|
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Match on the owning subject, falling back to the session for runs started
|
|
22
|
+
* before an owner was recorded (and for anonymous/public servers, where every
|
|
23
|
+
* caller has an empty subject and the session is the only identity there is).
|
|
24
|
+
*
|
|
25
|
+
* A record carrying NEITHER identity is refused. Such a run cannot be
|
|
26
|
+
* attributed to anyone, and its inputs and results are exactly what this check
|
|
27
|
+
* exists to protect — anyone holding the id would otherwise be able to read
|
|
28
|
+
* it. Internal callers that must read unattributed runs should go through the
|
|
29
|
+
* execution manager directly rather than this tool.
|
|
30
|
+
*/
|
|
31
|
+
private ownsRun;
|
|
20
32
|
}
|
|
21
33
|
//# sourceMappingURL=get-job-status.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-job-status.tool.d.ts","sourceRoot":"","sources":["../../../src/job/tools/get-job-status.tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"get-job-status.tool.d.ts","sourceRoot":"","sources":["../../../src/job/tools/get-job-status.tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,WAAW,EAAE,MAAM,cAAc,CAAC;AA4BjD,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAW;IACjD,OAAO,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;;IA6BtC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,OAAO;CAMhB"}
|
|
@@ -14,5 +14,11 @@ export default class ListJobsTool extends ToolContext {
|
|
|
14
14
|
}[];
|
|
15
15
|
count: number;
|
|
16
16
|
}>;
|
|
17
|
+
/**
|
|
18
|
+
* A job is listable when the caller passes its `list` rules and is not
|
|
19
|
+
* blocked from executing it. Checking `execute` too keeps the listing honest:
|
|
20
|
+
* showing a job the caller can never run is the disclosure this closes.
|
|
21
|
+
*/
|
|
22
|
+
private maySee;
|
|
17
23
|
}
|
|
18
24
|
//# sourceMappingURL=list-jobs.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-jobs.tool.d.ts","sourceRoot":"","sources":["../../../src/job/tools/list-jobs.tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"list-jobs.tool.d.ts","sourceRoot":"","sources":["../../../src/job/tools/list-jobs.tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,WAAW,EAAE,MAAM,cAAc,CAAC;AA2BjD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,WAAW;IAC7C,OAAO,CAAC,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;IAiCzF;;;;OAIG;YACW,MAAM;CAMrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-job.tool.d.ts","sourceRoot":"","sources":["../../../src/job/tools/register-job.tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"register-job.tool.d.ts","sourceRoot":"","sources":["../../../src/job/tools/register-job.tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,WAAW,EAAE,MAAM,cAAc,CAAC;AAuBjD,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,WAAW;IAChD,OAAO,CAAC,KAAK,EAAE;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACtC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;KACjB;;;;IA2CD,OAAO,CAAC,0BAA0B;CAInC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-job.tool.d.ts","sourceRoot":"","sources":["../../../src/job/tools/remove-job.tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"remove-job.tool.d.ts","sourceRoot":"","sources":["../../../src/job/tools/remove-job.tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,WAAW,EAAE,MAAM,cAAc,CAAC;AAiBjD,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,WAAW;IAC9C,OAAO,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE;;;;CAmCtC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontmcp/sdk",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"description": "FrontMCP SDK",
|
|
5
5
|
"author": "AgentFront <info@agentfront.dev>",
|
|
6
6
|
"homepage": "https://docs.agentfront.dev",
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"@anthropic-ai/sdk": "^0.30.0 || ^0.78.0",
|
|
92
92
|
"@enclave-vm/core": "^2.15.2",
|
|
93
|
-
"@frontmcp/observability": "1.7.
|
|
94
|
-
"@frontmcp/storage-sqlite": "1.7.
|
|
93
|
+
"@frontmcp/observability": "1.7.2",
|
|
94
|
+
"@frontmcp/storage-sqlite": "1.7.2",
|
|
95
95
|
"@opentelemetry/api": "^1.9.0",
|
|
96
96
|
"@opentelemetry/sdk-trace-base": "^2.8.0",
|
|
97
97
|
"@vercel/kv": "^3.0.0",
|
|
@@ -132,13 +132,13 @@
|
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
134
|
"dependencies": {
|
|
135
|
-
"@frontmcp/auth": "1.7.
|
|
136
|
-
"@frontmcp/di": "1.7.
|
|
137
|
-
"@frontmcp/guard": "1.7.
|
|
138
|
-
"@frontmcp/lazy-zod": "1.7.
|
|
139
|
-
"@frontmcp/protocol": "1.7.
|
|
140
|
-
"@frontmcp/uipack": "1.7.
|
|
141
|
-
"@frontmcp/utils": "1.7.
|
|
135
|
+
"@frontmcp/auth": "1.7.2",
|
|
136
|
+
"@frontmcp/di": "1.7.2",
|
|
137
|
+
"@frontmcp/guard": "1.7.2",
|
|
138
|
+
"@frontmcp/lazy-zod": "1.7.2",
|
|
139
|
+
"@frontmcp/protocol": "1.7.2",
|
|
140
|
+
"@frontmcp/uipack": "1.7.2",
|
|
141
|
+
"@frontmcp/utils": "1.7.2",
|
|
142
142
|
"@types/cors": "^2.8.17",
|
|
143
143
|
"ioredis": "^5.8.0",
|
|
144
144
|
"jose": "^6.1.3",
|
|
@@ -53,11 +53,11 @@ declare const stateSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
|
53
53
|
cursor: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
54
54
|
templates: import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodObject<{
|
|
55
55
|
ownerName: import("@frontmcp/lazy-zod").ZodString;
|
|
56
|
-
template: import("zod").
|
|
56
|
+
template: import("zod").ZodInstanceOf<ResourceEntry<Record<string, string>, unknown>>;
|
|
57
57
|
}, import("zod/v4/core").$strip>>;
|
|
58
58
|
resolvedTemplates: import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodObject<{
|
|
59
59
|
ownerName: import("@frontmcp/lazy-zod").ZodString;
|
|
60
|
-
template: import("zod").
|
|
60
|
+
template: import("zod").ZodInstanceOf<ResourceEntry<Record<string, string>, unknown>>;
|
|
61
61
|
finalName: import("@frontmcp/lazy-zod").ZodString;
|
|
62
62
|
}, import("zod/v4/core").$strip>>;
|
|
63
63
|
}, import("zod/v4/core").$strip>;
|
|
@@ -54,11 +54,11 @@ declare const stateSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
|
54
54
|
cursor: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
55
55
|
resources: import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodObject<{
|
|
56
56
|
ownerName: import("@frontmcp/lazy-zod").ZodString;
|
|
57
|
-
resource: import("zod").
|
|
57
|
+
resource: import("zod").ZodInstanceOf<ResourceEntry<Record<string, string>, unknown>>;
|
|
58
58
|
}, import("zod/v4/core").$strip>>;
|
|
59
59
|
resolvedResources: import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodObject<{
|
|
60
60
|
ownerName: import("@frontmcp/lazy-zod").ZodString;
|
|
61
|
-
resource: import("zod").
|
|
61
|
+
resource: import("zod").ZodInstanceOf<ResourceEntry<Record<string, string>, unknown>>;
|
|
62
62
|
finalName: import("@frontmcp/lazy-zod").ZodString;
|
|
63
63
|
}, import("zod/v4/core").$strip>>;
|
|
64
64
|
}, import("zod/v4/core").$strip>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.utils.d.ts","sourceRoot":"","sources":["../../src/scope/scope.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,EAGL,KAAK,OAAO,EACZ,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAE7B,KAAK,WAAW,EACjB,MAAM,WAAW,CAAC;AAInB;;;;;GAKG;AAEH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,sBAAsB,GAAG,wBAAwB,GAC1D,WAAW,
|
|
1
|
+
{"version":3,"file":"scope.utils.d.ts","sourceRoot":"","sources":["../../src/scope/scope.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAGvD,OAAO,EAGL,KAAK,OAAO,EACZ,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAE7B,KAAK,WAAW,EACjB,MAAM,WAAW,CAAC;AAInB;;;;;GAKG;AAEH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,sBAAsB,GAAG,wBAAwB,GAC1D,WAAW,CAiCb;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,sBAAsB,GAAG,WAAW,CAU7G;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,GAAG,KAAK,EAAE,CAO5D"}
|
|
@@ -14,8 +14,8 @@ export declare const DEFAULT_EXPRESS_BODY_LIMIT = "4mb";
|
|
|
14
14
|
export interface ExpressHostAdapterOptions {
|
|
15
15
|
/**
|
|
16
16
|
* CORS configuration.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* The middleware is installed only when `origin` is set to something other than `false`, so
|
|
18
|
+
* omitting `cors` — or passing `{}` / `{ origin: false }` — sends no CORS headers at all.
|
|
19
19
|
*/
|
|
20
20
|
cors?: CorsOptions;
|
|
21
21
|
/**
|
|
@@ -33,12 +33,44 @@ export interface ExpressHostAdapterOptions {
|
|
|
33
33
|
* when omitted.
|
|
34
34
|
*/
|
|
35
35
|
urlencodedLimit?: number | string;
|
|
36
|
+
/**
|
|
37
|
+
* Supplemental listener metadata for the default DNS-rebinding allow-list.
|
|
38
|
+
*
|
|
39
|
+
* The address and port are NOT read from here — they come from the arguments
|
|
40
|
+
* `start()` is actually called with, so the allow-list always describes the
|
|
41
|
+
* listener this process opened. `issuer` names the public host a proxy
|
|
42
|
+
* presents, which `start()` cannot know.
|
|
43
|
+
*/
|
|
44
|
+
listen?: {
|
|
45
|
+
issuer?: string;
|
|
46
|
+
};
|
|
36
47
|
}
|
|
37
48
|
export declare class ExpressHostAdapter extends HostServerAdapter {
|
|
38
49
|
private app;
|
|
39
50
|
private router;
|
|
40
51
|
private prepared;
|
|
52
|
+
/** Active host-validation middleware, or undefined while nothing is enforced. */
|
|
53
|
+
private hostValidation?;
|
|
54
|
+
/** Builds the derived allow-list, once this process commits to listening. */
|
|
55
|
+
private deriveHostValidation?;
|
|
41
56
|
constructor(options?: ExpressHostAdapterOptions);
|
|
57
|
+
/**
|
|
58
|
+
* Install DNS-rebinding protection.
|
|
59
|
+
*
|
|
60
|
+
* ON by default since v1.7.2 (BC-035). `allowedHosts` falls back to the names
|
|
61
|
+
* this process actually answers to — the loopback aliases with and without
|
|
62
|
+
* the bound port, the bound NIC address, and the configured issuer host.
|
|
63
|
+
*
|
|
64
|
+
* Escape hatches, in precedence order: explicit
|
|
65
|
+
* `security.dnsRebindingProtection.allowedHosts`, the
|
|
66
|
+
* `FRONTMCP_ALLOWED_HOSTS` env var, or `enabled: false` to turn it off.
|
|
67
|
+
*/
|
|
68
|
+
private installHostValidation;
|
|
69
|
+
/**
|
|
70
|
+
* Enable the DERIVED host allow-list. Called from `start()` only — see
|
|
71
|
+
* `installHostValidation`.
|
|
72
|
+
*/
|
|
73
|
+
private enableDerivedHostValidation;
|
|
42
74
|
registerRoute(method: HttpMethod, path: string, handler: ServerRequestHandler): void;
|
|
43
75
|
registerMiddleware(entryPath: string, handler: ServerRequestHandler): void;
|
|
44
76
|
enhancedHandler(handler: ServerRequestHandler): (req: express.Request, res: express.Response, next: express.NextFunction) => void | Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"express.host.adapter.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/express.host.adapter.ts"],"names":[],"mappings":"AAIA,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,UAAU,EAEf,KAAK,oBAAoB,EAE1B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"express.host.adapter.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/express.host.adapter.ts"],"names":[],"mappings":"AAIA,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,UAAU,EAEf,KAAK,oBAAoB,EAE1B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAIlF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,QAAQ,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE5B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAElC;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE;QACP,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED,qBAAa,kBAAmB,SAAQ,iBAAiB;IACvD,OAAO,CAAC,GAAG,CAAa;IACxB,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,QAAQ,CAAS;IACzB,iFAAiF;IACjF,OAAO,CAAC,cAAc,CAAC,CAAoD;IAC3E,6EAA6E;IAC7E,OAAO,CAAC,oBAAoB,CAAC,CAGsC;gBAEvD,OAAO,CAAC,EAAE,yBAAyB;IAmF/C;;;;;;;;;;OAUG;IACH,OAAO,CAAC,qBAAqB;IAoE7B;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IAMnC,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB;IAI7E,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB;IAInE,eAAe,CAAC,OAAO,EAAE,oBAAoB,IACnC,KAAK,OAAO,CAAC,OAAO,EAAE,KAAK,OAAO,CAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,YAAY;IAQjF;;;;OAIG;IACH,OAAO,IAAI,IAAI;IAMf;;;OAGG;IACH,UAAU,IAAI,OAAO,CAAC,WAAW;IAK3B,KAAK,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM;YAuCrD,kBAAkB;CASjC"}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Host Header Validation Middleware
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Express-side adapter over the transport-agnostic rules in
|
|
5
|
+
* `../security/host-validation`. The rules live there so the web-fetch
|
|
6
|
+
* (Worker/edge) handler applies exactly the same checks — two adapters must
|
|
7
|
+
* never diverge in behavior (.claude/rules/flow-architecture.md).
|
|
8
|
+
*
|
|
9
|
+
* Enabled by DEFAULT since v1.7.2 (BC-035, GHSA-mc9g-v2cp-vfff); the adapter
|
|
10
|
+
* decides whether to install it.
|
|
7
11
|
*/
|
|
8
12
|
import type { ServerRequest, ServerResponse } from '../../common';
|
|
9
13
|
/**
|
|
10
14
|
* Configuration for host validation middleware.
|
|
11
15
|
*/
|
|
12
16
|
export interface HostValidationOptions {
|
|
13
|
-
/** Whether host validation is enabled.
|
|
17
|
+
/** Whether host validation is enabled. */
|
|
14
18
|
enabled: boolean;
|
|
15
19
|
/** Allowed Host header values (e.g., ['localhost:3001', 'api.example.com']) */
|
|
16
20
|
allowedHosts?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-validation.middleware.d.ts","sourceRoot":"","sources":["../../../src/server/middleware/host-validation.middleware.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"host-validation.middleware.d.ts","sourceRoot":"","sources":["../../../src/server/middleware/host-validation.middleware.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAGlE;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,0CAA0C;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,uEAAuE;IACvE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,qBAAqB,GAC7B,CAAC,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,IAAI,KAAK,IAAI,CA2BrE"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host / Origin validation — the server-side half of DNS-rebinding protection
|
|
3
|
+
* (GHSA-mc9g-v2cp-vfff).
|
|
4
|
+
*
|
|
5
|
+
* A page on an attacker-controlled domain can rebind that domain to the
|
|
6
|
+
* victim's loopback address and then reach a local MCP server. The browser
|
|
7
|
+
* treats the result as same-origin, so CORS does not apply and binding to
|
|
8
|
+
* loopback does not help — loopback is the *destination* of the rebind. What
|
|
9
|
+
* does apply is that the request still names the attacker's hostname in `Host`,
|
|
10
|
+
* because that is the name the page was loaded from.
|
|
11
|
+
*
|
|
12
|
+
* This module is transport-agnostic on purpose: the Express adapter and the
|
|
13
|
+
* web-fetch (Worker/edge) handler both call it, so the two cannot drift apart
|
|
14
|
+
* (see .claude/rules/flow-architecture.md — adapters translate, they do not
|
|
15
|
+
* decide).
|
|
16
|
+
*/
|
|
17
|
+
export interface HostValidationRules {
|
|
18
|
+
/** Allowed `Host` values. Undefined disables host checking. */
|
|
19
|
+
allowedHosts?: string[];
|
|
20
|
+
/** Allowed `Origin` values. Undefined disables origin checking. */
|
|
21
|
+
allowedOrigins?: string[];
|
|
22
|
+
}
|
|
23
|
+
export interface HostValidationRejection {
|
|
24
|
+
status: 403;
|
|
25
|
+
error: 'Forbidden';
|
|
26
|
+
message: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Normalize a `Host` header for comparison.
|
|
30
|
+
*
|
|
31
|
+
* Hostnames are case-insensitive, and a default port may be present or omitted
|
|
32
|
+
* for the same host, so both forms normalize to the same key. IPv6 literals
|
|
33
|
+
* keep their brackets — `[::1]` and `::1` are different spellings of a host, and
|
|
34
|
+
* only the bracketed form is legal in a `Host` header.
|
|
35
|
+
*/
|
|
36
|
+
export declare function normalizeHost(value: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Normalize an `Origin` header (scheme + host, default port elided).
|
|
39
|
+
*
|
|
40
|
+
* The default port is scheme-specific: only `:80` is redundant for `http` and
|
|
41
|
+
* only `:443` for `https`. Eliding both regardless of scheme would make
|
|
42
|
+
* `https://app.example.com:80` compare equal to `https://app.example.com`, and a
|
|
43
|
+
* service on an untrusted port of an allowed hostname would pass the allowlist.
|
|
44
|
+
*
|
|
45
|
+
* `URL` applies exactly that rule and canonicalizes IPv6 literals on the way, so
|
|
46
|
+
* it does the work. Anything it cannot parse falls back to a lowercase compare,
|
|
47
|
+
* which is stricter, not looser.
|
|
48
|
+
*/
|
|
49
|
+
export declare function normalizeOrigin(value: string): string;
|
|
50
|
+
/** Precompiled rules — build once per server, not per request. */
|
|
51
|
+
export interface CompiledHostValidation {
|
|
52
|
+
hosts?: Set<string>;
|
|
53
|
+
origins?: Set<string>;
|
|
54
|
+
}
|
|
55
|
+
export declare function compileHostValidation(rules: HostValidationRules): CompiledHostValidation;
|
|
56
|
+
/**
|
|
57
|
+
* Validate a request's `Host`, `X-Forwarded-Host` and `Origin` headers.
|
|
58
|
+
*
|
|
59
|
+
* @returns `undefined` when the request is allowed, or the rejection to render.
|
|
60
|
+
*/
|
|
61
|
+
export declare function validateHostHeaders(headers: {
|
|
62
|
+
host?: string | undefined;
|
|
63
|
+
forwardedHost?: string | undefined;
|
|
64
|
+
origin?: string | undefined;
|
|
65
|
+
}, compiled: CompiledHostValidation): HostValidationRejection | undefined;
|
|
66
|
+
//# sourceMappingURL=host-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-validation.d.ts","sourceRoot":"","sources":["../../../src/server/security/host-validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,MAAM,WAAW,mBAAmB;IAClC,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,mEAAmE;IACnE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,GAAG,CAAC;IACZ,KAAK,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAanD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOrD;AAED,kEAAkE;AAClE,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,OAAO,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,mBAAmB,GAAG,sBAAsB,CAKxF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE;IACP,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,EACD,QAAQ,EAAE,sBAAsB,GAC/B,uBAAuB,GAAG,SAAS,CAqCrC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default `allowedHosts` derivation for DNS-rebinding protection
|
|
3
|
+
* (GHSA-mc9g-v2cp-vfff).
|
|
4
|
+
*
|
|
5
|
+
* Protection is on by default, which is only workable if the default allow-list
|
|
6
|
+
* is right without configuration. It is derived from what the server actually
|
|
7
|
+
* binds: the names a client can legitimately use to reach *this* process.
|
|
8
|
+
*/
|
|
9
|
+
export interface DeriveAllowedHostsInput {
|
|
10
|
+
/** Resolved bind address (e.g. '127.0.0.1', '0.0.0.0', '::'). */
|
|
11
|
+
bindAddress?: string;
|
|
12
|
+
/** Listening TCP port, when the server listens on one. */
|
|
13
|
+
port?: number;
|
|
14
|
+
/** Unix socket path — when set there is no TCP host to derive. */
|
|
15
|
+
socketPath?: string;
|
|
16
|
+
/** Configured issuer / public URL, so a deployed server keeps working. */
|
|
17
|
+
issuer?: string;
|
|
18
|
+
/** Extra hosts from `FRONTMCP_ALLOWED_HOSTS`. */
|
|
19
|
+
extraHosts?: string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* True when the address only accepts connections from this machine.
|
|
23
|
+
*
|
|
24
|
+
* Classifying a loopback listener as routable would disable the derived
|
|
25
|
+
* DNS-rebinding allow-list on exactly the server the attack targets, so every
|
|
26
|
+
* spelling of loopback has to resolve here.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isLoopbackAddress(address: string | undefined): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* True when the bind address means "reachable from the network".
|
|
31
|
+
*
|
|
32
|
+
* A wildcard bind, or a specific non-loopback NIC, is a deployed server: the
|
|
33
|
+
* names clients dial it by (a DNS name behind a proxy, a load-balancer host)
|
|
34
|
+
* are not knowable from inside the process.
|
|
35
|
+
*/
|
|
36
|
+
export declare function isRoutableBind(address: string | undefined): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Derive the hosts a request may legitimately name.
|
|
39
|
+
*
|
|
40
|
+
* A loopback-bound server is only reachable as a loopback name, so the derived
|
|
41
|
+
* list is exact and can be enforced as-is — which is precisely the DNS-rebinding
|
|
42
|
+
* threat model (the attacker rebinds a domain to the victim's 127.0.0.1).
|
|
43
|
+
*
|
|
44
|
+
* A server bound to a routable address is reached by names this process cannot
|
|
45
|
+
* enumerate. `deriveAllowedHosts` returns what it can (the loopback aliases, the
|
|
46
|
+
* bound NIC, the issuer host); the caller decides whether that is enough to
|
|
47
|
+
* enforce — see {@link shouldEnforceDerivedHosts}.
|
|
48
|
+
*/
|
|
49
|
+
export declare function deriveAllowedHosts(input: DeriveAllowedHostsInput): string[];
|
|
50
|
+
/**
|
|
51
|
+
* Whether a DERIVED (not operator-supplied) host list may be enforced.
|
|
52
|
+
*
|
|
53
|
+
* Enforcing a derived list on a routable bind would 403 every request that
|
|
54
|
+
* arrives under the deployment's real hostname — a proxied server upgrading a
|
|
55
|
+
* patch version would go dark. So a derived list is enforced only when the
|
|
56
|
+
* server is loopback-bound, or when the operator gave us a public name to add
|
|
57
|
+
* (an issuer URL or FRONTMCP_ALLOWED_HOSTS). Otherwise the caller should warn
|
|
58
|
+
* and leave Host checking off until `allowedHosts` is configured.
|
|
59
|
+
*/
|
|
60
|
+
export declare function shouldEnforceDerivedHosts(input: DeriveAllowedHostsInput): boolean;
|
|
61
|
+
/** Parse the `FRONTMCP_ALLOWED_HOSTS` escape hatch (comma-separated). */
|
|
62
|
+
export declare function allowedHostsFromEnv(env?: NodeJS.ProcessEnv): string[] | undefined;
|
|
63
|
+
//# sourceMappingURL=resolve-allowed-hosts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-allowed-hosts.d.ts","sourceRoot":"","sources":["../../../src/server/security/resolve-allowed-hosts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,MAAM,WAAW,uBAAuB;IACtC,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAsBD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAWtE;AAiBD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAGnE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,MAAM,EAAE,CAkC3E;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAiBjF;AAED,yEAAyE;AACzE,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,EAAE,GAAG,SAAS,CAQ9F"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Security Audit — Production Readiness Warnings
|
|
3
3
|
*
|
|
4
|
-
* Logs security-relevant configuration at server startup
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Logs security-relevant configuration at server startup so an operator can see
|
|
5
|
+
* what the transport actually exposes. The audit only reports — it never changes
|
|
6
|
+
* behaviour; the safe choices are the defaults themselves (loopback binding, no
|
|
7
|
+
* CORS headers), and this flags where a config opts out of them.
|
|
7
8
|
*/
|
|
8
9
|
import type { CorsOptions } from '../../common';
|
|
9
10
|
/**
|
|
10
11
|
* Security configuration for the audit.
|
|
11
12
|
*/
|
|
12
13
|
export interface SecurityAuditConfig {
|
|
13
|
-
/** CORS configuration (undefined =
|
|
14
|
+
/** CORS configuration (undefined = the default: no CORS headers, same-origin only) */
|
|
14
15
|
cors?: CorsOptions | false;
|
|
15
16
|
/** Security options from HttpOptionsInterface */
|
|
16
17
|
security?: {
|
|
@@ -58,6 +59,8 @@ export declare function logSecurityFindings(findings: SecurityFinding[], logger:
|
|
|
58
59
|
/**
|
|
59
60
|
* Resolve the effective bind address based on configuration and deployment mode.
|
|
60
61
|
*
|
|
62
|
+
* Precedence: explicit config > FRONTMCP_BIND_ADDRESS > strict mode > deployment mode > loopback.
|
|
63
|
+
*
|
|
61
64
|
* @param security - Security configuration
|
|
62
65
|
* @param deploymentMode - Current deployment mode
|
|
63
66
|
* @returns Resolved IP address string
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security-audit.d.ts","sourceRoot":"","sources":["../../../src/server/security/security-audit.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"security-audit.d.ts","sourceRoot":"","sources":["../../../src/server/security/security-audit.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,sFAAsF;IACtF,IAAI,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC;IAC3B,iDAAiD;IACjD,QAAQ,CAAC,EAAE;QACT,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,WAAW,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,MAAM,CAAC;QAC1C,sBAAsB,CAAC,EAAE;YACvB,OAAO,CAAC,EAAE,OAAO,CA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,gBAAgB,CAAC,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,sBAAsB,GAAG,IAAI;IAK1F;;;OAGG;IACH,eAAe,CAAC,YAAY,EAAE,sBAAsB,GAAG,IAAI;IAI3D;;;OAGG;IACH,iBAAiB,CAAC,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,uBAAuB,GAAG,IAAI;IAK/F;;;;OAIG;IACH,gBAAgB,CAAC,aAAa,EAAE,uBAAuB,GAAG,IAAI;IAI9D,OAAO;IA0BP,UAAU,IAAI,OAAO;IAIf,KAAK;CAqBZ"}
|
package/server/server.types.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
3
|
-
import type
|
|
4
|
-
import type
|
|
5
|
-
import type
|
|
6
|
-
import type { Scope } from '../scope';
|
|
1
|
+
import { type AuthInfo, type StreamableHTTPServerTransport } from '@frontmcp/protocol';
|
|
2
|
+
import { type Authorization, type ServerRequest, type SessionIdPayload, type UserClaim } from '../common';
|
|
3
|
+
import { type Scope } from '../scope';
|
|
4
|
+
import { type SSEServerTransport } from '../transport/adapters/base-sse-transport';
|
|
5
|
+
import { type LocalTransportAdapter } from '../transport/adapters/transport.local.adapter';
|
|
7
6
|
export interface ScopedServerRequest extends ServerRequest {
|
|
8
7
|
authScope: Scope;
|
|
9
8
|
auth?: AuthInfo;
|
|
@@ -22,6 +21,12 @@ declare module '@frontmcp/protocol' {
|
|
|
22
21
|
user: UserClaim;
|
|
23
22
|
sessionId: string;
|
|
24
23
|
sessionIdPayload: SessionIdPayload;
|
|
24
|
+
/**
|
|
25
|
+
* Verified token claims, as resolved by the auth flow. Surfaced so
|
|
26
|
+
* permission checks can read roles/tenancy without reaching into
|
|
27
|
+
* `extra.authorization`.
|
|
28
|
+
*/
|
|
29
|
+
claims?: Record<string, unknown>;
|
|
25
30
|
}
|
|
26
31
|
}
|
|
27
32
|
//# sourceMappingURL=server.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.types.d.ts","sourceRoot":"","sources":["../../src/server/server.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"server.types.d.ts","sourceRoot":"","sources":["../../src/server/server.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEvF,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAC1G,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AAE3F,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD,SAAS,EAAE,KAAK,CAAC;IACjB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,WAAW,CAAC,EAAE,aAAa,CAAC;CAC7B;AAED,MAAM,WAAW,0BAA2B,SAAQ,mBAAmB;IACrE,IAAI,EAAE,QAAQ,CAAC;IACf,WAAW,EAAE,aAAa,CAAC;CAC5B;AAED,MAAM,WAAW,WAAY,SAAQ,QAAQ;IAC3C,SAAS,EAAE,qBAAqB,CAAC,6BAA6B,GAAG,kBAAkB,CAAC,CAAC;CACtF;AAED,OAAO,QAAQ,oBAAoB,CAAC;IAClC,UAAiB,QAAQ;QACvB,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,SAAS,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,gBAAgB,EAAE,gBAAgB,CAAC;QACnC;;;;WAIG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAClC;CACF"}
|