Repository navigation
server: accept multiple l1 auth secrets during rotation - #59
Merged
Merged
Conversation
bruce-y
marked this pull request as ready for review
October 20, 2026 16:18
Contributor
|
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.
L1 credential rotation currently forces clients and servers to switch a single shared secret together. Allow
BAZEL_REMOTE_L1_AUTH_SECRETto contain a comma-separated set of accepted keys so servers can acceptnew,oldwhile runner agents move to the new key.Parse, trim, and deduplicate accepted keys into a hash set when constructing the unary and streaming interceptors. Each request checks membership with a single map lookup. Requests still supply exactly one credential. A non-empty configuration with no usable keys rejects requests; the existing explicitly empty development configuration and exempt RPCs retain their behavior. Document the server-first rotation sequence and single-key client configuration.
Validation passed on Blacksmith Testbox:
go test -race ./server . -count=1. Coverage includes both RPC interceptor types, overlap, retired keys, empty entries, malformed request lists, and duplicate metadata. Repository-wide gofmt and diff checks pass.BenchmarkAuthSecretLookupmeasures hits and misses for 1, 2, 16, and 128 configured keys.Targets
patchset, which contains the Blacksmith L1 authentication code and is the source of release tags. No credentials, releases, or deployments are changed.On the same AMD EPYC Testbox, a successful lookup with two configured 64-byte keys measured a median of 7.44 ns/op versus 32.43 ns/op for the previous scan (three 200 ms samples per case). Both used 0 allocations/op. At 128 keys, the lookup measured 8.73 ns/op versus 1767 ns/op. These are lookup microbenchmarks, not end-to-end RPC latency.