2021-03-01 16:08:57 +00:00
|
|
|
// Copyright 2020-2021 the Pinniped contributors. All Rights Reserved.
|
2020-11-30 23:09:01 +00:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
//
|
|
|
|
|
|
|
|
// Code generated by MockGen. DO NOT EDIT.
|
|
|
|
// Source: go.pinniped.dev/internal/oidc/provider (interfaces: UpstreamOIDCIdentityProviderI)
|
|
|
|
|
|
|
|
// Package mockupstreamoidcidentityprovider is a generated GoMock package.
|
|
|
|
package mockupstreamoidcidentityprovider
|
|
|
|
|
|
|
|
import (
|
|
|
|
context "context"
|
2021-03-01 16:08:57 +00:00
|
|
|
url "net/url"
|
|
|
|
reflect "reflect"
|
|
|
|
|
2020-11-30 23:09:01 +00:00
|
|
|
gomock "github.com/golang/mock/gomock"
|
|
|
|
nonce "go.pinniped.dev/pkg/oidcclient/nonce"
|
|
|
|
oidctypes "go.pinniped.dev/pkg/oidcclient/oidctypes"
|
|
|
|
pkce "go.pinniped.dev/pkg/oidcclient/pkce"
|
|
|
|
oauth2 "golang.org/x/oauth2"
|
2021-10-08 22:48:21 +00:00
|
|
|
types "k8s.io/apimachinery/pkg/types"
|
2020-11-30 23:09:01 +00:00
|
|
|
)
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// MockUpstreamOIDCIdentityProviderI is a mock of UpstreamOIDCIdentityProviderI interface.
|
2020-11-30 23:09:01 +00:00
|
|
|
type MockUpstreamOIDCIdentityProviderI struct {
|
|
|
|
ctrl *gomock.Controller
|
|
|
|
recorder *MockUpstreamOIDCIdentityProviderIMockRecorder
|
|
|
|
}
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// MockUpstreamOIDCIdentityProviderIMockRecorder is the mock recorder for MockUpstreamOIDCIdentityProviderI.
|
2020-11-30 23:09:01 +00:00
|
|
|
type MockUpstreamOIDCIdentityProviderIMockRecorder struct {
|
|
|
|
mock *MockUpstreamOIDCIdentityProviderI
|
|
|
|
}
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// NewMockUpstreamOIDCIdentityProviderI creates a new mock instance.
|
2020-11-30 23:09:01 +00:00
|
|
|
func NewMockUpstreamOIDCIdentityProviderI(ctrl *gomock.Controller) *MockUpstreamOIDCIdentityProviderI {
|
|
|
|
mock := &MockUpstreamOIDCIdentityProviderI{ctrl: ctrl}
|
|
|
|
mock.recorder = &MockUpstreamOIDCIdentityProviderIMockRecorder{mock}
|
|
|
|
return mock
|
|
|
|
}
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
2020-11-30 23:09:01 +00:00
|
|
|
func (m *MockUpstreamOIDCIdentityProviderI) EXPECT() *MockUpstreamOIDCIdentityProviderIMockRecorder {
|
|
|
|
return m.recorder
|
|
|
|
}
|
|
|
|
|
2021-08-12 17:00:18 +00:00
|
|
|
// AllowsPasswordGrant mocks base method.
|
|
|
|
func (m *MockUpstreamOIDCIdentityProviderI) AllowsPasswordGrant() bool {
|
|
|
|
m.ctrl.T.Helper()
|
|
|
|
ret := m.ctrl.Call(m, "AllowsPasswordGrant")
|
|
|
|
ret0, _ := ret[0].(bool)
|
|
|
|
return ret0
|
|
|
|
}
|
|
|
|
|
|
|
|
// AllowsPasswordGrant indicates an expected call of AllowsPasswordGrant.
|
|
|
|
func (mr *MockUpstreamOIDCIdentityProviderIMockRecorder) AllowsPasswordGrant() *gomock.Call {
|
|
|
|
mr.mock.ctrl.T.Helper()
|
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AllowsPasswordGrant", reflect.TypeOf((*MockUpstreamOIDCIdentityProviderI)(nil).AllowsPasswordGrant))
|
|
|
|
}
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// ExchangeAuthcodeAndValidateTokens mocks base method.
|
2020-12-04 21:33:36 +00:00
|
|
|
func (m *MockUpstreamOIDCIdentityProviderI) ExchangeAuthcodeAndValidateTokens(arg0 context.Context, arg1 string, arg2 pkce.Code, arg3 nonce.Nonce, arg4 string) (*oidctypes.Token, error) {
|
2020-11-30 23:09:01 +00:00
|
|
|
m.ctrl.T.Helper()
|
2020-12-02 16:36:07 +00:00
|
|
|
ret := m.ctrl.Call(m, "ExchangeAuthcodeAndValidateTokens", arg0, arg1, arg2, arg3, arg4)
|
2020-12-04 21:33:36 +00:00
|
|
|
ret0, _ := ret[0].(*oidctypes.Token)
|
|
|
|
ret1, _ := ret[1].(error)
|
|
|
|
return ret0, ret1
|
2020-11-30 23:09:01 +00:00
|
|
|
}
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// ExchangeAuthcodeAndValidateTokens indicates an expected call of ExchangeAuthcodeAndValidateTokens.
|
2020-12-02 16:36:07 +00:00
|
|
|
func (mr *MockUpstreamOIDCIdentityProviderIMockRecorder) ExchangeAuthcodeAndValidateTokens(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call {
|
2020-11-30 23:09:01 +00:00
|
|
|
mr.mock.ctrl.T.Helper()
|
2020-12-02 16:36:07 +00:00
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExchangeAuthcodeAndValidateTokens", reflect.TypeOf((*MockUpstreamOIDCIdentityProviderI)(nil).ExchangeAuthcodeAndValidateTokens), arg0, arg1, arg2, arg3, arg4)
|
2020-11-30 23:09:01 +00:00
|
|
|
}
|
|
|
|
|
2021-10-08 22:48:21 +00:00
|
|
|
// GetAdditionalAuthcodeParams mocks base method.
|
|
|
|
func (m *MockUpstreamOIDCIdentityProviderI) GetAdditionalAuthcodeParams() map[string]string {
|
|
|
|
m.ctrl.T.Helper()
|
|
|
|
ret := m.ctrl.Call(m, "GetAdditionalAuthcodeParams")
|
|
|
|
ret0, _ := ret[0].(map[string]string)
|
|
|
|
return ret0
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetAdditionalAuthcodeParams indicates an expected call of GetAdditionalAuthcodeParams.
|
|
|
|
func (mr *MockUpstreamOIDCIdentityProviderIMockRecorder) GetAdditionalAuthcodeParams() *gomock.Call {
|
|
|
|
mr.mock.ctrl.T.Helper()
|
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAdditionalAuthcodeParams", reflect.TypeOf((*MockUpstreamOIDCIdentityProviderI)(nil).GetAdditionalAuthcodeParams))
|
|
|
|
}
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// GetAuthorizationURL mocks base method.
|
2020-11-30 23:09:01 +00:00
|
|
|
func (m *MockUpstreamOIDCIdentityProviderI) GetAuthorizationURL() *url.URL {
|
|
|
|
m.ctrl.T.Helper()
|
|
|
|
ret := m.ctrl.Call(m, "GetAuthorizationURL")
|
|
|
|
ret0, _ := ret[0].(*url.URL)
|
|
|
|
return ret0
|
|
|
|
}
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// GetAuthorizationURL indicates an expected call of GetAuthorizationURL.
|
2020-11-30 23:09:01 +00:00
|
|
|
func (mr *MockUpstreamOIDCIdentityProviderIMockRecorder) GetAuthorizationURL() *gomock.Call {
|
|
|
|
mr.mock.ctrl.T.Helper()
|
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAuthorizationURL", reflect.TypeOf((*MockUpstreamOIDCIdentityProviderI)(nil).GetAuthorizationURL))
|
|
|
|
}
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// GetClientID mocks base method.
|
2020-11-30 23:09:01 +00:00
|
|
|
func (m *MockUpstreamOIDCIdentityProviderI) GetClientID() string {
|
|
|
|
m.ctrl.T.Helper()
|
|
|
|
ret := m.ctrl.Call(m, "GetClientID")
|
|
|
|
ret0, _ := ret[0].(string)
|
|
|
|
return ret0
|
|
|
|
}
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// GetClientID indicates an expected call of GetClientID.
|
2020-11-30 23:09:01 +00:00
|
|
|
func (mr *MockUpstreamOIDCIdentityProviderIMockRecorder) GetClientID() *gomock.Call {
|
|
|
|
mr.mock.ctrl.T.Helper()
|
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClientID", reflect.TypeOf((*MockUpstreamOIDCIdentityProviderI)(nil).GetClientID))
|
|
|
|
}
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// GetGroupsClaim mocks base method.
|
2020-11-30 23:09:01 +00:00
|
|
|
func (m *MockUpstreamOIDCIdentityProviderI) GetGroupsClaim() string {
|
|
|
|
m.ctrl.T.Helper()
|
|
|
|
ret := m.ctrl.Call(m, "GetGroupsClaim")
|
|
|
|
ret0, _ := ret[0].(string)
|
|
|
|
return ret0
|
|
|
|
}
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// GetGroupsClaim indicates an expected call of GetGroupsClaim.
|
2020-11-30 23:09:01 +00:00
|
|
|
func (mr *MockUpstreamOIDCIdentityProviderIMockRecorder) GetGroupsClaim() *gomock.Call {
|
|
|
|
mr.mock.ctrl.T.Helper()
|
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGroupsClaim", reflect.TypeOf((*MockUpstreamOIDCIdentityProviderI)(nil).GetGroupsClaim))
|
|
|
|
}
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// GetName mocks base method.
|
2020-11-30 23:09:01 +00:00
|
|
|
func (m *MockUpstreamOIDCIdentityProviderI) GetName() string {
|
|
|
|
m.ctrl.T.Helper()
|
|
|
|
ret := m.ctrl.Call(m, "GetName")
|
|
|
|
ret0, _ := ret[0].(string)
|
|
|
|
return ret0
|
|
|
|
}
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// GetName indicates an expected call of GetName.
|
2020-11-30 23:09:01 +00:00
|
|
|
func (mr *MockUpstreamOIDCIdentityProviderIMockRecorder) GetName() *gomock.Call {
|
|
|
|
mr.mock.ctrl.T.Helper()
|
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetName", reflect.TypeOf((*MockUpstreamOIDCIdentityProviderI)(nil).GetName))
|
|
|
|
}
|
|
|
|
|
2021-10-08 22:48:21 +00:00
|
|
|
// GetResourceUID mocks base method.
|
|
|
|
func (m *MockUpstreamOIDCIdentityProviderI) GetResourceUID() types.UID {
|
|
|
|
m.ctrl.T.Helper()
|
|
|
|
ret := m.ctrl.Call(m, "GetResourceUID")
|
|
|
|
ret0, _ := ret[0].(types.UID)
|
|
|
|
return ret0
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetResourceUID indicates an expected call of GetResourceUID.
|
|
|
|
func (mr *MockUpstreamOIDCIdentityProviderIMockRecorder) GetResourceUID() *gomock.Call {
|
|
|
|
mr.mock.ctrl.T.Helper()
|
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetResourceUID", reflect.TypeOf((*MockUpstreamOIDCIdentityProviderI)(nil).GetResourceUID))
|
|
|
|
}
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// GetScopes mocks base method.
|
2020-11-30 23:09:01 +00:00
|
|
|
func (m *MockUpstreamOIDCIdentityProviderI) GetScopes() []string {
|
|
|
|
m.ctrl.T.Helper()
|
|
|
|
ret := m.ctrl.Call(m, "GetScopes")
|
|
|
|
ret0, _ := ret[0].([]string)
|
|
|
|
return ret0
|
|
|
|
}
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// GetScopes indicates an expected call of GetScopes.
|
2020-11-30 23:09:01 +00:00
|
|
|
func (mr *MockUpstreamOIDCIdentityProviderIMockRecorder) GetScopes() *gomock.Call {
|
|
|
|
mr.mock.ctrl.T.Helper()
|
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetScopes", reflect.TypeOf((*MockUpstreamOIDCIdentityProviderI)(nil).GetScopes))
|
|
|
|
}
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// GetUsernameClaim mocks base method.
|
2020-11-30 23:09:01 +00:00
|
|
|
func (m *MockUpstreamOIDCIdentityProviderI) GetUsernameClaim() string {
|
|
|
|
m.ctrl.T.Helper()
|
|
|
|
ret := m.ctrl.Call(m, "GetUsernameClaim")
|
|
|
|
ret0, _ := ret[0].(string)
|
|
|
|
return ret0
|
|
|
|
}
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// GetUsernameClaim indicates an expected call of GetUsernameClaim.
|
2020-11-30 23:09:01 +00:00
|
|
|
func (mr *MockUpstreamOIDCIdentityProviderIMockRecorder) GetUsernameClaim() *gomock.Call {
|
|
|
|
mr.mock.ctrl.T.Helper()
|
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUsernameClaim", reflect.TypeOf((*MockUpstreamOIDCIdentityProviderI)(nil).GetUsernameClaim))
|
|
|
|
}
|
|
|
|
|
2021-08-12 17:00:18 +00:00
|
|
|
// PasswordCredentialsGrantAndValidateTokens mocks base method.
|
|
|
|
func (m *MockUpstreamOIDCIdentityProviderI) PasswordCredentialsGrantAndValidateTokens(arg0 context.Context, arg1, arg2 string) (*oidctypes.Token, error) {
|
|
|
|
m.ctrl.T.Helper()
|
|
|
|
ret := m.ctrl.Call(m, "PasswordCredentialsGrantAndValidateTokens", arg0, arg1, arg2)
|
|
|
|
ret0, _ := ret[0].(*oidctypes.Token)
|
|
|
|
ret1, _ := ret[1].(error)
|
|
|
|
return ret0, ret1
|
|
|
|
}
|
|
|
|
|
|
|
|
// PasswordCredentialsGrantAndValidateTokens indicates an expected call of PasswordCredentialsGrantAndValidateTokens.
|
|
|
|
func (mr *MockUpstreamOIDCIdentityProviderIMockRecorder) PasswordCredentialsGrantAndValidateTokens(arg0, arg1, arg2 interface{}) *gomock.Call {
|
|
|
|
mr.mock.ctrl.T.Helper()
|
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PasswordCredentialsGrantAndValidateTokens", reflect.TypeOf((*MockUpstreamOIDCIdentityProviderI)(nil).PasswordCredentialsGrantAndValidateTokens), arg0, arg1, arg2)
|
|
|
|
}
|
|
|
|
|
2021-10-13 19:31:20 +00:00
|
|
|
// PerformRefresh mocks base method.
|
|
|
|
func (m *MockUpstreamOIDCIdentityProviderI) PerformRefresh(arg0 context.Context, arg1 string) (*oauth2.Token, error) {
|
|
|
|
m.ctrl.T.Helper()
|
|
|
|
ret := m.ctrl.Call(m, "PerformRefresh", arg0, arg1)
|
|
|
|
ret0, _ := ret[0].(*oauth2.Token)
|
|
|
|
ret1, _ := ret[1].(error)
|
|
|
|
return ret0, ret1
|
|
|
|
}
|
|
|
|
|
|
|
|
// PerformRefresh indicates an expected call of PerformRefresh.
|
|
|
|
func (mr *MockUpstreamOIDCIdentityProviderIMockRecorder) PerformRefresh(arg0, arg1 interface{}) *gomock.Call {
|
|
|
|
mr.mock.ctrl.T.Helper()
|
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PerformRefresh", reflect.TypeOf((*MockUpstreamOIDCIdentityProviderI)(nil).PerformRefresh), arg0, arg1)
|
|
|
|
}
|
|
|
|
|
2021-10-22 21:32:26 +00:00
|
|
|
// RevokeRefreshToken mocks base method.
|
|
|
|
func (m *MockUpstreamOIDCIdentityProviderI) RevokeRefreshToken(arg0 context.Context, arg1 string) error {
|
|
|
|
m.ctrl.T.Helper()
|
|
|
|
ret := m.ctrl.Call(m, "RevokeRefreshToken", arg0, arg1)
|
|
|
|
ret0, _ := ret[0].(error)
|
|
|
|
return ret0
|
|
|
|
}
|
|
|
|
|
|
|
|
// RevokeRefreshToken indicates an expected call of RevokeRefreshToken.
|
|
|
|
func (mr *MockUpstreamOIDCIdentityProviderIMockRecorder) RevokeRefreshToken(arg0, arg1 interface{}) *gomock.Call {
|
|
|
|
mr.mock.ctrl.T.Helper()
|
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RevokeRefreshToken", reflect.TypeOf((*MockUpstreamOIDCIdentityProviderI)(nil).RevokeRefreshToken), arg0, arg1)
|
|
|
|
}
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// ValidateToken mocks base method.
|
2020-12-04 21:33:36 +00:00
|
|
|
func (m *MockUpstreamOIDCIdentityProviderI) ValidateToken(arg0 context.Context, arg1 *oauth2.Token, arg2 nonce.Nonce) (*oidctypes.Token, error) {
|
2020-11-30 23:09:01 +00:00
|
|
|
m.ctrl.T.Helper()
|
|
|
|
ret := m.ctrl.Call(m, "ValidateToken", arg0, arg1, arg2)
|
2020-12-04 21:33:36 +00:00
|
|
|
ret0, _ := ret[0].(*oidctypes.Token)
|
|
|
|
ret1, _ := ret[1].(error)
|
|
|
|
return ret0, ret1
|
2020-11-30 23:09:01 +00:00
|
|
|
}
|
|
|
|
|
2021-03-01 16:08:57 +00:00
|
|
|
// ValidateToken indicates an expected call of ValidateToken.
|
2020-11-30 23:09:01 +00:00
|
|
|
func (mr *MockUpstreamOIDCIdentityProviderIMockRecorder) ValidateToken(arg0, arg1, arg2 interface{}) *gomock.Call {
|
|
|
|
mr.mock.ctrl.T.Helper()
|
|
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateToken", reflect.TypeOf((*MockUpstreamOIDCIdentityProviderI)(nil).ValidateToken), arg0, arg1, arg2)
|
|
|
|
}
|