Documentation ¶
Overview ¶
Package oauth2 is a generated GoMock package.
Index ¶
- Variables
- type ConfigInterface
- type MockConfigInterface
- func (m *MockConfigInterface) AuthCodeURL(state string, opts ...oauth2.AuthCodeOption) string
- func (m *MockConfigInterface) Client(ctx context.Context, t *oauth2.Token) *http.Client
- func (m *MockConfigInterface) EXPECT() *MockConfigInterfaceMockRecorder
- func (m *MockConfigInterface) Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
- func (m *MockConfigInterface) PasswordCredentialsToken(ctx context.Context, username, password string) (*oauth2.Token, error)
- func (m *MockConfigInterface) TokenSource(ctx context.Context, t *oauth2.Token) oauth2.TokenSource
- type MockConfigInterfaceMockRecorder
- func (mr *MockConfigInterfaceMockRecorder) AuthCodeURL(state interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockConfigInterfaceMockRecorder) Client(ctx, t interface{}) *gomock.Call
- func (mr *MockConfigInterfaceMockRecorder) Exchange(ctx, code interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockConfigInterfaceMockRecorder) PasswordCredentialsToken(ctx, username, password interface{}) *gomock.Call
- func (mr *MockConfigInterfaceMockRecorder) TokenSource(ctx, t interface{}) *gomock.Call
Constants ¶
This section is empty.
Variables ¶
var NewConfig = func(clientID, clientSecret, authURL, tokenURL string, scopes []string) ConfigInterface { return &oauth2Config{ config: &oauth2.Config{ ClientID: clientID, ClientSecret: clientSecret, Endpoint: oauth2.Endpoint{ AuthURL: authURL, TokenURL: tokenURL, AuthStyle: oauth2.AuthStyleInParams, }, Scopes: scopes, }, } }
NewConfig creates a new oauth2 config object
Functions ¶
This section is empty.
Types ¶
type ConfigInterface ¶
type ConfigInterface interface { AuthCodeURL(state string, opts ...oauth2.AuthCodeOption) string PasswordCredentialsToken(ctx context.Context, username, password string) (*oauth2.Token, error) Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error) Client(ctx context.Context, t *oauth2.Token) *http.Client TokenSource(ctx context.Context, t *oauth2.Token) oauth2.TokenSource }
ConfigInterface codifies the interface of an oauth2.Config object. This is relevant for testing purposes to mock the OAuth2 authentication flow.
type MockConfigInterface ¶
type MockConfigInterface struct {
// contains filtered or unexported fields
}
MockConfigInterface is a mock of ConfigInterface interface
func NewMockConfigInterface ¶
func NewMockConfigInterface(ctrl *gomock.Controller) *MockConfigInterface
NewMockConfigInterface creates a new mock instance
func (*MockConfigInterface) AuthCodeURL ¶
func (m *MockConfigInterface) AuthCodeURL(state string, opts ...oauth2.AuthCodeOption) string
AuthCodeURL mocks base method
func (*MockConfigInterface) EXPECT ¶
func (m *MockConfigInterface) EXPECT() *MockConfigInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockConfigInterface) Exchange ¶
func (m *MockConfigInterface) Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
Exchange mocks base method
func (*MockConfigInterface) PasswordCredentialsToken ¶
func (m *MockConfigInterface) PasswordCredentialsToken(ctx context.Context, username, password string) (*oauth2.Token, error)
PasswordCredentialsToken mocks base method
func (*MockConfigInterface) TokenSource ¶
func (m *MockConfigInterface) TokenSource(ctx context.Context, t *oauth2.Token) oauth2.TokenSource
TokenSource mocks base method
type MockConfigInterfaceMockRecorder ¶
type MockConfigInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockConfigInterfaceMockRecorder is the mock recorder for MockConfigInterface
func (*MockConfigInterfaceMockRecorder) AuthCodeURL ¶
func (mr *MockConfigInterfaceMockRecorder) AuthCodeURL(state interface{}, opts ...interface{}) *gomock.Call
AuthCodeURL indicates an expected call of AuthCodeURL
func (*MockConfigInterfaceMockRecorder) Client ¶
func (mr *MockConfigInterfaceMockRecorder) Client(ctx, t interface{}) *gomock.Call
Client indicates an expected call of Client
func (*MockConfigInterfaceMockRecorder) Exchange ¶
func (mr *MockConfigInterfaceMockRecorder) Exchange(ctx, code interface{}, opts ...interface{}) *gomock.Call
Exchange indicates an expected call of Exchange
func (*MockConfigInterfaceMockRecorder) PasswordCredentialsToken ¶
func (mr *MockConfigInterfaceMockRecorder) PasswordCredentialsToken(ctx, username, password interface{}) *gomock.Call
PasswordCredentialsToken indicates an expected call of PasswordCredentialsToken
func (*MockConfigInterfaceMockRecorder) TokenSource ¶
func (mr *MockConfigInterfaceMockRecorder) TokenSource(ctx, t interface{}) *gomock.Call
TokenSource indicates an expected call of TokenSource