mirror of
https://github.com/status-im/consul.git
synced 2025-01-12 06:44:41 +00:00
a668c36930
Introduces two new public gRPC endpoints (`Login` and `Logout`) and includes refactoring of the equivalent net/rpc endpoints to enable the majority of logic to be reused (i.e. by extracting the `Binder` and `TokenWriter` types). This contains the OSS portions of the following enterprise commits: - 75fcdbfcfa6af21d7128cb2544829ead0b1df603 - bce14b714151af74a7f0110843d640204082630a - cc508b70fbf58eda144d9af3d71bd0f483985893
52 lines
1.3 KiB
Go
52 lines
1.3 KiB
Go
// Code generated by mockery v2.12.0. DO NOT EDIT.
|
|
|
|
package acl
|
|
|
|
import (
|
|
context "context"
|
|
|
|
authmethod "github.com/hashicorp/consul/agent/consul/authmethod"
|
|
|
|
mock "github.com/stretchr/testify/mock"
|
|
|
|
testing "testing"
|
|
)
|
|
|
|
// MockValidator is an autogenerated mock type for the Validator type
|
|
type MockValidator struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// ValidateLogin provides a mock function with given fields: ctx, loginToken
|
|
func (_m *MockValidator) ValidateLogin(ctx context.Context, loginToken string) (*authmethod.Identity, error) {
|
|
ret := _m.Called(ctx, loginToken)
|
|
|
|
var r0 *authmethod.Identity
|
|
if rf, ok := ret.Get(0).(func(context.Context, string) *authmethod.Identity); ok {
|
|
r0 = rf(ctx, loginToken)
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*authmethod.Identity)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
|
|
r1 = rf(ctx, loginToken)
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// NewMockValidator creates a new instance of MockValidator. It also registers the testing.TB interface on the mock and a cleanup function to assert the mocks expectations.
|
|
func NewMockValidator(t testing.TB) *MockValidator {
|
|
mock := &MockValidator{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|