42 Commits

Author SHA1 Message Date
Xiang Li
6296054ff6 etcdhttp: version endpoint also returns cluster version. 2015-05-13 15:48:10 -07:00
Yicheng Qin
a6a649f1c3 etcdserver: stop exposing Cluster struct
After this PR, only cluster's interface Cluster is exposed, which makes
code much cleaner. And it avoids external packages to rely on cluster
struct in the future.
2015-05-13 10:01:25 -07:00
Xiang Li
6699107f61 *: add cluster version and cluster version detection.
Cluster version is the min major.minor of all members in
the etcd cluster. Cluster version is set to the min version
that a etcd member is compatible with when first bootstrapp.

During a rolling upgrades, the cluster version will be updated
automatically.

For example:

```
Cluster [a:1, b:1 ,c:1] -> clusterVersion 1

update a -> 2, b -> 2

after a detection

Cluster [a:2, b:2 ,c:1] -> clusterVersion 1, since c is still 1

update c -> 2

after a detection

Cluster [a:2, b:2 ,c:2] -> clusterVersion 2
```

The API/raft component can utilize clusterVersion to determine if
it can accept a client request or a raft RPC.

We choose polling rather than pushing since we want to use the same
logic for cluster version detection and (TODO) cluster version checking.

Before a member actually joins a etcd cluster, it should check the version
of the cluster. Push does not work since the other members cannot push
version info to it before it actually joins. Moreover, we do not want our
raft RPC system (which is doing the heartbeat pushing) to coordinate cluster version.
2015-04-29 11:31:59 -07:00
Xiang Li
5ad559b503 *: serve json version on both client and peer url 2015-04-20 16:23:51 -07:00
Yicheng Qin
60efd4d96e Revert "etcdhttp: add internalVersion"
This reverts commit a77bf97c147a93e5b78898b427d081ba11b8f118.

Conflicts:
	version/version.go
2015-03-27 16:53:55 -07:00
Barak Michener
001efa0639 security: Implement RBAC security for etcd
stub out security

further wip

Last stub before CRUD for roles

Complete role merging

start tests

add Godep for golang.org/x/crypto/bcrypt

first round of comments

add tests, remove root addition (will be added back as part of creation)

Add security checks for /v2/machines and /v2/keys

Allow non-root to determine if security is enabled, get machine list.

Responding to comments, remove multiple verbs (like /v2/security/user/foo/password)

add some prefixes to the logging
2015-03-16 16:23:11 -04:00
Barak Michener
92dca0af0f *: remove shadowing of variables from etcd and add travis test
We've been bitten by this enough times that I wrote a tool so that
it never happens again.
2015-02-17 16:31:42 -05:00
Jonathan Boulle
f1ed69e883 *: switch to line comments for copyright
Build tags are not compatible with block comments.
Also adds copyright header to a few places it was missing.
2015-01-26 09:53:30 -08:00
Xiang Li
a77bf97c14 etcdhttp: add internalVersion 2015-01-22 15:42:16 -08:00
Yicheng Qin
190fd446f9 pkg/types: add URLs tests 2015-01-15 10:24:23 -08:00
Xiang Li
1ebad5e42c etcdhttp: support member/leader endpoint 2015-01-06 08:52:33 -08:00
Yicheng Qin
05c921229e etcdserver: add id generator 2014-12-29 13:03:04 -08:00
Nikhil Sarda
a852936a59 etcdserver: removed an unhelpful test failure message
this commit changes instances of "blah" in a test to more
descriptive messages
2014-12-09 21:45:50 -08:00
Brian Waldon
9a728a127a dep: bump golang.org/x/net/context
Move from code.google.com/p/go.net/context to
golang.org/x/net/context before bumping to latest.
2014-11-20 10:19:12 -08:00
Xiang Li
d6f40acc86 etcdserver: add ID() function to the Server interface. 2014-11-13 11:37:06 -08:00
Xiang Li
5967794009 *: support updating advertise-peer-url
Users might want to update the peerurl of the etcd member in several cases.
For example, if the IP address of the physical machine etcd running on is
changed, user need to update the adversite-pee-rurl accordingly.
This commit makes etcd support updating the advertise-peer-url of its members.
2014-11-11 12:07:03 -08:00
Jonathan Boulle
ca1b30db10 etcdhttp: return 404 when removing nonexistent member 2014-11-06 16:59:40 -08:00
Xiang Li
3cb885c6b2 etcdhttp: return 409 instead of 412 when there is a conflict when adding a member 2014-11-06 11:07:25 -08:00
Jonathan Boulle
0f7add9722 etcdhttp: fix typo in test comment 2014-11-04 12:57:59 -08:00
Jonathan Boulle
cedcc0d8df etchttp: return 410 gone for permanently removed members 2014-11-04 11:21:24 -08:00
Yicheng Qin
ac49e1d50f Merge pull request #1594 from unihorn/201
etcdhttp/etcdserver: support HEAD on /v2/keys/ namespace
2014-11-04 00:11:47 -08:00
Yicheng Qin
866ec5948c etcdhttp/etcdserver: support HEAD on /v2/keys/ namespace 2014-11-04 00:06:49 -08:00
Yicheng Qin
2235b47030 Merge pull request #1545 from unihorn/197
etcdhttp: always respond json-format error to client
2014-11-03 23:25:14 -08:00
Yicheng Qin
9aefb91531 etcdhttp: always respond json-format error to client 2014-11-03 22:19:17 -08:00
Jonathan Boulle
ab69c2adbd etcdhttp: use EcodePrevValueRequired when appropriate 2014-11-03 16:12:50 -08:00
Jonathan Boulle
55c92ad456 *: create ID type
This creates a simple ID type (wrapped around uint64) to provide for
standard serialization/deserialization to a string (i.e. base 16
encoded). This replaces strutil so now that package is removed.
2014-10-31 10:34:07 -07:00
Jonathan Boulle
19881b2f15 etcdhttp: return 404 when removing nonexistent member 2014-10-30 09:57:54 -07:00
Brian Waldon
2c0f6e4bf9 etcdhttp: s/TestServeAdminMembers*/TestServeMembers*/ 2014-10-29 16:18:03 -07:00
Brian Waldon
f810dda9b2 Merge pull request #1481 from bcwaldon/no-more-admin-api
Remove "admin" from /v2/admin/members
2014-10-29 15:43:37 -07:00
Brian Waldon
ab67fa4cc6 api: remove admin prefix from members API 2014-10-29 12:12:51 -07:00
Brian Waldon
d3bafd6aa4 etcdhttp: encode MembersCollection properly 2014-10-29 12:06:22 -07:00
Brian Waldon
c07b9ae32e etcdhttp: 415 when content-type not JSON 2014-10-28 10:38:09 -07:00
Brian Waldon
d1fb732e63 etcdhttp: properly serialize Member on POST 2014-10-28 10:21:11 -07:00
Brian Waldon
8d052dd374 etcdhttp: copy Member URLs properly 2014-10-27 18:39:33 -07:00
Brian Waldon
2472953939 etcdhttp: hex-encode member ID 2014-10-27 17:25:22 -07:00
Xiang Li
6cb45236ac etcdhttp: make admin HTTP endpoint return json format error 2014-10-27 17:03:58 -07:00
Jonathan Boulle
e849d8e157 etcdhttp: DELETE on members = MethodNotAllowed 2014-10-27 16:49:04 -07:00
Jonathan Boulle
387639e802 etcdserver/etcdhttp: treat /v2/admin/members and /v2/admin/members/ equally 2014-10-27 16:49:03 -07:00
Brian Waldon
14795d8ed9 httptypes: use MemberCollection for JSON (de)serialization 2014-10-27 11:22:47 -07:00
Xiang Li
6f792354ca etcdhttp: attach clusterID to key and adminMember endpoint 2014-10-27 07:52:39 -07:00
Brian Waldon
b06499d0c2 etcdserver/etcdhttp: break apart HTTP handlers 2014-10-26 13:20:53 -07:00
Brian Waldon
435611cf0d etcdserver/etcdhttp: break apart http.go 2014-10-25 11:28:52 -07:00