chore: switch to module ESNext + moduleResolution bundler (#2095)
This commit is contained in:
parent
c59dc3aa1a
commit
ee732d64b6
11 changed files with 668 additions and 863 deletions
|
|
@ -1,11 +1,11 @@
|
|||
import { authorizationHandler, AuthorizationHandlerOptions, redirectUriMatches } from '../../../src/auth/handlers/authorize.js';
|
||||
import { OAuthServerProvider, AuthorizationParams } from '../../../src/auth/provider.js';
|
||||
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients.js';
|
||||
import { authorizationHandler, AuthorizationHandlerOptions, redirectUriMatches } from '../../../src/auth/handlers/authorize';
|
||||
import { OAuthServerProvider, AuthorizationParams } from '../../../src/auth/provider';
|
||||
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients';
|
||||
import { OAuthClientInformationFull, OAuthTokens } from '@modelcontextprotocol/core';
|
||||
import express, { Response } from 'express';
|
||||
import supertest from 'supertest';
|
||||
import { AuthInfo } from '../../../src/auth/types.js';
|
||||
import { InvalidTokenError } from '../../../src/auth/errors.js';
|
||||
import { AuthInfo } from '../../../src/auth/types';
|
||||
import { InvalidTokenError } from '../../../src/auth/errors';
|
||||
|
||||
describe('Authorization Handler', () => {
|
||||
// Mock client data
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { metadataHandler } from '../../../src/auth/handlers/metadata.js';
|
||||
import { metadataHandler } from '../../../src/auth/handlers/metadata';
|
||||
import { OAuthMetadata } from '@modelcontextprotocol/core';
|
||||
import express from 'express';
|
||||
import supertest from 'supertest';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { clientRegistrationHandler, ClientRegistrationHandlerOptions } from '../../../src/auth/handlers/register.js';
|
||||
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients.js';
|
||||
import { clientRegistrationHandler, ClientRegistrationHandlerOptions } from '../../../src/auth/handlers/register';
|
||||
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients';
|
||||
import { OAuthClientInformationFull, OAuthClientMetadata } from '@modelcontextprotocol/core';
|
||||
import express from 'express';
|
||||
import supertest from 'supertest';
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { revocationHandler, RevocationHandlerOptions } from '../../../src/auth/handlers/revoke.js';
|
||||
import { OAuthServerProvider, AuthorizationParams } from '../../../src/auth/provider.js';
|
||||
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients.js';
|
||||
import { revocationHandler, RevocationHandlerOptions } from '../../../src/auth/handlers/revoke';
|
||||
import { OAuthServerProvider, AuthorizationParams } from '../../../src/auth/provider';
|
||||
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients';
|
||||
import { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from '@modelcontextprotocol/core';
|
||||
import express, { Response } from 'express';
|
||||
import supertest from 'supertest';
|
||||
import { AuthInfo } from '../../../src/auth/types.js';
|
||||
import { InvalidTokenError } from '../../../src/auth/errors.js';
|
||||
import { AuthInfo } from '../../../src/auth/types';
|
||||
import { InvalidTokenError } from '../../../src/auth/errors';
|
||||
import { MockInstance } from 'vitest';
|
||||
|
||||
describe('Revocation Handler', () => {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { tokenHandler, TokenHandlerOptions } from '../../../src/auth/handlers/token.js';
|
||||
import { OAuthServerProvider, AuthorizationParams } from '../../../src/auth/provider.js';
|
||||
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients.js';
|
||||
import { tokenHandler, TokenHandlerOptions } from '../../../src/auth/handlers/token';
|
||||
import { OAuthServerProvider, AuthorizationParams } from '../../../src/auth/provider';
|
||||
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients';
|
||||
import { OAuthClientInformationFull, OAuthTokenRevocationRequest, OAuthTokens } from '@modelcontextprotocol/core';
|
||||
import express, { Response } from 'express';
|
||||
import supertest from 'supertest';
|
||||
import * as pkceChallenge from 'pkce-challenge';
|
||||
import { InvalidGrantError, InvalidTokenError } from '../../../src/auth/errors.js';
|
||||
import { AuthInfo } from '../../../src/auth/types.js';
|
||||
import { ProxyOAuthServerProvider } from '../../../src/auth/providers/proxyProvider.js';
|
||||
import { InvalidGrantError, InvalidTokenError } from '../../../src/auth/errors';
|
||||
import { AuthInfo } from '../../../src/auth/types';
|
||||
import { ProxyOAuthServerProvider } from '../../../src/auth/providers/proxyProvider';
|
||||
import { type Mock } from 'vitest';
|
||||
|
||||
// Mock pkce-challenge
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { allowedMethods } from '../../../src/auth/middleware/allowedMethods.js';
|
||||
import { allowedMethods } from '../../../src/auth/middleware/allowedMethods';
|
||||
import express, { Request, Response } from 'express';
|
||||
import request from 'supertest';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { Request, Response } from 'express';
|
||||
import { Mock } from 'vitest';
|
||||
import { requireBearerAuth } from '../../../src/auth/middleware/bearerAuth.js';
|
||||
import { AuthInfo } from '../../../src/auth/types.js';
|
||||
import { InsufficientScopeError, InvalidTokenError, CustomOAuthError, ServerError } from '../../../src/auth/errors.js';
|
||||
import { OAuthTokenVerifier } from '../../../src/auth/provider.js';
|
||||
import { createExpressResponseMock } from '../../helpers/http.js';
|
||||
import { requireBearerAuth } from '../../../src/auth/middleware/bearerAuth';
|
||||
import { AuthInfo } from '../../../src/auth/types';
|
||||
import { InsufficientScopeError, InvalidTokenError, CustomOAuthError, ServerError } from '../../../src/auth/errors';
|
||||
import { OAuthTokenVerifier } from '../../../src/auth/provider';
|
||||
import { createExpressResponseMock } from '../../helpers/http';
|
||||
|
||||
// Mock verifier
|
||||
const mockVerifyAccessToken = vi.fn();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { authenticateClient, ClientAuthenticationMiddlewareOptions } from '../../../src/auth/middleware/clientAuth.js';
|
||||
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients.js';
|
||||
import { authenticateClient, ClientAuthenticationMiddlewareOptions } from '../../../src/auth/middleware/clientAuth';
|
||||
import { OAuthRegisteredClientsStore } from '../../../src/auth/clients';
|
||||
import { OAuthClientInformationFull } from '@modelcontextprotocol/core';
|
||||
import express from 'express';
|
||||
import supertest from 'supertest';
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { Response } from 'express';
|
||||
import { ProxyOAuthServerProvider, ProxyOptions } from '../../../src/auth/providers/proxyProvider.js';
|
||||
import { AuthInfo } from '../../../src/auth/types.js';
|
||||
import { ProxyOAuthServerProvider, ProxyOptions } from '../../../src/auth/providers/proxyProvider';
|
||||
import { AuthInfo } from '../../../src/auth/types';
|
||||
import { OAuthClientInformationFull, OAuthTokens } from '@modelcontextprotocol/core';
|
||||
import { ServerError } from '../../../src/auth/errors.js';
|
||||
import { InvalidTokenError } from '../../../src/auth/errors.js';
|
||||
import { InsufficientScopeError } from '../../../src/auth/errors.js';
|
||||
import { ServerError } from '../../../src/auth/errors';
|
||||
import { InvalidTokenError } from '../../../src/auth/errors';
|
||||
import { InsufficientScopeError } from '../../../src/auth/errors';
|
||||
import { type Mock } from 'vitest';
|
||||
|
||||
describe('Proxy OAuth Server Provider', () => {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { mcpAuthRouter, AuthRouterOptions, mcpAuthMetadataRouter, AuthMetadataOptions } from '../../src/auth/router.js';
|
||||
import { OAuthServerProvider, AuthorizationParams } from '../../src/auth/provider.js';
|
||||
import { OAuthRegisteredClientsStore } from '../../src/auth/clients.js';
|
||||
import { mcpAuthRouter, AuthRouterOptions, mcpAuthMetadataRouter, AuthMetadataOptions } from '../../src/auth/router';
|
||||
import { OAuthServerProvider, AuthorizationParams } from '../../src/auth/provider';
|
||||
import { OAuthRegisteredClientsStore } from '../../src/auth/clients';
|
||||
import { OAuthClientInformationFull, OAuthMetadata, OAuthTokenRevocationRequest, OAuthTokens } from '@modelcontextprotocol/core';
|
||||
import express, { Response } from 'express';
|
||||
import supertest from 'supertest';
|
||||
import { AuthInfo } from '../../src/auth/types.js';
|
||||
import { InvalidTokenError } from '../../src/auth/errors.js';
|
||||
import { AuthInfo } from '../../src/auth/types';
|
||||
import { InvalidTokenError } from '../../src/auth/errors';
|
||||
|
||||
describe('MCP Auth Router', () => {
|
||||
// Setup mock provider with full capabilities
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import http from 'node:http';
|
||||
import { type Mocked } from 'vitest';
|
||||
|
||||
import { SSEServerTransport } from '../../src/sse/sse.js';
|
||||
import { SSEServerTransport } from '../../src/sse/sse';
|
||||
import type { JSONRPCMessage } from '@modelcontextprotocol/core';
|
||||
|
||||
const createMockResponse = () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue