mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: do not allow creating empty role
Like user, we should not allow creating empty role. Related #10905
This commit is contained in:
@@ -40,4 +40,9 @@ func TestRoleError(t *testing.T) {
|
||||
if err != rpctypes.ErrRoleAlreadyExist {
|
||||
t.Fatalf("expected %v, got %v", rpctypes.ErrRoleAlreadyExist, err)
|
||||
}
|
||||
|
||||
_, err = authapi.RoleAdd(context.TODO(), "")
|
||||
if err != rpctypes.ErrRoleEmpty {
|
||||
t.Fatalf("expected %v, got %v", rpctypes.ErrRoleEmpty, err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user