feat: add pre-registration conformance test (#120)

* feat: add pre-registration conformance test

Add conformance test for OAuth pre-registration flow where the server
does NOT support Dynamic Client Registration (DCR) and clients must
use pre-configured static credentials.

This addresses issue #34 (Client Registration Methods) - specifically
the pre-registration section that was previously not covered.

Changes:
- Add disableDynamicRegistration option to createAuthServer helper
- Add auth/pre-registration scenario with pre-registered client creds
- Add MCP_PREREGISTRATION spec reference
- Add context schema for pre-registration credentials
- Add withOAuthRetryWithProvider helper for pre-configured providers
- Add negative test client (auth-test-attempts-dcr.ts) that ignores
  pre-registered credentials and fails

The scenario verifies that when a server does not advertise
registration_endpoint in its OAuth metadata, compliant clients
use pre-registered credentials passed via context instead of
attempting DCR.

Closes #34

* fix: add redirect_uris to saveClientInformation call

* chore: remove unused WithOAuthRetryOptions interface
This commit is contained in:
Paul Carleton 2026-01-23 11:43:56 +00:00 • committed by GitHub
commit 245e44e882
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,6 +21,7 @@ import {
ClientCredentialsJwtScenario,
ClientCredentialsBasicScenario
} from './client-credentials';
import { PreRegistrationScenario } from './pre-registration';
// Auth scenarios (required for tier 1)
export const authScenariosList: Scenario[] = [
@ -35,7 +36,8 @@ export const authScenariosList: Scenario[] = [
new ScopeRetryLimitScenario(),
new ClientSecretBasicAuthScenario(),
new ClientSecretPostAuthScenario(),
new PublicClientAuthScenario()
new PublicClientAuthScenario(),
new PreRegistrationScenario()
];
// Extension scenarios (optional for tier 1 - protocol extensions)