@frontmcp/testing 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.
@@ -3149,6 +3149,15 @@ function findWorkspaceNodeModulesDir(startDir) {
3149
3149
  });
3150
3150
  }
3151
3151
 
3152
+ // libs/testing/src/fixtures/gateway-token-binding.ts
3153
+ import { trimSlashes, trimTrailing } from "@frontmcp/utils";
3154
+ function gatewayTokenBinding(serverUrl, entryPath) {
3155
+ const base = trimTrailing(serverUrl, "/");
3156
+ const prefix = trimSlashes(entryPath ?? "");
3157
+ const mcpUrl = prefix ? `${base}/${prefix}` : base;
3158
+ return { issuer: mcpUrl, audience: mcpUrl };
3159
+ }
3160
+
3152
3161
  // libs/testing/src/fixtures/test-fixture.ts
3153
3162
  var describe = _describe;
3154
3163
  var beforeAll = _beforeAll;
@@ -3165,10 +3174,6 @@ function currentSkipScope() {
3165
3174
  return skipScopes[skipScopes.length - 1];
3166
3175
  }
3167
3176
  async function initializeSharedResources() {
3168
- if (!tokenFactory) {
3169
- const sharedSecret = currentConfig.env?.["JWT_SECRET"];
3170
- tokenFactory = new TestTokenFactory(sharedSecret ? { hmacSecret: sharedSecret } : {});
3171
- }
3172
3177
  if (!serverInstance) {
3173
3178
  if (currentConfig.baseUrl && !currentConfig.server) {
3174
3179
  serverInstance = TestServer.connect(currentConfig.baseUrl);
@@ -3210,6 +3215,11 @@ Error: ${errMsg}`
3210
3215
  );
3211
3216
  }
3212
3217
  }
3218
+ if (!tokenFactory) {
3219
+ const sharedSecret = currentConfig.env?.["JWT_SECRET"];
3220
+ const binding = serverInstance ? gatewayTokenBinding(resolveClientBaseUrl(serverInstance), currentConfig.entryPath) : void 0;
3221
+ tokenFactory = new TestTokenFactory(sharedSecret ? { hmacSecret: sharedSecret, ...binding } : {});
3222
+ }
3213
3223
  }
3214
3224
  async function createTestFixtures() {
3215
3225
  await initializeSharedResources();
package/esm/index.mjs CHANGED
@@ -4934,6 +4934,17 @@ import {
4934
4934
  describe as _describe,
4935
4935
  it as _it
4936
4936
  } from "@jest/globals";
4937
+
4938
+ // libs/testing/src/fixtures/gateway-token-binding.ts
4939
+ import { trimSlashes, trimTrailing } from "@frontmcp/utils";
4940
+ function gatewayTokenBinding(serverUrl, entryPath) {
4941
+ const base = trimTrailing(serverUrl, "/");
4942
+ const prefix = trimSlashes(entryPath ?? "");
4943
+ const mcpUrl = prefix ? `${base}/${prefix}` : base;
4944
+ return { issuer: mcpUrl, audience: mcpUrl };
4945
+ }
4946
+
4947
+ // libs/testing/src/fixtures/test-fixture.ts
4937
4948
  var describe2 = _describe;
4938
4949
  var beforeAll2 = _beforeAll;
4939
4950
  var beforeEach2 = _beforeEach;
@@ -4949,10 +4960,6 @@ function currentSkipScope() {
4949
4960
  return skipScopes[skipScopes.length - 1];
4950
4961
  }
4951
4962
  async function initializeSharedResources() {
4952
- if (!tokenFactory) {
4953
- const sharedSecret = currentConfig.env?.["JWT_SECRET"];
4954
- tokenFactory = new TestTokenFactory(sharedSecret ? { hmacSecret: sharedSecret } : {});
4955
- }
4956
4963
  if (!serverInstance) {
4957
4964
  if (currentConfig.baseUrl && !currentConfig.server) {
4958
4965
  serverInstance = TestServer.connect(currentConfig.baseUrl);
@@ -4994,6 +5001,11 @@ Error: ${errMsg}`
4994
5001
  );
4995
5002
  }
4996
5003
  }
5004
+ if (!tokenFactory) {
5005
+ const sharedSecret = currentConfig.env?.["JWT_SECRET"];
5006
+ const binding = serverInstance ? gatewayTokenBinding(resolveClientBaseUrl(serverInstance), currentConfig.entryPath) : void 0;
5007
+ tokenFactory = new TestTokenFactory(sharedSecret ? { hmacSecret: sharedSecret, ...binding } : {});
5008
+ }
4997
5009
  }
4998
5010
  async function createTestFixtures() {
4999
5011
  await initializeSharedResources();
package/esm/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontmcp/testing",
3
- "version": "1.8.2",
3
+ "version": "1.8.3",
4
4
  "description": "E2E testing framework for FrontMCP servers - MCP client, auth mocks, Playwright integration",
5
5
  "author": "AgentFront <info@agentfront.dev>",
6
6
  "homepage": "https://docs.agentfront.dev",
@@ -87,9 +87,9 @@
87
87
  "./esm": null
88
88
  },
89
89
  "peerDependencies": {
90
- "@frontmcp/lazy-zod": "1.8.2",
91
- "@frontmcp/sdk": "1.8.2",
92
- "@frontmcp/ui": "1.8.2",
90
+ "@frontmcp/lazy-zod": "1.8.3",
91
+ "@frontmcp/sdk": "1.8.3",
92
+ "@frontmcp/ui": "1.8.3",
93
93
  "@jest/globals": "^29.0.0 || ^30.0.0",
94
94
  "@playwright/test": "^1.40.0",
95
95
  "jest": "^29.0.0 || ^30.0.0"
@@ -112,8 +112,8 @@
112
112
  "node": ">=24.0.0"
113
113
  },
114
114
  "dependencies": {
115
- "@frontmcp/protocol": "1.8.2",
116
- "@frontmcp/utils": "1.8.2",
115
+ "@frontmcp/protocol": "1.8.3",
116
+ "@frontmcp/utils": "1.8.3",
117
117
  "jose": "^6.0.11",
118
118
  "tslib": "^2.3.0"
119
119
  },
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The `iss` and `aud` a gateway-mode server (public, local or remote mode,
3
+ * HS256 tokens signed with `JWT_SECRET`) puts on the tokens it mints, and
4
+ * requires on the tokens it accepts (#269).
5
+ *
6
+ * Both are the server's MCP URL: its address plus `http.entryPath`, normalized
7
+ * the way the server does it (`'mcp'`, `'/mcp'` and `'/mcp/'` are the same
8
+ * path, and a root entry path adds nothing).
9
+ */
10
+ export declare function gatewayTokenBinding(serverUrl: string, entryPath?: string): {
11
+ issuer: string;
12
+ audience: string;
13
+ };
14
+ //# sourceMappingURL=gateway-token-binding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gateway-token-binding.d.ts","sourceRoot":"","sources":["../../src/fixtures/gateway-token-binding.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAK/G"}
package/fixtures/index.js CHANGED
@@ -3165,6 +3165,15 @@ function findWorkspaceNodeModulesDir(startDir) {
3165
3165
  });
3166
3166
  }
3167
3167
 
3168
+ // libs/testing/src/fixtures/gateway-token-binding.ts
3169
+ var import_utils2 = require("@frontmcp/utils");
3170
+ function gatewayTokenBinding(serverUrl, entryPath) {
3171
+ const base = (0, import_utils2.trimTrailing)(serverUrl, "/");
3172
+ const prefix = (0, import_utils2.trimSlashes)(entryPath ?? "");
3173
+ const mcpUrl = prefix ? `${base}/${prefix}` : base;
3174
+ return { issuer: mcpUrl, audience: mcpUrl };
3175
+ }
3176
+
3168
3177
  // libs/testing/src/fixtures/test-fixture.ts
3169
3178
  var describe = import_globals.describe;
3170
3179
  var beforeAll = import_globals.beforeAll;
@@ -3181,10 +3190,6 @@ function currentSkipScope() {
3181
3190
  return skipScopes[skipScopes.length - 1];
3182
3191
  }
3183
3192
  async function initializeSharedResources() {
3184
- if (!tokenFactory) {
3185
- const sharedSecret = currentConfig.env?.["JWT_SECRET"];
3186
- tokenFactory = new TestTokenFactory(sharedSecret ? { hmacSecret: sharedSecret } : {});
3187
- }
3188
3193
  if (!serverInstance) {
3189
3194
  if (currentConfig.baseUrl && !currentConfig.server) {
3190
3195
  serverInstance = TestServer.connect(currentConfig.baseUrl);
@@ -3226,6 +3231,11 @@ Error: ${errMsg}`
3226
3231
  );
3227
3232
  }
3228
3233
  }
3234
+ if (!tokenFactory) {
3235
+ const sharedSecret = currentConfig.env?.["JWT_SECRET"];
3236
+ const binding = serverInstance ? gatewayTokenBinding(resolveClientBaseUrl(serverInstance), currentConfig.entryPath) : void 0;
3237
+ tokenFactory = new TestTokenFactory(sharedSecret ? { hmacSecret: sharedSecret, ...binding } : {});
3238
+ }
3229
3239
  }
3230
3240
  async function createTestFixtures() {
3231
3241
  await initializeSharedResources();
@@ -1 +1 @@
1
- {"version":3,"file":"test-fixture.d.ts","sourceRoot":"","sources":["../../src/fixtures/test-fixture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAeH,OAAO,KAAK,EAIV,YAAY,EAGZ,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AAoDzB;;GAEG;AACH,iBAAe,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,CA6DxD;AAED;;GAEG;AACH,iBAAe,kBAAkB,IAAI,OAAO,CAAC,YAAY,CAAC,CAmDzD;AAED;;;;GAIG;AACH,iBAAe,mBAAmB,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB5F;AAED;;GAEG;AACH,iBAAe,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAQrD;AAsRD,QAAA,MAAM,IAAI,EAAuB,gBAAgB,CAAC;AAqBlD,OAAO,EAAE,IAAI,EAAE,CAAC;AAGhB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,CAAC"}
1
+ {"version":3,"file":"test-fixture.d.ts","sourceRoot":"","sources":["../../src/fixtures/test-fixture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAeH,OAAO,KAAK,EAIV,YAAY,EAGZ,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AAqDzB;;GAEG;AACH,iBAAe,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,CAkExD;AAED;;GAEG;AACH,iBAAe,kBAAkB,IAAI,OAAO,CAAC,YAAY,CAAC,CAmDzD;AAED;;;;GAIG;AACH,iBAAe,mBAAmB,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB5F;AAED;;GAEG;AACH,iBAAe,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAQrD;AAsRD,QAAA,MAAM,IAAI,EAAuB,gBAAgB,CAAC;AAqBlD,OAAO,EAAE,IAAI,EAAE,CAAC;AAGhB,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,CAAC"}
package/index.js CHANGED
@@ -5046,6 +5046,17 @@ function hasMimeType(result, mimeType) {
5046
5046
 
5047
5047
  // libs/testing/src/fixtures/test-fixture.ts
5048
5048
  var import_globals = require("@jest/globals");
5049
+
5050
+ // libs/testing/src/fixtures/gateway-token-binding.ts
5051
+ var import_utils2 = require("@frontmcp/utils");
5052
+ function gatewayTokenBinding(serverUrl, entryPath) {
5053
+ const base = (0, import_utils2.trimTrailing)(serverUrl, "/");
5054
+ const prefix = (0, import_utils2.trimSlashes)(entryPath ?? "");
5055
+ const mcpUrl = prefix ? `${base}/${prefix}` : base;
5056
+ return { issuer: mcpUrl, audience: mcpUrl };
5057
+ }
5058
+
5059
+ // libs/testing/src/fixtures/test-fixture.ts
5049
5060
  var describe2 = import_globals.describe;
5050
5061
  var beforeAll2 = import_globals.beforeAll;
5051
5062
  var beforeEach2 = import_globals.beforeEach;
@@ -5061,10 +5072,6 @@ function currentSkipScope() {
5061
5072
  return skipScopes[skipScopes.length - 1];
5062
5073
  }
5063
5074
  async function initializeSharedResources() {
5064
- if (!tokenFactory) {
5065
- const sharedSecret = currentConfig.env?.["JWT_SECRET"];
5066
- tokenFactory = new TestTokenFactory(sharedSecret ? { hmacSecret: sharedSecret } : {});
5067
- }
5068
5075
  if (!serverInstance) {
5069
5076
  if (currentConfig.baseUrl && !currentConfig.server) {
5070
5077
  serverInstance = TestServer.connect(currentConfig.baseUrl);
@@ -5106,6 +5113,11 @@ Error: ${errMsg}`
5106
5113
  );
5107
5114
  }
5108
5115
  }
5116
+ if (!tokenFactory) {
5117
+ const sharedSecret = currentConfig.env?.["JWT_SECRET"];
5118
+ const binding = serverInstance ? gatewayTokenBinding(resolveClientBaseUrl(serverInstance), currentConfig.entryPath) : void 0;
5119
+ tokenFactory = new TestTokenFactory(sharedSecret ? { hmacSecret: sharedSecret, ...binding } : {});
5120
+ }
5109
5121
  }
5110
5122
  async function createTestFixtures() {
5111
5123
  await initializeSharedResources();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontmcp/testing",
3
- "version": "1.8.2",
3
+ "version": "1.8.3",
4
4
  "description": "E2E testing framework for FrontMCP servers - MCP client, auth mocks, Playwright integration",
5
5
  "author": "AgentFront <info@agentfront.dev>",
6
6
  "homepage": "https://docs.agentfront.dev",
@@ -87,9 +87,9 @@
87
87
  "./esm": null
88
88
  },
89
89
  "peerDependencies": {
90
- "@frontmcp/lazy-zod": "1.8.2",
91
- "@frontmcp/sdk": "1.8.2",
92
- "@frontmcp/ui": "1.8.2",
90
+ "@frontmcp/lazy-zod": "1.8.3",
91
+ "@frontmcp/sdk": "1.8.3",
92
+ "@frontmcp/ui": "1.8.3",
93
93
  "@jest/globals": "^29.0.0 || ^30.0.0",
94
94
  "@playwright/test": "^1.40.0",
95
95
  "jest": "^29.0.0 || ^30.0.0"
@@ -112,8 +112,8 @@
112
112
  "node": ">=24.0.0"
113
113
  },
114
114
  "dependencies": {
115
- "@frontmcp/protocol": "1.8.2",
116
- "@frontmcp/utils": "1.8.2",
115
+ "@frontmcp/protocol": "1.8.3",
116
+ "@frontmcp/utils": "1.8.3",
117
117
  "jose": "^6.0.11",
118
118
  "tslib": "^2.3.0"
119
119
  },