*: support getting role in auth v3

This commit implements RoleGet() RPC of etcdserver and adds a new
subcommand "role get" to etcdctl v3. It will list up permissions that
are granted to a given role.

$ ETCDCTL_API=3 bin/etcdctl role get r1
Role r1
KV Read:
        b
        d
KV Write:
        a
        c
        d
This commit is contained in:
Hitoshi Mitake
2016-06-02 23:25:15 +09:00
committed by Hitoshi Mitake
parent 755567cb3d
commit 10ee69b44c
10 changed files with 452 additions and 206 deletions

View File

@ -66,8 +66,11 @@ func (as *AuthServer) RoleDelete(ctx context.Context, r *pb.AuthRoleDeleteReques
}
func (as *AuthServer) RoleGet(ctx context.Context, r *pb.AuthRoleGetRequest) (*pb.AuthRoleGetResponse, error) {
plog.Info("not implemented yet")
return nil, nil
resp, err := as.authenticator.RoleGet(ctx, r)
if err != nil {
return nil, togRPCError(err)
}
return resp, nil
}
func (as *AuthServer) RoleRevoke(ctx context.Context, r *pb.AuthRoleRevokeRequest) (*pb.AuthRoleRevokeResponse, error) {