Repository navigation
feat: Gateway.InstallationID exposes the installation the gateway stamped - #74
Merged
antoinetoussaint-byte merged 1 commit intoOct 21, 2026
Conversation
…mped (#73) Gateway exposed OrgID() but nothing for the installation beside it, so a handler that needed the installation it serves re-parsed x-codefly-installation-id itself or took an id from the browser. The runtime already reads and validates that header into gw.installationID through viewerInstallation; the accessor returns that accepted value and nothing else, so a blank header the runtime refuses is never handed back. Closes #73 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
antoinetoussaint-byte
deleted the
issue-73-gateway-exposes-orgid-but-not-the-installation-the
branch
October 25, 2026 17:04
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.
Closes #73.
What
func (g *Gateway) InstallationID() string, besideOrgID(). It returnsgw.installationID, the valuegatewayForalready reads from the gateway-stampedx-codefly-installation-idthroughviewerInstallation. That is the same value everyForModulemint names. A handler that needs the installation it serves no longer re-parses the header or takes an id from the page.viewerInstallationrefuses an absent or blank header (installationErr) and returns""when it does, so a refused value is never handed back. A padded value comes back trimmed, as the runtime accepted it.gatewayFor(nil)). That step already receives itsInstallation. The install path is unchanged.x-codefly-work-context. A test pins that.Classification
Fix, made at the owner. The runtime already holds the validated value, and this exposes it. There is no new parsing, no new environment read and no new header handling. The change is additive, so there is no
!.Reuse
Reused:
viewerInstallationand thegatewayForfield it fills. Deliberately not added: any shape validation of the installation id. The runtime refuses only blank values today, and the format belongs to the host.Docs
README.md(theGateway.OrgIDparagraph in the module-read section) andCHANGELOG.mddescribe the accessor.Tests
TestGatewayExposesTheStampedInstallation(solution_test.go):installationErrset and the accessor empty. This case goes throughgatewayFordirectly, because the HTTP server trims a blank value before a handler sees it.go mod verify,go build ./...,go vet ./...,gofmt -l .andgo test -race ./... -count=1all pass locally.Overlap
#70 touches only
README.md/go.mod/go.sum, so it does not conflict. #57 is a stale draft against asolution.gothat has since lost the code it edits (solutionCredential,authorizeMintbesidenewGateway). It does not touch theOrgIDarea, and this PR does not build on it.Not verified
The suite is hermetic. Nothing here was run against a real host gateway, so this does not show that a deployed auth gateway stamps
x-codefly-installation-idon solution routes (installationConfinementHeader). It also does not show thatInstallationService.GetInstallationaccepts the value for a handler's use case from #73.🤖 Generated with Claude Code