feat: exempt platform-auth secret headers from the Lambda x-ms-* strip (Milestone G)#126
Merged
Merged
Conversation
3606f19 to
3c91776
Compare
3c91776 to
319d40a
Compare
Milestone G groundwork. A production module runs as a Lambda invoked via the HTTP-shaped LambdaRequest envelope; NewLambdaHandler strips all x-ms-* before the router, which dropped X-MS-Internal-Secret / X-MS-Platform-Token too, so a Lambda-invoked module's internalAuth/RequireProxy 401'd every internal/MCP call. Strip only spoofable identity CLAIMS (user/app/role — identity rides typed fields); exempt the two platform-auth SECRET headers. Bumps 0.2.5 -> 0.2.6. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
319d40a to
3974acb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Milestone G SDK groundwork. In production a module runs as a Lambda function invoked via the HTTP-shaped
LambdaRequestenvelope. This closes the one kernel gap on that receive path so a deployed module's internal/MCP auth works.The fix
NewLambdaHandlerstrips allx-ms-*headers before running the module router — to neutralize spoofable identity headers. But that also droppedX-MS-Internal-Secret/X-MS-Platform-Token, so a Lambda-invoked module'sInternalAuth/RequireProxymiddleware never saw the secret and 401'd every internal/MCP call.Now the strip keeps the deny-by-default stance for identity claims (
X-MS-User-ID,X-MS-App-ID,X-MS-App-Role— trusted identity rides the typedLambdaRequestfields) but exempts the two platform-auth secret headers. Safe: the platform builds a fresh header set per invoke, so nothing client-supplied reaches here.Version
0.2.5 → 0.2.6(add thereleaselabel on merge to publish).Tests
TestNewLambdaHandler_AuthSecretHeadersSurvive(secrets reach the router, claims stripped) +TestMsAuthSecretHeadersMatchConstants(structural pin against constant drift).TestNewLambdaHandler_StripXMSHeadersstill passes.go build ./internal/runtime/...+go test ./internal/runtime/green.🤖 Generated with Claude Code