Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions src/testing/token-validation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,17 @@ describeIfListen('Token Validation Integration', () => {
clientInfo: { name: 'test', version: '1.0.0' },
},
})
.expect(401);
.expect(200);

// Validation should have been called
expect(validationCallCount).toBe(1);
expect(lastValidationToken).toBe('invalid-token-xyz');

// Should not create session
expect(response.headers['mcp-session-id']).toBeUndefined();
expect(response.body.error).toBe('Unauthorized');
expect(response.body.message).toContain('Invalid or expired');
// JSON-RPC error response (HTTP 200 to avoid triggering OAuth flow in clients)
expect(response.body.error).toBeDefined();
expect(response.body.error.message).toContain('invalid or expired');
});

it('should reject expired token', async () => {
Expand All @@ -289,10 +290,12 @@ describeIfListen('Token Validation Integration', () => {
clientInfo: { name: 'test', version: '1.0.0' },
},
})
.expect(401);
.expect(200);

expect(validationCallCount).toBe(1);
expect(response.body.error).toBe('Unauthorized');
// JSON-RPC error response (HTTP 200 to avoid triggering OAuth flow in clients)
expect(response.body.error).toBeDefined();
expect(response.body.error.message).toContain('invalid or expired');
});
});

Expand Down Expand Up @@ -355,9 +358,11 @@ describeIfListen('Token Validation Integration', () => {
clientInfo: { name: 'test', version: '1.0.0' },
},
})
.expect(401);
.expect(200);

expect(response.body.error).toBe('Unauthorized');
// JSON-RPC error response (HTTP 200 to avoid triggering OAuth flow in clients)
expect(response.body.error).toBeDefined();
expect(response.body.error.message).toContain('invalid or expired');
});
});

Expand Down
Loading