chore: switch to module ESNext + moduleResolution bundler (#2095)
This commit is contained in:
parent
c59dc3aa1a
commit
ee732d64b6
7 changed files with 668 additions and 863 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { OAuthError, OAuthErrorCode } from '@modelcontextprotocol/server';
|
||||
import type { RequestHandler } from 'express';
|
||||
|
||||
import type { OAuthTokenVerifier } from './types.js';
|
||||
import type { OAuthTokenVerifier } from './types';
|
||||
|
||||
/**
|
||||
* Options for {@link requireBearerAuth}.
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* @module
|
||||
*/
|
||||
|
||||
import { createMcpExpressApp } from './express.js';
|
||||
import { createMcpExpressApp } from './express';
|
||||
|
||||
/**
|
||||
* Example: Basic usage with default DNS rebinding protection.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { Express } from 'express';
|
||||
import express from 'express';
|
||||
|
||||
import { hostHeaderValidation, localhostHostValidation } from './middleware/hostHeaderValidation.js';
|
||||
import { hostHeaderValidation, localhostHostValidation } from './middleware/hostHeaderValidation';
|
||||
|
||||
/**
|
||||
* Options for creating an MCP Express application.
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
export * from './express.js';
|
||||
export * from './middleware/hostHeaderValidation.js';
|
||||
export * from './express';
|
||||
export * from './middleware/hostHeaderValidation';
|
||||
|
||||
// OAuth Resource-Server glue: bearer-token middleware + PRM/AS metadata router.
|
||||
export type { BearerAuthMiddlewareOptions } from './auth/bearerAuth.js';
|
||||
export { requireBearerAuth } from './auth/bearerAuth.js';
|
||||
export type { AuthMetadataOptions } from './auth/metadataRouter.js';
|
||||
export { getOAuthProtectedResourceMetadataUrl, mcpAuthMetadataRouter } from './auth/metadataRouter.js';
|
||||
export type { OAuthTokenVerifier } from './auth/types.js';
|
||||
export type { BearerAuthMiddlewareOptions } from './auth/bearerAuth';
|
||||
export { requireBearerAuth } from './auth/bearerAuth';
|
||||
export type { AuthMetadataOptions } from './auth/metadataRouter';
|
||||
export { getOAuthProtectedResourceMetadataUrl, mcpAuthMetadataRouter } from './auth/metadataRouter';
|
||||
export type { OAuthTokenVerifier } from './auth/types';
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
import type { Express } from 'express';
|
||||
|
||||
import { hostHeaderValidation, localhostHostValidation } from './hostHeaderValidation.js';
|
||||
import { hostHeaderValidation, localhostHostValidation } from './hostHeaderValidation';
|
||||
|
||||
/**
|
||||
* Example: Using hostHeaderValidation middleware with custom allowed hosts.
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ import supertest from 'supertest';
|
|||
import type { Mock } from 'vitest';
|
||||
import { vi } from 'vitest';
|
||||
|
||||
import type { OAuthTokenVerifier } from '../../src/auth/types.js';
|
||||
import { requireBearerAuth } from '../../src/auth/bearerAuth.js';
|
||||
import { getOAuthProtectedResourceMetadataUrl, mcpAuthMetadataRouter } from '../../src/auth/metadataRouter.js';
|
||||
import type { OAuthTokenVerifier } from '../../src/auth/types';
|
||||
import { requireBearerAuth } from '../../src/auth/bearerAuth';
|
||||
import { getOAuthProtectedResourceMetadataUrl, mcpAuthMetadataRouter } from '../../src/auth/metadataRouter';
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// requireBearerAuth
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import type { NextFunction, Request, Response } from 'express';
|
||||
import { vi } from 'vitest';
|
||||
|
||||
import { createMcpExpressApp } from '../src/express.js';
|
||||
import { hostHeaderValidation, localhostHostValidation } from '../src/middleware/hostHeaderValidation.js';
|
||||
import { createMcpExpressApp } from '../src/express';
|
||||
import { hostHeaderValidation, localhostHostValidation } from '../src/middleware/hostHeaderValidation';
|
||||
|
||||
// Helper to create mock Express request/response/next
|
||||
function createMockReqResNext(host?: string) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue