10789 Commits

Author SHA1 Message Date
Hitoshi Mitake
f8a290e7ca *: support jwt token in v3 auth API
This commit adds jwt token support in v3 auth API.

Remaining major ToDos:
- Currently token type isn't hidden from etcdserver. In the near
  future the information should be completely invisible from
  etcdserver package.
- Configurable expiration of token. Currently tokens can be valid
  until keys are changed.

How to use:
1. generate keys for signing and verfying jwt tokens:
 $ openssl genrsa -out app.rsa 1024
 $ openssl rsa -in app.rsa -pubout > app.rsa.pub
2.  add command line options to etcd like below:
--auth-token-type jwt \
--auth-jwt-pub-key app.rsa.pub --auth-jwt-priv-key app.rsa \
--auth-jwt-sign-method RS512
3. launch etcd cluster

Below is a performance comparison of serializable read w/ and w/o jwt
token. Every (3) etcd node is executed on a single machine. Signing
method is RS512 and key length is 1024 bit. As the results show, jwt
based token introduces a performance overhead but it would be
acceptable for a case that requires authentication.

w/o jwt token auth (no auth):

Summary:
  Total:        1.6172 secs.
  Slowest:      0.0125 secs.
  Fastest:      0.0001 secs.
  Average:      0.0002 secs.
  Stddev:       0.0004 secs.
  Requests/sec: 6183.5877

Response time histogram:
  0.000 [1]     |
  0.001 [9982]  |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  0.003 [1]     |
  0.004 [1]     |
  0.005 [0]     |
  0.006 [0]     |
  0.008 [6]     |
  0.009 [0]     |
  0.010 [1]     |
  0.011 [5]     |
  0.013 [3]     |

Latency distribution:
  10% in 0.0001 secs.
  25% in 0.0001 secs.
  50% in 0.0001 secs.
  75% in 0.0001 secs.
  90% in 0.0002 secs.
  95% in 0.0002 secs.
  99% in 0.0003 secs.

w/ jwt token auth:

Summary:
  Total:        2.5364 secs.
  Slowest:      0.0182 secs.
  Fastest:      0.0002 secs.
  Average:      0.0003 secs.
  Stddev:       0.0005 secs.
  Requests/sec: 3942.5185

Response time histogram:
  0.000 [1]     |
  0.002 [9975]  |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  0.004 [0]     |
  0.006 [1]     |
  0.007 [11]    |
  0.009 [2]     |
  0.011 [4]     |
  0.013 [5]     |
  0.015 [0]     |
  0.016 [0]     |
  0.018 [1]     |

Latency distribution:
  10% in 0.0002 secs.
  25% in 0.0002 secs.
  50% in 0.0002 secs.
  75% in 0.0002 secs.
  90% in 0.0003 secs.
  95% in 0.0003 secs.
  99% in 0.0004 secs.
2017-03-06 19:46:03 -08:00
Hitoshi Mitake
a7a93f54a4 vendor: import jwt-go for auth v3 2017-03-06 19:46:03 -08:00
Gyu-Ho Lee
e5d94a296f Merge pull request #7347 from gyuho/static-check
*: add 'staticcheck' to 'test'
2017-03-06 16:20:25 -08:00
Gyu-Ho Lee
3d75395875 *: remove never-unused vars, minor lint fix
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-03-06 14:59:12 -08:00
Gyu-Ho Lee
bd6e6c11f8 test: run 'staticcheck'
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-03-06 14:59:12 -08:00
Anthony Romano
79de3be6a7 Merge pull request #7430 from heyitsanthony/lock-more-deps
vendor: lock down some soft dependencies
2017-03-06 14:54:45 -08:00
Anthony Romano
db560574dd Merge pull request #7416 from heyitsanthony/test-eschew-you
test: eschew you
2017-03-06 13:30:57 -08:00
Anthony Romano
317f3571ff Merge pull request #7420 from heyitsanthony/dial-timeout-report
clientv3: pass back dial error on dial timeout
2017-03-06 12:58:18 -08:00
Anthony Romano
3f187a103b vendor: lock down some soft dependencies
Locks down:
* go-rundewidth (via tablewriter)
* golang.org/x/sys
* prometheus/{common,procfs} (via prometheus-client)
2017-03-06 12:03:45 -08:00
Anthony Romano
c8a2c7f64f *: eschew you from documentation
Removed line wrapping in affected files as well.
2017-03-06 11:40:46 -08:00
Anthony Romano
270dc9427b clientv3: pass back dial error on dial timeout
Fixes #7419
2017-03-06 09:33:10 -08:00
Anthony Romano
4e1ce81e17 test: eschew you
Per https://github.com/coreos/docs/blob/master/STYLE.md#eschew-you
2017-03-06 09:16:03 -08:00
Xiang Li
4e2fe050f5 Merge pull request #7425 from mitake/gosimple
contrib: suppress gosimple errors of raftexample
2017-03-06 09:09:49 -08:00
Hitoshi Mitake
b6eedbacf9 contrib: suppress gosimple errors of raftexample
Travis claimed errors of gosimple like below
(https://travis-ci.org/coreos/etcd/jobs/208098545):
gosimple checking failed:
contrib/raftexample/raftexample_test.go:78:6: should write erri := <-clus.errorC[i] instead of erri, _ := <-clus.errorC[i]
contrib/raftexample/raftexample_test.go:114:10: should write err := <-eC instead of err, _ := <-eC

This commit fixes the errors.
2017-03-06 16:17:22 +09:00
Xiang Li
5039c7b4ab Merge pull request #7417 from purpleidea/feat/key-exists
clientv3: Add KeyExists and KeyNotExists Cmp helpers
2017-03-05 17:50:34 -08:00
Xiang Li
8a57b90e7f Merge pull request #7422 from tmjd/docs_fix_migrate_example
etcdctl: Fix migrate example in README.md
2017-03-04 18:17:01 -08:00
Erik Stidham
9ba658f59b etcdctl: Fix migrate example in README.md 2017-03-04 19:42:27 -06:00
Gyu-Ho Lee
b68416f735 Merge pull request #7394 from gyuho/fix-advertise-client-url-host
*: use machine default host only for default value, 0.0.0.0
2017-03-03 16:35:31 -08:00
James Shubin
71937151d0 clientv3: Add KeyExists and KeyNotExists Cmp helpers
This is quite useful for transactions.
2017-03-03 18:45:10 -05:00
Gyu-Ho Lee
4aa68e0231 etcdmain: log machine default host after update check
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-03-03 14:25:39 -08:00
Gyu-Ho Lee
b7ee8f4967 embed: use machine default host only for default value, 0.0.0.0
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-03-03 14:25:34 -08:00
Gyu-Ho Lee
2831b9dcfd Merge pull request #7415 from gyuho/etcd-tester-lease-check-with-ttl
etcd-tester: check expired lease with -1 TTL
2017-03-03 12:49:58 -08:00
Gyu-Ho Lee
fb81fb44fa etcd-tester: check expired lease with -1 TTL
Following the change at 2ca1823a96

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-03-03 11:41:53 -08:00
Brandon Philips
e16db3347a Merge pull request #7413 from philips/update-etcd-integrations-and-users
production-users: add Kubernetes
2017-03-03 14:12:39 -05:00
Brandon Philips
e52f41a6d1 production-users: add Kubernetes 2017-03-03 13:09:36 -05:00
Brandon Philips
bd6f1c9e48 libraries-and-tools: rename to integrations
I want to create a more consistent naming system across the repos. Some
of our projects won't have libraries or tools (like Clair) but others
have integrated their software with Clair in various ways.

So, use a generic term: integrations.
2017-03-03 13:09:36 -05:00
Anthony Romano
85c22f4562 Merge pull request #7408 from heyitsanthony/v3-capable
api: default to V3 capability
2017-03-02 16:53:01 -08:00
Anthony Romano
42c98123b3 Merge pull request #7411 from heyitsanthony/mirror-batch
etcdctl: correctly batch revisions in make-mirror
2017-03-02 16:09:50 -08:00
Anthony Romano
ad45958841 etcdctl: correctly batch revisions in make-mirror
Fixes #7410
2017-03-02 14:30:24 -08:00
Anthony Romano
1753623f87 integration: don't set v3 capability since now default 2017-03-02 14:02:09 -08:00
Anthony Romano
5da5b834e5 api: default to V3 capability
Fixes #7154
2017-03-02 14:02:09 -08:00
Anthony Romano
9cc013fec0 Merge pull request #7409 from heyitsanthony/doc-ionice
Documentation: suggest ionice for disk tuning
2017-03-02 14:00:05 -08:00
Anthony Romano
1e252f1feb Documentation: suggest ionice for disk tuning
Also cleaned up tuning.md newlines to conform with style.
2017-03-02 13:58:07 -08:00
Anthony Romano
763aef87b9 Merge pull request #7405 from heyitsanthony/fast-gosimple
test: run unused and gosimple over all packages at once
2017-03-02 10:40:26 -08:00
Gyu-Ho Lee
6092e1ad24 Merge pull request #7403 from gyuho/do
Documentation/op-guide: use exact certs dir for Container Linux
2017-03-02 10:33:42 -08:00
Gyu-Ho Lee
ae0c4b4c87 Documentation/op-guide: use exact certs dir for Container Linux
Use the one that works in Container Linux

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-03-02 10:20:59 -08:00
Anthony Romano
3296c15a32 test: run unused and gosimple over all packages at once
fmt pass went from ~20 CPU minutes to ~1 CPU minute.

Fixes #7377
2017-03-02 10:17:46 -08:00
fanmin shi
5cdb557560 Merge pull request #7390 from fanminshi/put_ctl_warning
etcdctl: show warning if ETCDCTL_API is not set
2017-03-02 10:17:19 -08:00
Anthony Romano
db91277216 Merge pull request #7400 from heyitsanthony/fix-example-ctx
clientv3: bump example requestTimeout for slow CI
2017-03-01 21:57:34 -08:00
Anthony Romano
2eb8243d94 Merge pull request #7402 from heyitsanthony/fix-watchconnerr
grpcproxy: return closing error when stream is canceled from conn close
2017-03-01 21:56:36 -08:00
Xiang Li
134d1cb4e0 Merge pull request #7404 from xiang90/nt
raft: make TestNodeTick reliable
2017-03-01 20:02:25 -08:00
Xiang
931cf3454a raft: make TestNodeTick reliable
TestNodeTick relies on a unreliable func `waitForSchedule` when running
with GOMAXPROCS > 1. This commit changes the test to make sure we stop
the node afte it drains the tick chan. The test should be reliable now.
2017-03-01 17:35:58 -08:00
Gyu-Ho Lee
010cc287bb Merge pull request #7401 from gyuho/docker-guide
op-guide: add notes on mounting certs directory
2017-03-01 16:50:24 -08:00
Anthony Romano
28e9ba365a grpcproxy: return closing error when stream is canceled from conn close
Fixes #6630
2017-03-01 16:46:13 -08:00
Gyu-Ho Lee
d111c8fe3b op-guide: add notes on mounting certs directory
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-03-01 16:45:03 -08:00
Anthony Romano
cf547aa403 clientv3: bump example requestTimeout for slow CI
Fixes #7398
2017-03-01 14:37:40 -08:00
fanmin shi
f76ca01aed etcdctl: show warning if ETCDCTL_API is not set in v2 --help
FIXES #7385
2017-03-01 11:29:59 -08:00
fanmin shi
d3aebbf0ce Merge pull request #7387 from fanminshi/rework_coverage_ctl
e2e: rework coverage ctl
2017-03-01 10:01:13 -08:00
fanmin shi
edd298f85a test: build test binary for etcdctl 2017-02-28 17:08:24 -08:00
fanmin shi
1f413cff64 e2e: add etcdctl to e2e test 2017-02-28 17:08:17 -08:00