feat: support protected resource metadata for mcp server #64
Annotations
7 errors
codecov
Process completed with exit code 1.
|
src/routers/create-delegated-router.test.ts > createDelegatedRouter() > should respond with snake_case metadata on GET /.well-known/oauth-authorization-server:
packages/mcp-auth/src/routers/create-delegated-router.test.ts#L33
SyntaxError: Unexpected end of JSON input
❯ EventEmitter._getJSONData ../../node_modules/.pnpm/node-mocks-http@1.16.2_@types+express@5.0.1_@types+node@20.17.30/node_modules/node-mocks-http/lib/mockResponse.js:830:21
❯ src/routers/create-delegated-router.test.ts:33:21
|
src/handlers/handle-bearer-auth.test.ts:
packages/mcp-auth/src/handlers/handle-bearer-auth.ts#L309
TypeError: `validateIssuer` must be a function that takes an issuer and throws an `MCPAuthBearerAuthError` if the issuer is not valid.
❯ handleBearerAuth src/handlers/handle-bearer-auth.ts:309:11
❯ src/handlers/handle-bearer-auth.test.ts:64:19
|
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:
+ "The authorization server (issuer: `https://example.com`) configuration has warnings:
- Dynamic Client Registration (RFC 7591) is not supported by the server.
",
]
Number of calls: 1
❯ 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 'server.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
|