Skip to content

Comments

Conformance testing: add auth conformance testing#806

Merged
tzolov merged 1 commit intomainfrom
dgarnier/auth-conformance
Feb 20, 2026
Merged

Conformance testing: add auth conformance testing#806
tzolov merged 1 commit intomainfrom
dgarnier/auth-conformance

Conversation

@Kehrlann
Copy link
Contributor

@Kehrlann Kehrlann commented Feb 20, 2026

Conformance testing for the auth suite.

Motivation and Context

See MCP Conformance repo.

How Has This Been Tested?

Self-testing.

Breaking Changes

n/a

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

@Kehrlann Kehrlann changed the title Conformance testing: add app to test auth suite Conformance testing: add auth conformance testing Feb 20, 2026
Comment on lines 65 to 103
name: Auth Conformance
runs-on: ubuntu-latest
strategy:
matrix:
scenario:
- auth/metadata-default
- auth/metadata-var1
- auth/metadata-var2
- auth/metadata-var3
- auth/basic-cimd
- auth/scope-from-www-authenticate
- auth/scope-from-scopes-supported
- auth/scope-omitted-when-undefined
- auth/scope-step-up
- auth/scope-retry-limit
- auth/token-endpoint-auth-basic
- auth/token-endpoint-auth-post
- auth/token-endpoint-auth-none
- auth/pre-registration
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'

- name: Build client
run: mvn clean install -DskipTests

- name: Run conformance test
uses: modelcontextprotocol/conformance@v0.1.15
with:
mode: client
command: 'java -jar conformance-tests/client-jdk-http-client/target/client-spring-http-client-1.0.0-SNAPSHOT.jar'
scenario: ${{ matrix.scenario }}
expected-failures: ./conformance-tests/conformance-baseline.yml

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI about 16 hours ago

To fix the problem, the workflow should explicitly declare restricted GITHUB_TOKEN permissions instead of inheriting the repository default. Since this workflow only checks out code, sets up Java, builds with Maven, and runs conformance tests, it only needs read access to repository contents (and possibly to packages if they are pulled, though none are explicitly shown).

The best minimal fix without changing functionality is to add a root-level permissions block right under the name: and on: keys so that it applies to all jobs that do not override it. A conservative and commonly recommended baseline is:

permissions:
  contents: read

This grants read-only access to repository contents, which is required by actions/checkout and is sufficient for the rest of the steps as written. No other scopes (issues, pull-requests, actions, etc.) are needed based on the shown YAML. Concretely, in .github/workflows/conformance.yml, add the permissions mapping after the on: block (or directly after name: if you prefer) and before jobs:. No imports or additional definitions are needed, since this is pure workflow configuration.

Suggested changeset 1
.github/workflows/conformance.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml
--- a/.github/workflows/conformance.yml
+++ b/.github/workflows/conformance.yml
@@ -6,6 +6,9 @@
     branches: [main]
   workflow_dispatch:
 
+permissions:
+  contents: read
+
 jobs:
   server:
     name: Server Conformance
EOF
@@ -6,6 +6,9 @@
branches: [main]
workflow_dispatch:

permissions:
contents: read

jobs:
server:
name: Server Conformance
Copilot is powered by AI and may make mistakes. Always verify output.
@Kehrlann Kehrlann force-pushed the dgarnier/auth-conformance branch 4 times, most recently from 3531b3a to b0e1423 Compare February 20, 2026 15:42
@Kehrlann Kehrlann marked this pull request as ready for review February 20, 2026 16:01
@Kehrlann Kehrlann force-pushed the dgarnier/auth-conformance branch from b0e1423 to 5c78eb9 Compare February 20, 2026 16:01
@Kehrlann Kehrlann requested review from chemicL and tzolov February 20, 2026 16:01
Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
@Kehrlann Kehrlann force-pushed the dgarnier/auth-conformance branch from 5c78eb9 to f58187d Compare February 20, 2026 16:17
Copy link
Contributor

@tzolov tzolov left a comment

Choose a reason for hiding this comment

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

Thanks @Kehrlann

@tzolov tzolov merged commit 5b99cd6 into main Feb 20, 2026
24 checks passed
@tzolov tzolov deleted the dgarnier/auth-conformance branch February 20, 2026 16:53
@chemicL
Copy link
Member

chemicL commented Feb 20, 2026

👏 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants