Documentation ¶
Index ¶
- type MockOauthTokenService
- func (m *MockOauthTokenService) GetCurrentOAuthToken(ctx context.Context, usr identity.Requester) *oauth2.Token
- func (m *MockOauthTokenService) HasOAuthEntry(ctx context.Context, usr identity.Requester) (*login.UserAuth, bool, error)
- func (m *MockOauthTokenService) InvalidateOAuthTokens(ctx context.Context, usr *login.UserAuth) error
- func (m *MockOauthTokenService) IsOAuthPassThruEnabled(ds *datasources.DataSource) bool
- func (m *MockOauthTokenService) TryTokenRefresh(ctx context.Context, usr identity.Requester) error
- type MockService
- func (_m *MockService) GetCurrentOAuthToken(_a0 context.Context, _a1 identity.Requester) *oauth2.Token
- func (_m *MockService) HasOAuthEntry(_a0 context.Context, _a1 identity.Requester) (*login.UserAuth, bool, error)
- func (_m *MockService) InvalidateOAuthTokens(_a0 context.Context, _a1 *login.UserAuth) error
- func (_m *MockService) IsOAuthPassThruEnabled(_a0 *datasources.DataSource) bool
- func (_m *MockService) TryTokenRefresh(_a0 context.Context, _a1 identity.Requester) error
- type Service
- func (s *Service) GetCurrentOAuthToken(context.Context, identity.Requester) *oauth2.Token
- func (s *Service) HasOAuthEntry(context.Context, identity.Requester) (*login.UserAuth, bool, error)
- func (s *Service) InvalidateOAuthTokens(context.Context, *login.UserAuth) error
- func (s *Service) IsOAuthPassThruEnabled(ds *datasources.DataSource) bool
- func (s *Service) TryTokenRefresh(context.Context, identity.Requester) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockOauthTokenService ¶
type MockOauthTokenService struct { GetCurrentOauthTokenFunc func(ctx context.Context, usr identity.Requester) *oauth2.Token IsOAuthPassThruEnabledFunc func(ds *datasources.DataSource) bool HasOAuthEntryFunc func(ctx context.Context, usr identity.Requester) (*login.UserAuth, bool, error) InvalidateOAuthTokensFunc func(ctx context.Context, usr *login.UserAuth) error TryTokenRefreshFunc func(ctx context.Context, usr identity.Requester) error }
func (*MockOauthTokenService) GetCurrentOAuthToken ¶
func (*MockOauthTokenService) HasOAuthEntry ¶
func (*MockOauthTokenService) InvalidateOAuthTokens ¶
func (*MockOauthTokenService) IsOAuthPassThruEnabled ¶
func (m *MockOauthTokenService) IsOAuthPassThruEnabled(ds *datasources.DataSource) bool
func (*MockOauthTokenService) TryTokenRefresh ¶
type MockService ¶
MockService is an autogenerated mock type for the OAuthTokenService type
func NewMockService ¶
func NewMockService(t interface { mock.TestingT Cleanup(func()) }) *MockService
NewMockService creates a new instance of MockService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockService) GetCurrentOAuthToken ¶
func (_m *MockService) GetCurrentOAuthToken(_a0 context.Context, _a1 identity.Requester) *oauth2.Token
GetCurrentOAuthToken provides a mock function with given fields: _a0, _a1
func (*MockService) HasOAuthEntry ¶
func (_m *MockService) HasOAuthEntry(_a0 context.Context, _a1 identity.Requester) (*login.UserAuth, bool, error)
HasOAuthEntry provides a mock function with given fields: _a0, _a1
func (*MockService) InvalidateOAuthTokens ¶
InvalidateOAuthTokens provides a mock function with given fields: _a0, _a1
func (*MockService) IsOAuthPassThruEnabled ¶
func (_m *MockService) IsOAuthPassThruEnabled(_a0 *datasources.DataSource) bool
IsOAuthPassThruEnabled provides a mock function with given fields: _a0
func (*MockService) TryTokenRefresh ¶
TryTokenRefresh provides a mock function with given fields: _a0, _a1
type Service ¶
Service an OAuth token service suitable for tests.
func ProvideService ¶
func ProvideService() *Service
ProvideService provides an OAuth token service suitable for tests.
func (*Service) GetCurrentOAuthToken ¶
func (*Service) HasOAuthEntry ¶
func (*Service) InvalidateOAuthTokens ¶
func (*Service) IsOAuthPassThruEnabled ¶
func (s *Service) IsOAuthPassThruEnabled(ds *datasources.DataSource) bool