@tsed/platform-mcp 8.44.8 → 8.44.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/platform-mcp",
3
- "version": "8.44.8",
3
+ "version": "8.44.10",
4
4
  "description": "Model Context Protocol integration for Ts.ED HTTP adapters.",
5
5
  "source": "./src/http/index.ts",
6
6
  "type": "module",
@@ -51,14 +51,14 @@
51
51
  "uuid": ">=11.0.2"
52
52
  },
53
53
  "devDependencies": {
54
- "@tsed/barrels": "8.44.8",
55
- "@tsed/core": "8.44.8",
56
- "@tsed/di": "8.44.8",
57
- "@tsed/exceptions": "8.44.8",
58
- "@tsed/json-mapper": "8.44.8",
59
- "@tsed/platform-http": "8.44.8",
60
- "@tsed/schema": "8.44.8",
61
- "@tsed/typescript": "8.44.8",
54
+ "@tsed/barrels": "8.44.10",
55
+ "@tsed/core": "8.44.10",
56
+ "@tsed/di": "8.44.10",
57
+ "@tsed/exceptions": "8.44.10",
58
+ "@tsed/json-mapper": "8.44.10",
59
+ "@tsed/platform-http": "8.44.10",
60
+ "@tsed/schema": "8.44.10",
61
+ "@tsed/typescript": "8.44.10",
62
62
  "jose": "^6.1.3",
63
63
  "typescript": "6.0.2",
64
64
  "vitest": "4.1.4"
@@ -14,6 +14,12 @@ const authInfo: AuthInfo = {
14
14
  expiresAt: Math.floor(Date.now() / 1000) + 3600
15
15
  };
16
16
 
17
+ // verifyBearerToken() adds the protected resource metadata URL to the verified identity
18
+ const verifiedAuthInfo: AuthInfo = {
19
+ ...authInfo,
20
+ resourceMetadataUrl: "https://api.example.com/.well-known/oauth-protected-resource/mcp"
21
+ };
22
+
17
23
  class ApiKeyPreAuth implements PlatformMcpPreAuth {
18
24
  preAuth($ctx: PlatformContext) {
19
25
  return {token: String($ctx.request.headers["x-api-key"]), clientId: "api-key", scopes: []};
@@ -227,7 +233,7 @@ describe("PlatformMcpAuthService", () => {
227
233
 
228
234
  const result = await service.verifyMcpRequest(createAuth({verifier}), createContext({authorization: "Bearer valid"}));
229
235
 
230
- expect(result).toEqual(authInfo);
236
+ expect(result).toEqual(verifiedAuthInfo);
231
237
  expect(verifier.verifyAccessToken).toHaveBeenCalledExactlyOnceWith("valid");
232
238
  });
233
239
 
@@ -278,7 +284,7 @@ describe("PlatformMcpAuthService", () => {
278
284
  expect(anonymous.status).toBe(401);
279
285
  expect(anonymous.headers.get("www-authenticate")).toContain('scope="openid profile email"');
280
286
  // the supported scopes are only a hint: a token without them is still accepted
281
- await expect(service.verifyMcpRequest(auth, createContext({authorization: "Bearer valid"}))).resolves.toEqual(authInfo);
287
+ await expect(service.verifyMcpRequest(auth, createContext({authorization: "Bearer valid"}))).resolves.toEqual(verifiedAuthInfo);
282
288
  });
283
289
 
284
290
  it("advertises the required scopes rather than the supported ones", async () => {