123 Commits

Author SHA1 Message Date
Xiang Li
c39aad0e92 etcdserver: use correct http status code for auth error 2015-06-22 09:28:47 -07:00
Barak Michener
64ec8af91b *: Rename security to auth 2015-06-15 18:18:50 -04:00
Brian Akins
d8a836e618 Simple debug HTTP request logging 2015-06-09 13:40:37 -04:00
Xiang Li
0adeee2965 etcdhttp: use leveled logging 2015-06-09 09:26:57 -07:00
Barak Michener
fa74e702d8 security: Improve the security api as per the suggestions list in #2384
Subcommits:

decouple root and security enable/disable

create root role

prefix matching

godep: bump go-etcd to include credentials

add godep for speakeasy and auth entry parsing

appropriate errors for security enable/disable

WIP adding to etcd/client all the security client methods

add guest access

minor ui return tweaks

revert client changes

respond to comments, log more security operations

fix major ensure() bug, add better UX

block recursive access

fix some boneheaded mistakes

fix integration test

last comments

fix up security_api.md

philips nits

fix docs
2015-04-23 16:11:38 -04: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
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
Yicheng Qin
4dd00be365 etcdhttp: reset serve and watch timeout 2015-01-02 16:39:13 -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
9726d3909c etcdhttp: bump default Server timeout to 5 mins 2014-10-31 10:52:46 -07:00
Brian Waldon
8fbf887e52 etcdhttp: only log when error deserves it 2014-10-28 10:30:05 -07:00
Xiang Li
6cb45236ac etcdhttp: make admin HTTP endpoint return json format error 2014-10-27 17:03:58 -07:00
Xiang Li
d0604c7d5c error: write->writeTo 2014-10-27 15:32:36 -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
Yicheng Qin
338f59db74 Merge pull request #1401 from unihorn/186
etcdhttp: parse quorum field from http request
2014-10-24 15:54:40 -07:00
Yicheng Qin
0e1d1646fd etcdhttp: parse quorum field from http request 2014-10-24 15:44:39 -07:00
Yicheng Qin
cb59a46576 Merge pull request #1396 from unihorn/185
etcdhttp: trim StoreKeysPrefix from error in serveKeys
2014-10-24 14:48:31 -07:00
Jonathan Boulle
46528ee17b Merge pull request #1391 from jonboulle/version
/version is 404 now
2014-10-24 14:48:02 -07:00
Jonathan Boulle
9a465b9cf5 etcdhttp: add /version endpoint 2014-10-24 14:47:37 -07:00
Jonathan Boulle
bac13b5cb2 etcdserver/etcdhttp: remove log message for every received raft 2014-10-24 14:25:20 -07:00
Yicheng Qin
34dcbb4679 etcdhttp: trim StoreKeysPrefix from error in serveKeys
It returns error messaage like this now:
'{"errorCode":100,"message":"Key not found","cause":"/1/pants","index":10}'

The commit trims '/1' prefix from cause field if exists.

This is a hack to make it display well. It is correct because all error causes
that contain Path puts Path at the head of the string.
2014-10-24 14:12:53 -07:00
Jonathan Boulle
14852662ef etcdhttp: rename Members -> members in JSON, update doc 2014-10-24 12:03:17 -07:00
Jonathan Boulle
7ef468b315 etcdhttp: remove /v2/admin/members/x serving 2014-10-24 12:03:17 -07:00
Jonathan Boulle
9b679de9dd etcdserver/etcdhttp: use container for admin/members endpoint 2014-10-24 12:03:17 -07:00
Xiang Li
ed29259801 etcdserver: fix member endpoint on peerurl 2014-10-23 17:18:01 -07:00
Xiang Li
d8258c38be Merge pull request #1374 from xiangli-cmu/cluster_on_peerurl
etcdserver: add member endpoint to peerurl
2014-10-23 16:08:45 -07:00
Jonathan Boulle
af42f4a56b etcdserver: sort Members() in Cluster 2014-10-23 15:57:27 -07:00
Xiang Li
02551c277d etcdserver: add member endpoint to peerurl 2014-10-23 15:55:00 -07:00
Yicheng Qin
8eee8c260e etcdserver: rebase on master and code clean 2014-10-23 13:58:55 -07:00
Yicheng Qin
89572b5fd7 etcdserver: refactor cluster and clusterStore
Integrate clusterStore into cluster, and let cluster become the source of
cluster info.
2014-10-23 13:27:54 -07:00
Xiang Li
86facb3f91 etcdhttp: sort member 2014-10-23 11:21:20 -07:00
Xiang Li
8d6bb4a471 etcdserver: support GET on admin endpoint 2014-10-23 10:53:55 -07:00
Xiang Li
051ad7585f Merge pull request #1363 from coreos/return_json
etcdserver: admin PUT returns the json representation of the newly creat...
2014-10-22 20:11:08 -07:00
Brandon Philips
2cb8efb9b5 Merge pull request #1362 from philips/consistent-hex-use
etcdserver: use hex for cluster and machine id
2014-10-22 18:43:21 -07:00
Xiang Li
63fa2a626a etcdserver: admin PUT returns the json representation of the newly created member 2014-10-22 17:19:28 -07:00
Xiang Li
712a05be83 Merge pull request #1357 from coreos/accept_json
etcdserver: admin endpoint accepts json body
2014-10-22 16:30:22 -07:00
Brandon Philips
ab90369f9e etcdserver: use hex for cluster and machine id
Continue using hex everywhere. Including here.

TODO: cleanup the printing of the structs which currently have decimal
to/from:

`{Type:MsgAppResp To:9973738105406047488 From:17050684879817348455 T...`
2014-10-22 16:24:50 -07:00
Xiang Li
7be0f4b618 etcdserver: admin endpoint accepts json body 2014-10-22 16:19:48 -07:00
Brandon Philips
0d0bc3a57e etcdserver: fixup mismatch error line
Both wcid and gcid are strings, don't try to print it out in hex.
2014-10-22 15:48:22 -07:00
Brandon Philips
400dd2d7bc etcdserver: cleanup the cluster ID error message
1) Don't panic since we know exactly where this is coming from and don't
need the user to see a full back trace

2) Add docs explaining this situation a bit further

3) Cleanup the error to look like other similiar errors
2014-10-22 15:26:35 -07:00
Xiang Li
d00152765a etcdserver: etcdserver generates the ID when adding new member.
When adding new member, the etcdserver generates the ID based on the current time
and the given peerurls. We include time to add the uniqueness, since the node with
same peerurls should be able to (add, then remove) several times.
2014-10-22 13:15:56 -07:00
Yicheng Qin
5014558b00 etcdserver: clean code 2014-10-22 11:09:36 -07:00
Yicheng Qin
3162ead7b1 etcdhttp: do message statistics only on valid ones 2014-10-22 11:09:36 -07:00
Yicheng Qin
7498234e40 etcdserver: record removed member to check incoming message 2014-10-22 11:09:35 -07:00
Yicheng Qin
06b196e345 etcdhttp: writeEvent -> writeKeyEvent 2014-10-21 16:10:49 -07:00
Yicheng Qin
ca73f25615 etcdhttp: parseRequest -> parseKeyRequest 2014-10-21 16:10:49 -07:00
Yicheng Qin
e2b6a4fc4c etcdserver: const XXXDir -> StoreXXXPrefix
and code clean
2014-10-21 16:10:49 -07:00
Yicheng Qin
2ff3cac653 etcdserver/etcdhttp: store location adjustment
Detailed adjustment:
/_etcd/machines/* -> /0/members/*
/* -> /1/*

And it keeps key path returned to user the same as before.
2014-10-21 16:10:19 -07:00