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.
This commit is contained in:
Hitoshi Mitake
2017-03-17 16:04:56 +09:00
parent 0c87467f69
commit c40b86bcde
3 changed files with 21 additions and 0 deletions

View File

@ -97,6 +97,8 @@ func togRPCError(err error) error {
return rpctypes.ErrGRPCAuthNotEnabled
case auth.ErrInvalidAuthToken:
return rpctypes.ErrGRPCInvalidAuthToken
case auth.ErrInvalidAuthMgmt:
return rpctypes.ErrGRPCInvalidAuthMgmt
default:
return grpc.Errorf(codes.Unknown, err.Error())
}