Repository navigation
docs(moduleauthority): state WorkloadTokenFile's scope exactly; correct AGENTS on what defaults - #43
Merged
Conversation
…S no longer says nothing defaults N1: WorkloadTokenFile's godoc, ProjectedTokenFile's godoc, the README and the CHANGELOG said the helper names the token "wherever Codefly runs it". A native run sets CODEFLY__WORKLOAD_TOKEN_FILE only for a service that declares module-identity and not workload-identity (codefly-dev/cli cmd/run/native_cluster.go, NativePeer.TokenOnly). A workload-identity service receives its path as TOKEN_FILE in its workload-identity configuration, so for it the helper falls back to the pod mount, a path that does not exist under a native run; it passes ProjectedTokenFile(path) with the configured path. The docs now say so. N2: AGENTS.md said moduleauthority "takes both seams from the consumer rather than defaulting either". The seams still default no address (a zero Authority is a mint-only client), but since WorkloadTokenFile the package does resolve one value, the projected token's path, from the injected variable with the cell's mount as fallback. AGENTS.md now says which value that is and that the consumer opts into it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
golangci-lint (errcheck) flagged the unchecked net.Conn Close in brokerParserTransport. CI runs go vet, not golangci-lint, so it was never reported there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Goal
WorkloadTokenFile()should state exactly which services it covers, and AGENTS.md should match whatmoduleauthorityresolves now that #41 has merged. These are the two review notes on #41.N1: the scope of
WorkloadTokenFile()What was wrong. The godoc,
ProjectedTokenFile's godoc, the README and the CHANGELOG all said the helper names the token "wherever Codefly runs it". A native run setsCODEFLY__WORKLOAD_TOKEN_FILEonly for a service that declaresmodule-identityand does not declareworkload-identity. In codefly-dev/cli,cmd/run/native_cluster.goruntimeOverridescheckspeer.TokenOnly, whichpkg/gitops/native_peers.gosets for exactly that case. Aworkload-identityservice receives its token's path asTOKEN_FILEin itsworkload-identityconfiguration (renderOwnedGroups). For that service the helper falls back to/var/run/secrets/codefly/token, which does not exist under a native run.What changed. The godoc of both
WorkloadTokenFileandProjectedTokenFile, the README paragraph and the CHANGELOG entry now state that scope. They also say what aworkload-identityservice does instead: it passesProjectedTokenFile(path)with the path from its configuration. This is documentation only; behaviour is unchanged.N2: AGENTS.md:48
What was wrong. AGENTS.md said
moduleauthority"takes both seams from the consumer rather than defaulting either". That is no longer the whole picture. The seams still default no address: a zeroAuthoritybuilds a mint-only client that fails withErrNoAuthority. But the package now resolves one value itself, the projected token's path.What changed. AGENTS.md now says which value that is:
WorkloadTokenFile()reads it from the injected variable and falls back to the cell's mount. It also says the consumer opts into it, and thatProjectedTokenFilehas no default.chore(scout)
golangci-lint (errcheck) flagged an unchecked
net.ConnClose inmoduleauthority/broker_transport_errors_test.go, and it is now checked. golangci-lint is not a gate in this repository; CI runs build, vet, test and race. Six findings remain in packages this PR does not touch:datasource/operations_test.go:798and:709(errcheck, staticcheck QF1003)datasource/parity_test.go:76,:198and:409internal/apiboundary/boundary_test.go:372I left them alone to keep this PR to the review notes.
Verified
go build ./...,go vet ./moduleauthority/andgo test ./moduleauthority/pass.golangci-lint run ./moduleauthority/(v2.14.0) reports 0 issues.mainat 9794ca9 (v0.1.189 plus one commit), read from source.Not verified
workload-identityservice fall back to the pod path. The claim comes from reading the CLI source.workload-identitygroup'sTOKEN_FILEreaches a process under, so the docs name the configuration key, not a variable.🤖 Generated with Claude Code