@frontmcp/plugin-dashboard 1.7.2 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,15 +18,5 @@ export interface DashboardAuthResult {
18
18
  status?: 401;
19
19
  message?: string;
20
20
  }
21
- /**
22
- * Create the dashboard's HTTP auth check.
23
- *
24
- * Returns `undefined` when authentication is not enabled, so the caller can skip
25
- * the check entirely rather than branch on a permissive validator.
26
- *
27
- * A token may be presented as `Authorization: Bearer <token>` (preferred — a URL
28
- * token lands in access logs, `Referer` headers and browser history) or as
29
- * `?token=<token>`, which is what the documented dashboard link uses.
30
- */
31
21
  export declare function createDashboardAuthValidator(auth: DashboardAuth | undefined): ((req: DashboardAuthRequest) => DashboardAuthResult) | undefined;
32
22
  //# sourceMappingURL=dashboard-auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard-auth.d.ts","sourceRoot":"","sources":["../../src/auth/dashboard-auth.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;;;;;;;;GASG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;CACnE;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA6BD;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,aAAa,GAAG,SAAS,GAC9B,CAAC,CAAC,GAAG,EAAE,oBAAoB,KAAK,mBAAmB,CAAC,GAAG,SAAS,CAsBlE"}
1
+ {"version":3,"file":"dashboard-auth.d.ts","sourceRoot":"","sources":["../../src/auth/dashboard-auth.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;;;;;;;;GASG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;CACnE;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAyDD,wBAAgB,4BAA4B,CAC1C,IAAI,EAAE,aAAa,GAAG,SAAS,GAC9B,CAAC,CAAC,GAAG,EAAE,oBAAoB,KAAK,mBAAmB,CAAC,GAAG,SAAS,CAqBlE"}
@@ -20,6 +20,13 @@ export declare function publishDashboardOptions(options: DashboardPluginOptions)
20
20
  * otherwise the defaults merged with whatever the caller supplied.
21
21
  */
22
22
  export declare function resolveDashboardOptions(fallback?: DashboardPluginOptionsInput): DashboardPluginOptions;
23
- /** Test seam — clears the published options between cases. */
23
+ /**
24
+ * Clear the published options.
25
+ *
26
+ * Dashboard options are process-wide, and a second CONFLICTING auth
27
+ * configuration now throws rather than silently replacing the first (BC-036).
28
+ * A host that builds several servers serially — a test suite, a CLI that
29
+ * reconfigures between runs — calls this between constructions.
30
+ */
24
31
  export declare function resetDashboardOptions(): void;
25
32
  //# sourceMappingURL=dashboard.config-store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard.config-store.d.ts","sourceRoot":"","sources":["../src/dashboard.config-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EACjC,MAAM,mBAAmB,CAAC;AAmB3B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,sBAAsB,GAAG,IAAI,CAuB7E;AAyBD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,GAAE,2BAAgC,GAAG,sBAAsB,CAG1G;AAED,8DAA8D;AAC9D,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C"}
1
+ {"version":3,"file":"dashboard.config-store.d.ts","sourceRoot":"","sources":["../src/dashboard.config-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EACjC,MAAM,mBAAmB,CAAC;AAmB3B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,sBAAsB,GAAG,IAAI,CAuB7E;AAyBD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,GAAE,2BAAgC,GAAG,sBAAsB,CAG1G;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C"}
package/esm/index.mjs CHANGED
@@ -368,6 +368,9 @@ function resolveDashboardOptions(fallback = {}) {
368
368
  if (publishedOptions) return publishedOptions;
369
369
  return dashboardPluginOptionsSchema.parse({ ...defaultDashboardPluginOptions, ...fallback });
370
370
  }
371
+ function resetDashboardOptions() {
372
+ publishedOptions = void 0;
373
+ }
371
374
 
372
375
  // plugins/plugin-dashboard/src/dashboard.symbol.ts
373
376
  var DashboardConfigToken = /* @__PURE__ */ Symbol("DashboardConfig");
@@ -3724,6 +3727,14 @@ function tokenMatches(presented, expected) {
3724
3727
  if (presented.length === 0 || expected.length === 0) return false;
3725
3728
  return timingSafeEqual(sha256(presented), sha256(expected));
3726
3729
  }
3730
+ function readBearerToken(header) {
3731
+ if (!header) return void 0;
3732
+ const separator = header.indexOf(" ");
3733
+ if (separator === -1) return void 0;
3734
+ if (header.slice(0, separator).toLowerCase() !== "bearer") return void 0;
3735
+ const token = header.slice(separator + 1).trim();
3736
+ return token.length > 0 ? token : void 0;
3737
+ }
3727
3738
  function createDashboardAuthValidator(auth) {
3728
3739
  if (!auth?.enabled) return void 0;
3729
3740
  const expected = auth.token;
@@ -3731,8 +3742,7 @@ function createDashboardAuthValidator(auth) {
3731
3742
  if (!expected) {
3732
3743
  return { authorized: false, status: 401, message: "Dashboard authentication is misconfigured" };
3733
3744
  }
3734
- const header = readHeader(req.headers, "authorization");
3735
- const bearer = header?.startsWith("Bearer ") ? header.slice("Bearer ".length) : void 0;
3745
+ const bearer = readBearerToken(readHeader(req.headers, "authorization"));
3736
3746
  if (bearer && tokenMatches(bearer, expected)) return AUTHORIZED;
3737
3747
  const queryToken = readQuery(req.query, "token");
3738
3748
  if (queryToken && tokenMatches(queryToken, expected)) return AUTHORIZED;
@@ -4915,5 +4925,6 @@ export {
4915
4925
  dashboardPluginOptionsSchema,
4916
4926
  DashboardPlugin as default,
4917
4927
  defaultDashboardPluginOptions,
4918
- isDashboardEnabled
4928
+ isDashboardEnabled,
4929
+ resetDashboardOptions
4919
4930
  };
package/esm/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontmcp/plugin-dashboard",
3
- "version": "1.7.2",
3
+ "version": "1.8.0",
4
4
  "description": "Dashboard plugin for FrontMCP - visual monitoring and introspection of MCP servers",
5
5
  "author": "AgentFront <info@agentfront.dev>",
6
6
  "license": "Apache-2.0",
@@ -47,12 +47,12 @@
47
47
  }
48
48
  },
49
49
  "dependencies": {
50
- "@frontmcp/sdk": "1.7.2"
50
+ "@frontmcp/sdk": "1.8.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "reflect-metadata": "^0.2.2"
54
54
  },
55
55
  "peerDependencies": {
56
- "@frontmcp/lazy-zod": "1.7.2"
56
+ "@frontmcp/lazy-zod": "1.8.0"
57
57
  }
58
58
  }
package/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export { default, default as DashboardPlugin } from './dashboard.plugin';
2
2
  export { DashboardApp } from './app';
3
3
  export { DashboardPluginOptions, DashboardPluginOptionsInput, dashboardPluginOptionsSchema, defaultDashboardPluginOptions, isDashboardEnabled, } from './dashboard.types';
4
+ export { resetDashboardOptions } from './dashboard.config-store';
4
5
  export { DashboardConfigToken, GraphDataProviderToken, ParentScopeToken } from './dashboard.symbol';
5
6
  export type { GraphData, GraphNode, GraphEdge, GraphMetadata } from './shared/types';
6
7
  export { GraphDataProvider } from './providers';
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGzE,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAGrC,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,EAC7B,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGpG,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGzE,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAGrC,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,EAC7B,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGjE,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGpG,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,6BAA6B,CAAC"}
package/index.js CHANGED
@@ -297,7 +297,8 @@ __export(index_exports, {
297
297
  dashboardPluginOptionsSchema: () => dashboardPluginOptionsSchema,
298
298
  default: () => DashboardPlugin,
299
299
  defaultDashboardPluginOptions: () => defaultDashboardPluginOptions,
300
- isDashboardEnabled: () => isDashboardEnabled
300
+ isDashboardEnabled: () => isDashboardEnabled,
301
+ resetDashboardOptions: () => resetDashboardOptions
301
302
  });
302
303
  module.exports = __toCommonJS(index_exports);
303
304
 
@@ -387,6 +388,9 @@ function resolveDashboardOptions(fallback = {}) {
387
388
  if (publishedOptions) return publishedOptions;
388
389
  return dashboardPluginOptionsSchema.parse({ ...defaultDashboardPluginOptions, ...fallback });
389
390
  }
391
+ function resetDashboardOptions() {
392
+ publishedOptions = void 0;
393
+ }
390
394
 
391
395
  // plugins/plugin-dashboard/src/dashboard.symbol.ts
392
396
  var DashboardConfigToken = /* @__PURE__ */ Symbol("DashboardConfig");
@@ -3737,6 +3741,14 @@ function tokenMatches(presented, expected) {
3737
3741
  if (presented.length === 0 || expected.length === 0) return false;
3738
3742
  return timingSafeEqual(sha256(presented), sha256(expected));
3739
3743
  }
3744
+ function readBearerToken(header) {
3745
+ if (!header) return void 0;
3746
+ const separator = header.indexOf(" ");
3747
+ if (separator === -1) return void 0;
3748
+ if (header.slice(0, separator).toLowerCase() !== "bearer") return void 0;
3749
+ const token = header.slice(separator + 1).trim();
3750
+ return token.length > 0 ? token : void 0;
3751
+ }
3740
3752
  function createDashboardAuthValidator(auth) {
3741
3753
  if (!auth?.enabled) return void 0;
3742
3754
  const expected = auth.token;
@@ -3744,8 +3756,7 @@ function createDashboardAuthValidator(auth) {
3744
3756
  if (!expected) {
3745
3757
  return { authorized: false, status: 401, message: "Dashboard authentication is misconfigured" };
3746
3758
  }
3747
- const header = readHeader(req.headers, "authorization");
3748
- const bearer = header?.startsWith("Bearer ") ? header.slice("Bearer ".length) : void 0;
3759
+ const bearer = readBearerToken(readHeader(req.headers, "authorization"));
3749
3760
  if (bearer && tokenMatches(bearer, expected)) return AUTHORIZED;
3750
3761
  const queryToken = readQuery(req.query, "token");
3751
3762
  if (queryToken && tokenMatches(queryToken, expected)) return AUTHORIZED;
@@ -4928,5 +4939,6 @@ DashboardApp = __decorateClass([
4928
4939
  ParentScopeToken,
4929
4940
  dashboardPluginOptionsSchema,
4930
4941
  defaultDashboardPluginOptions,
4931
- isDashboardEnabled
4942
+ isDashboardEnabled,
4943
+ resetDashboardOptions
4932
4944
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontmcp/plugin-dashboard",
3
- "version": "1.7.2",
3
+ "version": "1.8.0",
4
4
  "description": "Dashboard plugin for FrontMCP - visual monitoring and introspection of MCP servers",
5
5
  "author": "AgentFront <info@agentfront.dev>",
6
6
  "license": "Apache-2.0",
@@ -47,12 +47,12 @@
47
47
  }
48
48
  },
49
49
  "dependencies": {
50
- "@frontmcp/sdk": "1.7.2"
50
+ "@frontmcp/sdk": "1.8.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "reflect-metadata": "^0.2.2"
54
54
  },
55
55
  "peerDependencies": {
56
- "@frontmcp/lazy-zod": "1.7.2"
56
+ "@frontmcp/lazy-zod": "1.8.0"
57
57
  }
58
58
  }