Skip to content

Commit f5504dc

Browse files
pcarletonclaude
andcommitted
[auth] Rename basic-dcr scenarios to metadata variants
Consolidate auth metadata discovery scenarios with consistent naming: - AuthBasicDCRScenario → AuthMetadataDefaultScenario (auth/metadata-default) - AuthBasicMetadataVar1Scenario → AuthMetadataVar1Scenario (auth/metadata-var1) - AuthBasicMetadataVar2Scenario → AuthMetadataVar2Scenario (auth/metadata-var2) - AuthBasicMetadataVar3Scenario → AuthMetadataVar3Scenario (auth/metadata-var3) Also updates descriptions to use consistent markdown formatting with bold headers for Registration, PRM, and OAuth metadata fields. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent de7060c commit f5504dc

3 files changed

Lines changed: 57 additions & 32 deletions

File tree

src/scenarios/client/auth/discovery-metadata.ts

Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/**
2+
* OAuth Metadata Discovery Scenarios
3+
*
4+
* These scenarios test different combinations of PRM and OAuth metadata locations:
5+
*
6+
* | Scenario | PRM Location | In WWW-Auth | OAuth Metadata Location |
7+
* |------------------|-------------------------------------------|-------------|------------------------------------------------|
8+
* | metadata-default | /.well-known/oauth-protected-resource/mcp | Yes | /.well-known/oauth-authorization-server |
9+
* | metadata-var1 | /.well-known/oauth-protected-resource/mcp | No | /.well-known/openid-configuration |
10+
* | metadata-var2 | /.well-known/oauth-protected-resource | No | /.well-known/oauth-authorization-server/tenant1|
11+
* | metadata-var3 | /custom/metadata/location.json | Yes | /tenant1/.well-known/openid-configuration |
12+
*/
13+
114
import type { Scenario, ConformanceCheck } from '../../../types.js';
215
import { ScenarioUrls } from '../../../types.js';
316
import { createAuthServer } from './helpers/createAuthServer.js';
@@ -6,10 +19,14 @@ import { ServerLifecycle } from './helpers/serverLifecycle.js';
619
import { SpecReferences } from './spec-references.js';
720
import { Request, Response } from 'express';
821

9-
export class AuthBasicDCRScenario implements Scenario {
10-
name = 'auth/basic-dcr';
11-
description =
12-
'Tests Basic OAuth flow with DCR, PRM at path-based location, OAuth metadata at root location, and no scopes required';
22+
export class AuthMetadataDefaultScenario implements Scenario {
23+
name = 'auth/metadata-default';
24+
description = `Tests Basic OAuth metadata discovery flow.
25+
26+
**Registration:** via DCR
27+
**PRM:** at path-based location (root returns 404)
28+
**OAuth metadata:** at root oauth-authorization-server path
29+
`;
1330
private authServer = new ServerLifecycle();
1431
private server = new ServerLifecycle();
1532
private checks: ConformanceCheck[] = [];
@@ -92,13 +109,13 @@ export class AuthBasicDCRScenario implements Scenario {
92109
}
93110
}
94111

95-
export class AuthBasicMetadataVar1Scenario implements Scenario {
96-
name = 'auth/basic-metadata-var1';
97-
description = `
98-
Tests Basic OAuth flow with:
99-
Registration: via DCR
100-
PRM: At the path-based location (not in WWW-authenticate)
101-
OAuth metadata: at OpenID discovery path
112+
export class AuthMetadataVar1Scenario implements Scenario {
113+
name = 'auth/metadata-var1';
114+
description = `Tests Basic OAuth metadata discovery flow.
115+
116+
**Registration:** via DCR
117+
**PRM:** at path-based location (not in WWW-Authenticate)
118+
**OAuth metadata:** at root openid-configuration path
102119
`;
103120
private authServer = new ServerLifecycle();
104121
private server = new ServerLifecycle();
@@ -118,7 +135,7 @@ OAuth metadata: at OpenID discovery path
118135
this.server.getUrl,
119136
this.authServer.getUrl,
120137
{
121-
prmPath: '/.well-known/oauth-protected-resource',
138+
// Uses default path-based PRM location
122139
includePrmInWwwAuth: false
123140
}
124141
);
@@ -156,10 +173,14 @@ OAuth metadata: at OpenID discovery path
156173
}
157174
}
158175

159-
export class AuthBasicMetadataVar2Scenario implements Scenario {
160-
name = 'auth/basic-metadata-var2';
161-
description =
162-
'Tests Basic OAuth flow with DCR, PRM at root location, OAuth metadata at path-based OAuth discovery path';
176+
export class AuthMetadataVar2Scenario implements Scenario {
177+
name = 'auth/metadata-var2';
178+
description = `Tests Basic OAuth metadata discovery flow.
179+
180+
**Registration:** via DCR
181+
**PRM:** at root location (not in WWW-Authenticate)
182+
**OAuth metadata:** at path-based oauth-authorization-server path (/tenant1)
183+
`;
163184
private authServer = new ServerLifecycle();
164185
private server = new ServerLifecycle();
165186
private checks: ConformanceCheck[] = [];
@@ -168,8 +189,7 @@ export class AuthBasicMetadataVar2Scenario implements Scenario {
168189
this.checks = [];
169190

170191
const authApp = createAuthServer(this.checks, this.authServer.getUrl, {
171-
metadataPath: '/tenant1/.well-known/openid-configuration',
172-
isOpenIdConfiguration: true,
192+
metadataPath: '/.well-known/oauth-authorization-server/tenant1',
173193
routePrefix: '/tenant1'
174194
});
175195

@@ -199,7 +219,8 @@ export class AuthBasicMetadataVar2Scenario implements Scenario {
199219
this.server.getUrl,
200220
() => `${this.authServer.getUrl()}/tenant1`,
201221
{
202-
prmPath: '/.well-known/oauth-protected-resource'
222+
prmPath: '/.well-known/oauth-protected-resource',
223+
includePrmInWwwAuth: false
203224
}
204225
);
205226
await this.server.start(app);
@@ -236,10 +257,14 @@ export class AuthBasicMetadataVar2Scenario implements Scenario {
236257
}
237258
}
238259

239-
export class AuthBasicMetadataVar3Scenario implements Scenario {
240-
name = 'auth/basic-metadata-var3';
241-
description =
242-
'Tests Basic OAuth flow with DCR, PRM at custom location listed in WWW-Authenticate header, OAuth metadata is at nested OpenID discovery path, and no scopes required';
260+
export class AuthMetadataVar3Scenario implements Scenario {
261+
name = 'auth/metadata-var3';
262+
description = `Tests Basic OAuth metadata discovery flow.
263+
264+
**Registration:** via DCR
265+
**PRM:** at custom path (via resource_metadata in WWW-Authenticate)
266+
**OAuth metadata:** at path-based openid-configuration path (/tenant1)
267+
`;
243268
private authServer = new ServerLifecycle();
244269
private server = new ServerLifecycle();
245270
private checks: ConformanceCheck[] = [];

src/scenarios/client/auth/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe('Client Auth Scenarios', () => {
4242
describe('Negative tests', () => {
4343
test('bad client requests root PRM location', async () => {
4444
const runner = new InlineClientRunner(badPrmClient);
45-
await runClientAgainstScenario(runner, 'auth/basic-dcr', [
45+
await runClientAgainstScenario(runner, 'auth/metadata-default', [
4646
'prm-priority-order'
4747
]);
4848
});

src/scenarios/client/auth/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Scenario } from '../../../types';
2-
import { AuthBasicDCRScenario } from './basic-dcr.js';
32
import {
4-
AuthBasicMetadataVar1Scenario,
5-
AuthBasicMetadataVar2Scenario,
6-
AuthBasicMetadataVar3Scenario
3+
AuthMetadataDefaultScenario,
4+
AuthMetadataVar1Scenario,
5+
AuthMetadataVar2Scenario,
6+
AuthMetadataVar3Scenario
77
} from './discovery-metadata.js';
88
import {
99
Auth20250326OAuthMetadataBackcompatScenario,
@@ -17,10 +17,10 @@ import {
1717
} from './scope-handling.js';
1818

1919
export const authScenariosList: Scenario[] = [
20-
new AuthBasicDCRScenario(),
21-
new AuthBasicMetadataVar1Scenario(),
22-
new AuthBasicMetadataVar2Scenario(),
23-
new AuthBasicMetadataVar3Scenario(),
20+
new AuthMetadataDefaultScenario(),
21+
new AuthMetadataVar1Scenario(),
22+
new AuthMetadataVar2Scenario(),
23+
new AuthMetadataVar3Scenario(),
2424
new Auth20250326OAuthMetadataBackcompatScenario(),
2525
new Auth20250326OEndpointFallbackScenario(),
2626
new ScopeFromWwwAuthenticateScenario(),

0 commit comments

Comments
 (0)