Repository navigation
Send the auth token to Cluster.MemberList - #127
Merged
Merged
Conversation
The interceptor skipped the token for MemberList, but etcd 3.6 and later require it when authentication is enabled and fail the request with "etcdserver: user name is empty". Observed on 3.6.15 and 3.7.2, while 3.5.26 accepts the call without a token. The server accepts the token on the RPCs which do not require it, so only Authenticate, which is how the token is obtained, is left without one. Add unit tests for which RPCs get the token, and cover member_list with auth enabled in the integration tests, including the token refresh. Co-Authored-By: Claude Sonnet 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.
Summary
The interceptor skipped the auth token for
Cluster.MemberList. etcd 3.6 and later require it when authentication is enabled, somember_list()failed withetcdserver: user name is empty. OnlyAuth.Authenticate, which is how a token is obtained, is left without a token now. The server accepts the token on RPCs that do not require it.match (method.service(), method.method()) { - ("etcdserverpb.Auth", "Authenticate") | ("etcdserverpb.Cluster", "MemberList") => {} + ("etcdserverpb.Auth", "Authenticate") => {} (service, _) if service.starts_with("etcdserverpb") || .. => self.append_token(..), _ => {} }Evidence
Before:
member_list()with auth enabled, observed against Docker images:etcdserver: user name is emptyetcdserver: user name is emptytest_authandtest_auth_refresh_tokenfail on 3.6.15 and 3.7.2.After:
test_auth*pass on 3.5.26, 3.6.15 and 3.7.2 (ETCD_AUTH_TOKEN_TTL=2, as in CI). Two new unit tests inintercept.rscheck which RPCs get the token.cargo clippy --all-targets -D warningspasses.Merge Danger
Door: two-way
Blast Radius:
Cluster.MemberListon etcd with auth enabled3.5 does not check the token on
MemberList, so an expired token is not detected there and does not trigger a refresh. This is harmless forMemberList. 3.6.15 is the earliest 3.6.x I tested, so the exact 3.6 patch release that started requiring it is unknown. The full integration suite was not run on 3.6 / 3.7, onlytest_auth*.🤖 Generated with Claude Code