clientv3: get AuthToken automatically when clientConn is ready.#12264
clientv3: get AuthToken automatically when clientConn is ready.#12264xiang90 merged 1 commit intoetcd-io:masterfrom cfc4n:gettoken_retry_interceptor
Conversation
mitake
left a comment
There was a problem hiding this comment.
LGTM other than the logging part, thanks! The failed test seems to be non deterministic.
| } | ||
| creds = c.authTokenBundle.PerRPCCredentials() | ||
| } | ||
| if creds != nil { |
There was a problem hiding this comment.
I think logging metadata wouldn't be good, it can expose a credential in client side logs, right?
There was a problem hiding this comment.
Thanks, But I think that no other credential info in client side logs in
etcd/clientv3/credentials/credentials.go
Lines 110 to 115 in 76e769c
authToken only, there is not other keyword. Logging metadata for debug .
There was a problem hiding this comment.
yeah, but if the token can be leaked and malicious person can get it, it can result security issue. I think it shouldn't be logged. How do you think?
There was a problem hiding this comment.
emmm, you are right.
I fixed it at 0649f91 .
but CI was failed at https://travis-ci.com/github/etcd-io/etcd/jobs/385106741#L2064 .
=== RUN TestBalancerUnderNetworkPartitionWatchLeader
TestBalancerUnderNetworkPartitionWatchLeader: network_partition_test.go:266: took too long to detect leader lost
--- FAIL: TestBalancerUnderNetworkPartitionWatchLeader (3.35s)
But ,I test passed on my macbook like this:
$ PASSES=integration TESTCASE=TestBalancerUnderNetworkPartitionWatchLeader ./test [015eab45e]
Running with TEST_CPUS: 1,2,4
Starting 'integration' pass at 2020年 9月16日 星期三 12时26分27秒 CST
Running integration tests...
testing: warning: no tests to run
PASS
ok go.etcd.io/etcd/v3/integration 0.017s [no tests to run]
testing: warning: no tests to run
PASS
ok go.etcd.io/etcd/v3/client/integration 0.026s [no tests to run]
=== RUN TestBalancerUnderNetworkPartitionWatchLeader
--- PASS: TestBalancerUnderNetworkPartitionWatchLeader (1.65s)
=== RUN TestBalancerUnderNetworkPartitionWatchLeader
--- PASS: TestBalancerUnderNetworkPartitionWatchLeader (1.40s)
=== RUN TestBalancerUnderNetworkPartitionWatchLeader
--- PASS: TestBalancerUnderNetworkPartitionWatchLeader (1.23s)
PASS
ok go.etcd.io/etcd/v3/clientv3/integration 4.306s
testing: warning: no tests to run
PASS
ok go.etcd.io/etcd/v3/contrib/raftexample 0.013s [no tests to run]
Finished 'integration' pass at 2020年 9月16日 星期三 12时26分45秒 CST
Success
…upstream-release-3.4 Automated cherry pick of #12264
…upstream-release-3.3 Automated cherry pick of #12264
Old etcdserver which have not apply pr of etcd-io#12165 will check auth token even if the request is a Authenticate request. If the client has a invalid auth token, it will not able to update it's token, since the Authenticate has a invalid auth token. This fix clear the auth token when encounter an ErrInvalidAuthToken to talk with old version etcd servers. Fix etcd-io#12385 with etcd-io#12165 and etcd-io#12264
Old etcdserver which have not apply pr of etcd-io#12165 will check auth token even if the request is a Authenticate request. If the client has a invalid auth token, it will not able to update it's token, since the Authenticate has a invalid auth token. This fix clear the auth token when encounter an ErrInvalidAuthToken to talk with old version etcd servers. Fix etcd-io#12385 with etcd-io#12165 and etcd-io#12264
Old etcdserver which have not apply pr of etcd-io#12165 will check auth token even if the request is an Authenticate request. If the client has a invalid auth token, it will not able to update it's token, since the Authenticate has a invalid auth token. This fix clear the auth token when encounter an ErrInvalidAuthToken to talk with old version etcd servers. Fix etcd-io#12385 with etcd-io#12165 and etcd-io#12264
Old etcdserver which have not apply pr of etcd-io#12165 will check auth token even if the request is an Authenticate request. If the client has a invalid auth token, it will not able to update it's token, since the Authenticate has a invalid auth token. This fix clear the auth token when encounter an ErrInvalidAuthToken to talk with old version etcd servers. Fix etcd-io#12385 with etcd-io#12165 and etcd-io#12264
Old etcdserver which have not apply pr of etcd-io#12165 will check auth token even if the request is an Authenticate request. If the client has a invalid auth token, it will not able to update it's token, since the Authenticate has a invalid auth token. This fix clear the auth token when encounter an ErrInvalidAuthToken to talk with old version etcd servers. Fix etcd-io#12385 with etcd-io#12165 and etcd-io#12264
clientv3: get AuthToken automatically when clientConn is ready.
fixes: #11954