feat: add resource parameter validation tests (RFC 8707) #118
+264
−6
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.
Overview
Adds conformance tests for OAuth Resource Indicators (RFC 8707) implementation per issue #33.
Changes
1. Resource parameter checks added to
token-endpoint-auth-basicscenarioThe following checks are now run as part of the existing token endpoint auth scenarios:
resource-parameter-in-authorization: Verifies resource parameter is present in authorization requestresource-parameter-in-token: Verifies resource parameter is present in token requestresource-parameter-valid-uri: Verifies resource is a valid canonical URI (has scheme, no fragment per RFC 8707)resource-parameter-consistency: Verifies same resource is used in both authorization and token requests2. New
auth/resource-mismatchscenarioTests that client correctly rejects when Protected Resource Metadata returns a
resourcefield that doesn't match the server URL being accessed.resource: "https://evil.example.com/mcp"(different origin)3. Helper updates
resourceparameter toonAuthorizationRequestcallback increateAuthServerprmResourceOverrideoption tocreateServerfor testing resource mismatch scenarios4. Spec references
Added references for:
Testing
All existing tests pass. New scenarios tested against TypeScript SDK's everything-client.
Closes #33