Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ export class ConformanceOAuthProvider implements OAuthClientProvider {
throw new Error('No auth code in redirect URL');
}
} else {
throw new Error('No redirect location received');
throw new Error(
`No redirect location received, from '${authorizationUrl.toString()}'`
);
}
} catch (error) {
console.error('Failed to fetch authorization URL:', error);
Expand Down
1 change: 0 additions & 1 deletion examples/clients/typescript/helpers/withOAuthRetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const handle401 = async (
serverUrl: string | URL
): Promise<void> => {
const resourceMetadataUrl = extractResourceMetadataUrl(response);

let result = await auth(provider, {
serverUrl,
resourceMetadataUrl,
Expand Down
113 changes: 107 additions & 6 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dist"
],
"bin": {
"conformance": "dist/index.mjs"
"conformance": "dist/index.js"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tsdown 0.15 creates index.js, 0.16 creates index.mjs, so since we're pinning to 0.15 for now (which seems to also be what pkg.pr.new uses), this needs to be .js

},
"devDependencies": {
"@eslint/js": "^9.8.0",
Expand All @@ -43,7 +43,7 @@
"vitest": "^4.0.5"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.20.1",
"@modelcontextprotocol/sdk": "^1.22.0",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is to pick up the fix that makes these tests pass

"commander": "^14.0.2",
"express": "^5.1.0",
"lefthook": "^2.0.2",
Expand Down
28 changes: 0 additions & 28 deletions src/scenarios/client/auth/basic-dcr.test.ts

This file was deleted.

25 changes: 11 additions & 14 deletions src/scenarios/client/auth/basic-dcr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,26 @@ import { createAuthServer } from './helpers/createAuthServer.js';
import { createServer } from './helpers/createServer.js';
import { ServerLifecycle } from './helpers/serverLifecycle.js';
import { Request, Response } from 'express';
import { SpecReferences } from './spec-references.js';

export class AuthBasicDCRScenario implements Scenario {
name = 'auth/basic-dcr';
description =
'Tests Basic OAuth flow with DCR, PRM at path-based location, OAuth metadata at root location, and no scopes required';
private authServer = new ServerLifecycle(() => this.authBaseUrl);
private server = new ServerLifecycle(() => this.baseUrl);
private authServer = new ServerLifecycle();
private server = new ServerLifecycle();
private checks: ConformanceCheck[] = [];
private baseUrl: string = '';
private authBaseUrl: string = '';

async start(): Promise<ScenarioUrls> {
this.checks = [];

const authApp = createAuthServer(this.checks, () => this.authBaseUrl);
this.authBaseUrl = await this.authServer.start(authApp);
const authApp = createAuthServer(this.checks, this.authServer.getUrl);
await this.authServer.start(authApp);

const app = createServer(
this.checks,
() => this.baseUrl,
() => this.authBaseUrl
this.server.getUrl,
this.authServer.getUrl
);

// For this scenario, reject PRM requests at root location since we have the path-based PRM.
Expand All @@ -39,10 +38,8 @@ export class AuthBasicDCRScenario implements Scenario {
status: 'FAILURE',
timestamp: new Date().toISOString(),
specReferences: [
{
id: 'mcp-authorization-prm',
url: 'https://modelcontextprotocol.io/specification/draft/basic/authorization#protected-resource-metadata-discovery-requirements'
}
SpecReferences.RFC_PRM_DISCOVERY,
SpecReferences.MCP_PRM_DISCOVERY
],
details: {
url: req.url,
Expand All @@ -58,9 +55,9 @@ export class AuthBasicDCRScenario implements Scenario {
}
);

this.baseUrl = await this.server.start(app);
await this.server.start(app);

return { serverUrl: `${this.baseUrl}/mcp` };
return { serverUrl: `${this.server.getUrl()}/mcp` };
}

async stop() {
Expand Down
16 changes: 0 additions & 16 deletions src/scenarios/client/auth/basic-metadata-var1.test.ts

This file was deleted.

Loading
Loading