Skip to content

mcpx: bind authz-stdio-use-environment (server) with an end-to-end env test (#1950) - #12869

Merged
dezren39 merged 1 commit into
mainfrom
lane-dt/1950-mcpx-authz
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane-dt/1950-mcpx-authz

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

What

Binds the last server-side authorization gap on #1950 — authz-stdio-use-environment — with the end-to-end test the gap text named as missing.

The spec row: "Implementations using an STDIO transport SHOULD NOT follow this specification, and instead retrieve credentials from the environment." mcpauth's env auth type performs that retrieval, but no test traced it into a stdio child.

The test

pool.TestStdioChildReceivesEnvCredential (in internal/pool/auth_test.go, next to the #240 HTTP companion TestAuthReachesTheUpstream):

  • Expansion subtest: the credential exists only in the daemon's environment; the server's env auth block expands ${VAR} from it; the pool carries the resolved value into the spawned stdio child; the child itself reports the value back through an echo call, under a variable name set nowhere but the auth block — so plain environment inheritance cannot produce it.
  • Unset subtest: an auth entry naming an unset variable fails the call before any child spawns, naming the variable.

Matrix move

coverage_authz.go binds the row instead of registering a gap; the override's why records the binding. Regenerated matrix: server side of the row is tested in all four revisions — per-revision server SHOULD NOT goes 3 tested / 1 gap → 4 tested / 0 gap. The client side keeps the #1950 gap per the recorded client-OAuth deferral (2026-10-30 decision on #1950), untouched.

Verification

  • go test ./internal/pool/ -count=1 — full package passes, including both new subtests.
  • go test ./internal/conformance/ -run 'TestMatrix|TestAuthSplit|TestCatalogue|TestCoverage' -count=1 — passes (split counts unchanged: the split already carried this side's permissive verdict).
  • go run ./internal/conformance/cmd/covering -n now selects TestStdioChildReceivesEnvCredential in the pool pattern.
  • go build ./..., gofmt, go vet clean.

#1950 stays open: its remaining scope is the client-side OAuth rows, deferred by the recorded decision.


Show it working
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…v test (#1950)

The last server-side authorization gap on #1950 was
authz-stdio-use-environment: the spec says stdio implementations
retrieve credentials from the environment instead of following the
OAuth flow, and mcpauth's `env` auth type does that retrieval, but
no test traced it into a stdio child end to end.

pool.TestStdioChildReceivesEnvCredential is that trace: the
credential exists only in the daemon's environment, the server's
`env` auth block expands ${VAR} from it, the pool carries the
resolved value into the spawned child, and the child itself reports
what it received under a name set nowhere but the auth block (so
plain environment inheritance cannot produce it). A second subtest
pins that an unset variable fails the call before any child spawns.

coverage_authz.go now binds the row to that test instead of
registering it as a gap; the override's why records the binding.
The regenerated matrix moves the server side of the row to "tested"
in all four revisions (server SHOULD NOT per revision: 3 tested /
1 gap -> 4 tested / 0 gap). The client side keeps the #1950 gap per
the recorded client-OAuth deferral.

Verified: go test ./internal/pool -count=1 (full package, incl. the
new test); go test ./internal/conformance -run
TestMatrix|TestAuthSplit|TestCatalogue|TestCoverage; the covering
tool now selects the new test in its pool pattern.
@dezren39
dezren39 requested a review from a team as a code owner November 23, 2026 04:07
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 22 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f4da2f94-b5f6-485f-b3e0-1c40106b28c6
Commits

Reviewing files that changed from the base of the PR and between bf322f9 and 2ba8209.

Files selected for processing: 4

  • pkgs/mcpx/docs/spec/conformance-matrix.md
  • pkgs/mcpx/internal/conformance/coverage_authz.go
  • pkgs/mcpx/internal/conformance/overrides/authorization.json
  • pkgs/mcpx/internal/pool/auth_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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.

1 participant