Reach nested credentials, and lint workflow files - #35
Merged
Conversation
Workflow files are executable configuration, and YAML validity says nothing about whether they run. A duplicate env: key made CI parse to zero jobs last release; actionlint flags it. The target auto-installs on demand, matching how mk/security.mk handles govulncheck and gosec. The CI quality-gates job lists the gates individually rather than calling `make check`, so actionlint is wired in both places.
CredentialString does a single top-level lookup and asserts the value is a string, so a credential like protocols.amqp.uri was unreachable and a non-string leaf such as protocols.amqp.ssl returned false. Credential takes keys separately, so every key is addressable including one containing a dot, which brokers do emit (jdbc.url). CredentialPath adds the dotted form on top; it cannot address such a key, and the doc comment says so and points at Credential. CredentialString is left alone: making it path-aware would silently change behavior for callers whose key contains a dot. Also pins the issue #11 payload, whose nested object once panicked the decoder, as a regression test. Closes #23 Closes #11
This was referenced Jul 28, 2026
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.
Nested credential access (#23, #11)
CredentialStringdoes a single top-level lookup and asserts the value is astring, so a credential like
protocols.amqp.uriwas unreachable and anon-string leaf like
protocols.amqp.sslreturnedfalse.Service.Credential(keys ...string) (interface{}, bool)walks thecredentials one key at a time and returns the value with its own type —
string, bool, the
float64a JSON number decodes to, or a nested map orslice.
Service.CredentialPath("protocols.amqp.uri")is the dot-delimited form,built on
Credential.Keys are passed separately in the primitive because
VCAP_SERVICEScredentialsare broker-defined free-form JSON and a key may itself contain a dot —
jdbc.urlis a common one. The dotted form splits on every dot and so cannot address those;
the doc comment states the limitation and points at
Credential.CredentialStringis deliberately untouched: making it path-aware would silentlychange behavior for any existing caller whose key contains a dot.
Issue #11 needed no code — its payload decodes cleanly today, since
Credentialsis
map[string]interface{}. That payload is pinned as a regression test.API impact —
gorelease -base=v1.19.1:Purely additive; no existing signature or behavior altered.
actionlint
Workflow files are executable configuration, and YAML validity says nothing about
whether they run. Last release cycle a duplicate
env:key made CI parse to zerojobs.
make actionlintcatches that class, auto-installing on demand the waymk/security.mkdoes for govulncheck and gosec.It is wired into
make checkand listed as its own step in the CI quality-gatesjob — that job runs the gates individually rather than calling
make check, becausegolangci-lint comes from the action instead of
make lint.Verification
make checkclean,make test-racepassesCloses #23
Closes #11