feat: support protected resource metadata for mcp server #67
Annotations
6 errors
codecov
Process completed with exit code 1.
|
src/handlers/handle-bearer-auth.test.ts > handleBearerAuth() > should throw an error if issuer is not a valid URL:
packages/mcp-auth/src/handlers/handle-bearer-auth.test.ts#L49
Error: snapshot function didn't throw
❯ src/handlers/handle-bearer-auth.test.ts:49:7
|
src/index.test.ts > MCPAuth class (bearerAuth) > should throw an error if the verification mode is "jwt" but no JWKS url is provided:
packages/mcp-auth/src/index.test.ts#L72
Error: snapshot function didn't throw
❯ src/index.test.ts:72:42
|
src/index.test.ts > MCPAuth class (init) > should not throw an error if the server configuration is valid with warnings:
packages/mcp-auth/src/index.test.ts#L53
AssertionError: expected "warn" to be called with arguments: [ Array(1) ]
Received:
1st warn call:
[
- "The authorization server configuration has warnings:
-
- - Dynamic Client Registration (RFC 7591) is not supported by the server.
- ",
+ "The `server` config is deprecated. Please migrate to using only `protectedResource`.",
]
2nd warn call:
[
- "The authorization server configuration has warnings:
+ "The authorization server (issuer: `https://example.com`) configuration has warnings:
- Dynamic Client Registration (RFC 7591) is not supported by the server.
",
]
Number of calls: 2
❯ src/index.test.ts:53:28
|
src/index.test.ts > MCPAuth class (init) > should throw an error if the server configuration is empty or not an object:
packages/mcp-auth/src/index.test.ts#L8
Error: Snapshot `MCPAuth class (init) > should throw an error if the server configuration is empty or not an object 1` mismatched
Expected: "[MCPAuthAuthServerError: The server configuration does not match the MCP specification.]"
Received: "[TypeError: Cannot destructure property 'issuer' of 'authServer.metadata' as it is null.]"
❯ src/index.test.ts:8:63
|
src/index.integration.test.ts > MCPAuth class (bearerAuth) > should return 401 if the token is invalid:
packages/mcp-auth/src/index.integration.test.ts#L76
Error: expected 401 "Unauthorized", got 500 "Internal Server Error"
❯ src/index.integration.test.ts:76:86
❯ Test._assertStatus ../../node_modules/.pnpm/supertest@7.1.0/node_modules/supertest/lib/test.js:267:14
❯ ../../node_modules/.pnpm/supertest@7.1.0/node_modules/supertest/lib/test.js:323:13
❯ Test._assertFunction ../../node_modules/.pnpm/supertest@7.1.0/node_modules/supertest/lib/test.js:300:13
❯ Test.assert ../../node_modules/.pnpm/supertest@7.1.0/node_modules/supertest/lib/test.js:179:23
❯ Server.localAssert ../../node_modules/.pnpm/supertest@7.1.0/node_modules/supertest/lib/test.js:135:14
|