Merge pull request #13819 from endocrimes/dani/auth_test.go

migrate e2e/users tests to common framework
This commit is contained in:
Marek Siarkowicz
2022-04-06 16:02:46 +02:00
committed by GitHub
7 changed files with 505 additions and 209 deletions

View File

@ -289,3 +289,25 @@ func (c integrationClient) LeaseRevoke(id clientv3.LeaseID) (*clientv3.LeaseRevo
return c.Client.Revoke(ctx, id)
}
func (c integrationClient) UserAdd(name, password string, opts config.UserAddOptions) (*clientv3.AuthUserAddResponse, error) {
ctx := context.Background()
return c.Client.UserAddWithOptions(ctx, name, password, &clientv3.UserAddOptions{
NoPassword: opts.NoPassword,
})
}
func (c integrationClient) UserList() (*clientv3.AuthUserListResponse, error) {
ctx := context.Background()
return c.Client.UserList(ctx)
}
func (c integrationClient) UserDelete(name string) (*clientv3.AuthUserDeleteResponse, error) {
ctx := context.Background()
return c.Client.UserDelete(ctx, name)
}
func (c integrationClient) UserChangePass(user, newPass string) error {
_, err := c.Client.UserChangePassword(context.Background(), user, newPass)
return err
}