30 Commits

Author SHA1 Message Date
Anthony Romano
35dffc7bc1 rpctypes,v3rpc: add Corrupt error code 2017-08-22 09:59:59 -07:00
Gyu-Ho Lee
939bbd77c0 etcdserver/*: add 'ErrNotLeader'
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-06-23 12:46:07 -07:00
Anthony Romano
8542f2e673 v3rpc: use map for translating errors to grpc errors
Switch statement had poor coverage, use a map instead
2017-06-06 16:55:44 -07:00
Iwasaki Yudai
010ffc0692 v3rpc: remove duplicated error case for lease.ErrLeaseNotFound 2017-05-08 20:09:41 -07:00
Hitoshi Mitake
c40b86bcde auth, etcdserver: forbid invalid auth management
If auth is enabled,
1. deleting the user root
2. revoking the role root from the user root
must not be allowed. This commit forbids them.
2017-03-23 16:47:58 +09:00
Xiang Li
26d99269c0 Merge pull request #6898 from mitake/auth-maintain
RFC, WIP: etcdserver: let maintenance services require root role
2017-01-14 11:22:14 -08:00
Hitoshi Mitake
9886e9448e auth, etcdserver: let maintenance services require root role
This commit lets maintenance services require root privilege. It also
moves AuthInfoFromCtx() from etcdserver to auth pkg for cleaning purpose.
2017-01-14 19:36:24 +09:00
Gyu-Ho Lee
e655420d33 v3rpc: error for non-empty value with ignore_value 2017-01-13 15:13:18 -08:00
Hitoshi Mitake
d431b64d97 etcdserver, clientv3: handle a case of expired auth token
This commit adds a mechanism of handling a case of expired auth token
to clientv3. If a server returns an error code
grpc.codes.Unauthenticated, newRetryWrapper() tries to get a new token
and use it as an option of PerRPCCredential.

Fixes https://github.com/coreos/etcd/issues/7012
2017-01-12 11:49:02 +09:00
Gyu-Ho Lee
2b5f9e1c6b etcdserver: expose ErrNotEnoughStartedMembers
Fix https://github.com/coreos/etcd/issues/7072.
2017-01-03 15:23:06 -08:00
Anthony Romano
87b1d9571f v3api, rpctypes: add ErrTimeoutDueToConnectionLost
Lack of GRPC code was causing this to look like a halting error to the client.
2016-12-16 10:25:35 -08:00
Hitoshi Mitake
f85701a46f auth, etcdserver: forbid adding a user with empty name 2016-11-03 13:45:39 +09:00
fanmin shi
a862fd9f0f Lease: Add lease errors to togRPCError()
This allows lease's function to convert lease error to appropriate GRPC errors
2016-10-06 14:29:31 -07:00
Anthony Romano
1defeda792 v3api, rpctypes: add ErrUnhealthy 2016-09-07 16:51:49 -07:00
Anthony Romano
64ac631863 rpctypes: set unknown codes to Unknown instead of internal
An unrecognized error code isn't "very broken".
2016-08-28 19:37:35 -07:00
Anthony Romano
df54ad2208 v3rpc, rpctypes: add error types for timeouts 2016-08-26 09:22:09 -07:00
Xiang Li
27b03f0ed5 *: deny proposals when there is a huge gap between apply/commit 2016-07-14 10:02:55 -07:00
Hitoshi Mitake
8df37d53d6 auth, etcdserver: let Authenticate() fail if auth isn't enabled
Successful Authenticate() would be confusing and make trouble shooting
harder if auth isn't enabled in a cluster.
2016-06-26 22:49:23 -07:00
Xiang Li
da2f2a5189 auth: add root user and root role 2016-06-08 19:55:08 -07:00
Hitoshi Mitake
60fc1e4d4e auth, etcdserver: error codes for revoking non existing role and permission
This commit adds error codes for representing revoking non existing
role (from user) and permission (from role).
2016-06-05 16:41:10 +09:00
Hitoshi Mitake
5144318af0 etcdserver, auth: not return grpc error code directly in the apply phase
Current permission checking mechanism doesn't return its error code
well. The internal error (code = 13) is returned to client and the
retry mechanism doesn't work well. This commit fixes the problem.
2016-05-31 11:04:34 +09:00
Gyu-Ho Lee
abb4cd5646 etcdserver: update LICENSE header 2016-05-12 20:49:40 -07:00
Gyu-Ho Lee
506cf1f03f etcdserver/api/v3rpc: use new errors 2016-04-29 12:00:26 -07:00
Anthony Romano
b7ac758969 *: rename storage package to mvcc 2016-04-25 15:25:51 -07:00
Hitoshi Mitake
131e3806bb *: support authenticate in v3 auth
This commit implements Authenticate() API of the auth package. It does
authentication based on its authUsers bucket and generate a token for
succeeding RPCs.
2016-04-21 12:32:19 +09:00
Hitoshi Mitake
02033b4c47 *: support granting key permission to role in v3 auth 2016-04-11 12:23:19 +09:00
Hitoshi Mitake
2b17a3919c *: support adding role in auth v3 2016-04-05 09:28:17 +09:00
Hitoshi Mitake
d8888ded12 *: support deleting user in v3 auth
This commit adds a functionality of user deletion. It can be invoked
with the new user delete command.

Example usage:
$ ETCDCTL_API=3 etcdctl user delete usr1
2016-03-31 13:18:51 +09:00
Hitoshi Mitake
8ee8d755bb etcdserver: return internal error in a case of not auth specific errors 2016-03-30 23:44:22 +09:00
Hitoshi Mitake
443c677357 etcdserver: extract togRPCError() to a separated file
It is used from multiple files in v3rpc package.
2016-03-30 22:53:20 +09:00