feat: add PKCE conformance tests #119
Merged
+303
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds conformance tests for PKCE requirements from the MCP authorization spec (fixes #77).
Changes
New PKCE Checks (added to all auth scenarios via
createAuthServer)pkce-code-challenge-sentcode_challengein authorization requestpkce-s256-method-usedcode_challenge_method=S256pkce-code-verifier-sentcode_verifierin token requestpkce-verifier-matches-challengeBASE64URL(SHA256(code_verifier)) === code_challengeNew Scenario (skipped for now)
auth/pkce-no-s256-support- Tests that clients refuse when S256 is not incode_challenge_methods_supportedNew Bad Client Example
auth-test-no-pkce.ts- A client that skips PKCE entirely (for negative testing)Testing
All existing auth scenarios now include PKCE validation. The bad client example correctly fails all PKCE checks: