9150 Commits

Author SHA1 Message Date
Gyu-Ho Lee
4ff6c72257 raft: replace 'reflect.DeepEqual' with bytes.Equal 2016-07-22 16:34:13 -07:00
Xiang Li
ec5c5d9ddf Merge pull request #6021 from xiang90/gateway_test
e2e: add gateway test
2016-07-21 16:48:04 -07:00
Xiang Li
c603b5e6a1 e2e: add gateway test 2016-07-21 16:19:54 -07:00
Anthony Romano
2bf55e3a15 Merge pull request #6016 from endocode/kayrus/fix_serve_err_return
embed: Fixed serve() err return
2016-07-21 11:17:08 -07:00
kayrus
fee9e2b183 embed: Fixed serve() err return 2016-07-21 18:06:08 +02:00
Gyu-Ho Lee
de638a5e4d Merge pull request #5991 from gyuho/manual
v2http: client certificate auth via common name
2016-07-21 08:02:17 -07:00
Xiang Li
214c1e55b0 Merge pull request #5999 from jlamillan/master
Add support for formating output of ls command in json or extended fo…
2016-07-21 07:09:52 -07:00
Anthony Romano
32553c5796 Merge pull request #6006 from dongsupark/dongsu/fix-build-error-go-systemd
etcdmain: correctly check return values from SdNotify()
2016-07-21 07:08:58 -07:00
Dongsu Park
624187d25f etcdmain: correctly check return values from SdNotify()
SdNotify() now returns 2 values, sent and err. So startEtcdOrProxyV2()
needs to check the 2 return values correctly. As the 2 values are
independent of each other, error checking needs to be slightly updated
too.

SdNotifyNoSocket, which was previously provided by go-systemd, does not
exist any more. In that case (false, nil) will be returned instead.
2016-07-21 09:19:07 +02:00
Dongsu Park
00c9fe4753 vendor: update go-systemd
Godeps.json and vendor need to be updated according to the newest
go-systemd, as SdNotify() in go-systemd has changed its API.
2016-07-21 08:20:52 +02:00
jesse.millan
f18d5433cc etcdctl: Add support for formating output of ls command in json
The ls command will check for and honor json or extended output formats.

Fixes #5993
2016-07-20 18:05:23 -07:00
Gyu-Ho Lee
42db8f55b2 e2e: test auth enabled with CN name cert 2016-07-20 16:55:45 -07:00
Anthony Romano
e001848270 Merge pull request #5772 from heyitsanthony/integration-proxy
integration: build tag for proxy
2016-07-20 16:28:12 -07:00
Gyu-Ho Lee
5066981cc7 v2http: test with 'ClientCertAuthEnabled' 2016-07-20 16:24:33 -07:00
Gyu-Ho Lee
25aeeb35c3 v2http: set 'ClientCertAuthEnabled' in client.go 2016-07-20 16:24:15 -07:00
Gyu-Ho Lee
68ece954fb v2http: add 'ClientCertAuthEnabled' in handlers 2016-07-20 16:23:41 -07:00
Gyu-Ho Lee
be001c44e8 embed: set 'ClientCertAuthEnabled' 2016-07-20 16:23:24 -07:00
Gyu-Ho Lee
9510bd6036 etcdserver: add 'ClientCertAuthEnabled' option 2016-07-20 16:22:59 -07:00
Gyu-Ho Lee
0f0d32b073 v2http: move 'testdata' from 'etcdhttp' 2016-07-20 16:20:42 -07:00
rob boll
ff5709bb41 v2http: client cert cn authentication
introduce client certificate authentication using certificate cn.
2016-07-20 16:20:13 -07:00
rob boll
ab17165352 v2http: refactor http basic auth
refactor http basic auth code to combine basic auth extraction and validation
2016-07-20 16:20:05 -07:00
Anthony Romano
768ccb8c10 grpcproxy: respect prev_kv flag 2016-07-20 15:58:33 -07:00
Anthony Romano
becbd9f3d6 test: grpcproxy integration test pass
Run via
PASSES=grpcproxy ./test
2016-07-20 15:58:33 -07:00
Anthony Romano
7b3d502b96 integration: build tag cluster_proxy for testing backed by proxy 2016-07-20 15:40:33 -07:00
Anthony Romano
17e0164f57 clientv3: add KV constructor using pb.KVClient 2016-07-20 15:40:33 -07:00
Anthony Romano
54df540c2c grpcproxy: wrapper from pb.KVServer to pb.KVClient 2016-07-20 15:40:33 -07:00
Anthony Romano
15aa64eb3c Merge pull request #6009 from heyitsanthony/fix-progress-notify
v3rpc: don't elide next progress notification on progress notification
2016-07-20 13:46:11 -07:00
Anthony Romano
65d7e7963a Merge pull request #6011 from heyitsanthony/fix-migrate-test
e2e: use a single member cluster in TestCtlV3Migrate
2016-07-20 13:27:17 -07:00
Anthony Romano
8c8742f43c integration: change timeouts for TestWatchWithProgressNotify
a) 2 * progress interval was passing with dropped notifies
b) waitResponse was waiting so long that it expected a dropped notify
2016-07-20 13:23:44 -07:00
Anthony Romano
a289bf58e6 e2e: use a single member cluster in TestCtlV3Migrate
Occasionally migrate would fail because a minority node would be missing
v2 keys. Instead, just use a single member cluster.

Fixes #5992
2016-07-20 12:10:09 -07:00
Anthony Romano
299ebc6137 v3rpc: don't elide next progress notification on progress notification
Fixes #5878
2016-07-20 11:37:20 -07:00
Anthony Romano
a7b098b26d Merge pull request #6007 from heyitsanthony/fix-watch-test
integration: fix race in TestV3WatchMultipleEventsTxnSynced
2016-07-20 10:34:54 -07:00
Anthony Romano
82ddeb38b4 integration: fix race in TestV3WatchMultipleEventsTxnSynced
Writes between watcher creation request and reply were being dropped.

Fixes #5789
2016-07-20 09:55:39 -07:00
Xiang Li
aba478fb8a Merge pull request #5793 from mitake/auth-revision
auth, etcdserver: introduce revision of authStore for avoiding TOCTOU problem
2016-07-20 09:32:54 -07:00
Anthony Romano
edcfcae332 Merge pull request #5995 from heyitsanthony/clientv3-retry-stopped
rpctypes, clientv3: retry RPC on EtcdStopped
2016-07-20 08:54:14 -07:00
Hitoshi Mitake
ef6b74411c auth, etcdserver: introduce revision of authStore for avoiding TOCTOU problem
This commit introduces revision of authStore. The revision number
represents a version of authStore that is incremented by updating auth
related information.

The revision is required for avoiding TOCTOU problems. Currently there
are two types of the TOCTOU problems in v3 auth.

The first one is in ordinal linearizable requests with a sequence like
below ():
1. Request from client CA is processed in follower FA. FA looks up the
   username (let it U) for the request from a token of the request. At
   this time, the request is authorized correctly.
2. Another request from client CB is processed in follower FB. CB
   is for changing U's password.
3. FB forwards the request from CB to the leader before FA. Now U's
   password is updated and the request from CA should be rejected.
4. However, the request from CA is processed by the leader because
   authentication is already done in FA.

For avoiding the above sequence, this commit lets
etcdserverpb.RequestHeader have a member revision. The member is
initialized during authentication by followers and checked in a
leader. If the revision in RequestHeader is lower than the leader's
authStore revision, it means a sequence like above happened. In such a
case, the state machine returns auth.ErrAuthRevisionObsolete. The
error code lets nodes retry their requests.

The second one, a case of serializable range and txn, is more
subtle. Because these requests are processed in follower directly. The
TOCTOU problem can be caused by a sequence like below:
1. Serializable request from client CA is processed in follower FA. At
   first, FA looks up the username (let it U) and its permission
   before actual access to KV.
2. Another request from client CB is processed in follower FB and
   forwarded to the leader. The cluster including FA now commits a log
   entry of the request from CB. Assume the request changed the
   permission or password of U.
3. Now the serializable request from CA is accessing to KV. Even if
   the access is allowed at the point of 1, now it can be invalid
   because of the change introduced in 2.

For avoiding the above sequence, this commit lets the functions of
serializable requests (EtcdServer.Range() and EtcdServer.Txn())
compare the revision in the request header with the latest revision of
authStore after the actual access. If the saved revision is lower than
the latest one, it means the permission can be changed. Although it
would introduce false positives (e.g. changing other user's password),
it prevents the TOCTOU problem. This idea is an implementation of
Anthony's comment:
https://github.com/coreos/etcd/pull/5739#issuecomment-228128254
2016-07-20 14:39:04 +09:00
Anthony Romano
8abae076d1 rpctypes, clientv3: retry RPC on EtcdStopped
Fixes #5983
2016-07-19 18:29:12 -07:00
Anthony Romano
6e290abee2 Merge pull request #5998 from heyitsanthony/tls-timeout-conn
transport: wrap timeout listener with tls listener
2016-07-19 17:42:05 -07:00
Anthony Romano
99e0655c2f transport: wrap timeout listener with tls listener
Otherwise the listener will return timeoutConn's, causing a type
assertion to tls.Conn in net.http to fail so http.Request.TLS is never set.
2016-07-19 16:47:14 -07:00
Xiang Li
80c2e4098d Merge pull request #5997 from xiang90/l_r
raft: fix readindex
2016-07-19 15:25:53 -07:00
Xiang Li
1c5754f02d raft: fix readindex 2016-07-19 15:00:58 -07:00
Xiang Li
e5f0cdcc69 Merge pull request #5984 from xiang90/p_b
grpcproxy: do not send duplicate events to watchers
2016-07-19 12:47:23 -07:00
Xiang Li
783675f91c grpcproxy: do not send duplicate events to watchers 2016-07-19 10:14:57 -07:00
Xiang Li
d3d954d659 Merge pull request #5990 from xiang90/wcr
clientv3/integration: fix race in TestWatchCompactRevision
2016-07-19 10:08:28 -07:00
Xiang Li
e177d9eda2 clientv3/integration: fix race in TestWatchCompactRevision 2016-07-19 09:31:44 -07:00
Xiang Li
1bf78476cf Merge pull request #5980 from xiang90/gateway
etcdmian: gateway supports dns srv discovery
2016-07-18 22:10:54 -07:00
Xiang Li
c7c5cd324b etcdmian: gateway supports dns srv discovery 2016-07-18 21:53:24 -07:00
Anthony Romano
fcc96c9ebd Merge pull request #5976 from heyitsanthony/fix-kadc
integration: drain keepalives in TestLeaseKeepAliveCloseAfterDisconnectRevoke
2016-07-18 20:21:44 -07:00
Anthony Romano
d914502090 Merge pull request #5978 from heyitsanthony/fix-compactor
compactor: make event ordering well-defined in TestPeriodicPause
2016-07-18 20:06:57 -07:00
Anthony Romano
27a30768e1 integration: drain keepalives in TestLeaseKeepAliveCloseAfterDisconnectRevoke
Fixes #5900
2016-07-18 19:45:59 -07:00