Skip to content

Commit 5c60c77

Browse files
committed
shrink diff
1 parent 6a01d0d commit 5c60c77

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

src/server/auth/middleware/bearerAuth.test.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,28 +54,6 @@ describe("requireBearerAuth middleware", () => {
5454
expect(mockResponse.json).not.toHaveBeenCalled();
5555
});
5656

57-
it("should use default negotiated protocol version when mcp-protocol-version header is missing", async () => {
58-
const validAuthInfo: AuthInfo = {
59-
token: "valid-token",
60-
clientId: "client-123",
61-
scopes: ["read", "write"],
62-
};
63-
mockVerifyAccessToken.mockResolvedValue(validAuthInfo);
64-
65-
mockRequest.headers = {
66-
authorization: "Bearer valid-token",
67-
};
68-
69-
const middleware = requireBearerAuth({ verifier: mockVerifier });
70-
await middleware(mockRequest as Request, mockResponse as Response, nextFunction);
71-
72-
expect(mockVerifyAccessToken).toHaveBeenCalledWith("valid-token", DEFAULT_NEGOTIATED_PROTOCOL_VERSION);
73-
expect(mockRequest.auth).toEqual(validAuthInfo);
74-
expect(nextFunction).toHaveBeenCalled();
75-
expect(mockResponse.status).not.toHaveBeenCalled();
76-
expect(mockResponse.json).not.toHaveBeenCalled();
77-
});
78-
7957
it("should reject expired tokens", async () => {
8058
const expiredAuthInfo: AuthInfo = {
8159
token: "expired-token",

src/server/auth/middleware/bearerAuth.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { RequestHandler } from "express";
22
import { InsufficientScopeError, InvalidTokenError, OAuthError, ServerError } from "../errors.js";
33
import { OAuthTokenVerifier } from "../provider.js";
44
import { AuthInfo } from "../types.js";
5-
import { DEFAULT_NEGOTIATED_PROTOCOL_VERSION } from "../../../types.js";
65

76
export type BearerAuthMiddlewareOptions = {
87
/**

0 commit comments

Comments
 (0)