Documentation ¶
Index ¶
- type AuthTokenErrorData
- type AuthTokenResponse
- type AuthTokenResponseData
- type Client
- func (c *Client) GetAuthorizationEndpoint(ctx context.Context) (string, error)
- func (c *Client) GetRefreshedAccessToken(ctx context.Context, clientId string, refreshToken string) (*AuthTokenResponse, error)
- func (c *Client) GetTokenEndpoint(ctx context.Context) (string, error)
- func (c *Client) GetTokenResponse(ctx context.Context, clientId string, code string, redirecturi string) (*AuthTokenResponse, error)
- func (c *Client) GetUserInfo(ctx context.Context, accessToken string) (*UserInfo, error)
- type Interface
- type MockInterface
- func (_m *MockInterface) EXPECT() *MockInterface_Expecter
- func (_m *MockInterface) GetAuthorizationEndpoint(ctx context.Context) (string, error)
- func (_m *MockInterface) GetRefreshedAccessToken(ctx context.Context, clientId string, refreshToken string) (*AuthTokenResponse, error)
- func (_m *MockInterface) GetTokenEndpoint(ctx context.Context) (string, error)
- func (_m *MockInterface) GetTokenResponse(ctx context.Context, clientId string, code string, redirecturi string) (*AuthTokenResponse, error)
- func (_m *MockInterface) GetUserInfo(ctx context.Context, accessToken string) (*UserInfo, error)
- type MockInterface_Expecter
- func (_e *MockInterface_Expecter) GetAuthorizationEndpoint(ctx interface{}) *MockInterface_GetAuthorizationEndpoint_Call
- func (_e *MockInterface_Expecter) GetRefreshedAccessToken(ctx interface{}, clientId interface{}, refreshToken interface{}) *MockInterface_GetRefreshedAccessToken_Call
- func (_e *MockInterface_Expecter) GetTokenEndpoint(ctx interface{}) *MockInterface_GetTokenEndpoint_Call
- func (_e *MockInterface_Expecter) GetTokenResponse(ctx interface{}, clientId interface{}, code interface{}, ...) *MockInterface_GetTokenResponse_Call
- func (_e *MockInterface_Expecter) GetUserInfo(ctx interface{}, accessToken interface{}) *MockInterface_GetUserInfo_Call
- type MockInterface_GetAuthorizationEndpoint_Call
- func (_c *MockInterface_GetAuthorizationEndpoint_Call) Return(_a0 string, _a1 error) *MockInterface_GetAuthorizationEndpoint_Call
- func (_c *MockInterface_GetAuthorizationEndpoint_Call) Run(run func(ctx context.Context)) *MockInterface_GetAuthorizationEndpoint_Call
- func (_c *MockInterface_GetAuthorizationEndpoint_Call) RunAndReturn(run func(context.Context) (string, error)) *MockInterface_GetAuthorizationEndpoint_Call
- type MockInterface_GetRefreshedAccessToken_Call
- func (_c *MockInterface_GetRefreshedAccessToken_Call) Return(_a0 *AuthTokenResponse, _a1 error) *MockInterface_GetRefreshedAccessToken_Call
- func (_c *MockInterface_GetRefreshedAccessToken_Call) Run(run func(ctx context.Context, clientId string, refreshToken string)) *MockInterface_GetRefreshedAccessToken_Call
- func (_c *MockInterface_GetRefreshedAccessToken_Call) RunAndReturn(run func(context.Context, string, string) (*AuthTokenResponse, error)) *MockInterface_GetRefreshedAccessToken_Call
- type MockInterface_GetTokenEndpoint_Call
- func (_c *MockInterface_GetTokenEndpoint_Call) Return(_a0 string, _a1 error) *MockInterface_GetTokenEndpoint_Call
- func (_c *MockInterface_GetTokenEndpoint_Call) Run(run func(ctx context.Context)) *MockInterface_GetTokenEndpoint_Call
- func (_c *MockInterface_GetTokenEndpoint_Call) RunAndReturn(run func(context.Context) (string, error)) *MockInterface_GetTokenEndpoint_Call
- type MockInterface_GetTokenResponse_Call
- func (_c *MockInterface_GetTokenResponse_Call) Return(_a0 *AuthTokenResponse, _a1 error) *MockInterface_GetTokenResponse_Call
- func (_c *MockInterface_GetTokenResponse_Call) Run(...) *MockInterface_GetTokenResponse_Call
- func (_c *MockInterface_GetTokenResponse_Call) RunAndReturn(run func(context.Context, string, string, string) (*AuthTokenResponse, error)) *MockInterface_GetTokenResponse_Call
- type MockInterface_GetUserInfo_Call
- func (_c *MockInterface_GetUserInfo_Call) Return(_a0 *UserInfo, _a1 error) *MockInterface_GetUserInfo_Call
- func (_c *MockInterface_GetUserInfo_Call) Run(run func(ctx context.Context, accessToken string)) *MockInterface_GetUserInfo_Call
- func (_c *MockInterface_GetUserInfo_Call) RunAndReturn(run func(context.Context, string) (*UserInfo, error)) *MockInterface_GetUserInfo_Call
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthTokenErrorData ¶
type AuthTokenResponse ¶
type AuthTokenResponse struct { Result *AuthTokenResponseData Error *AuthTokenErrorData }
type AuthTokenResponseData ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetAuthorizationEndpoint ¶
func (*Client) GetRefreshedAccessToken ¶
func (*Client) GetTokenEndpoint ¶
func (*Client) GetTokenResponse ¶
func (c *Client) GetTokenResponse( ctx context.Context, clientId string, code string, redirecturi string, ) (*AuthTokenResponse, error)
Uses Authorization Flow defined here: https://auth0.com/docs/api/authentication#authorization-code-flow47
type Interface ¶
type Interface interface { GetTokenResponse(ctx context.Context, clientId string, code string, redirecturi string) (*AuthTokenResponse, error) GetRefreshedAccessToken(ctx context.Context, clientId string, refreshToken string) (*AuthTokenResponse, error) GetUserInfo(ctx context.Context, accessToken string) (*UserInfo, error) GetTokenEndpoint(ctx context.Context) (string, error) GetAuthorizationEndpoint(ctx context.Context) (string, error) }
type MockInterface ¶
MockInterface is an autogenerated mock type for the Interface type
func NewMockInterface ¶
func NewMockInterface(t interface { mock.TestingT Cleanup(func()) }) *MockInterface
NewMockInterface creates a new instance of MockInterface. 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 (*MockInterface) EXPECT ¶
func (_m *MockInterface) EXPECT() *MockInterface_Expecter
func (*MockInterface) GetAuthorizationEndpoint ¶
func (_m *MockInterface) GetAuthorizationEndpoint(ctx context.Context) (string, error)
GetAuthorizationEndpoint provides a mock function with given fields: ctx
func (*MockInterface) GetRefreshedAccessToken ¶
func (_m *MockInterface) GetRefreshedAccessToken(ctx context.Context, clientId string, refreshToken string) (*AuthTokenResponse, error)
GetRefreshedAccessToken provides a mock function with given fields: ctx, clientId, refreshToken
func (*MockInterface) GetTokenEndpoint ¶
func (_m *MockInterface) GetTokenEndpoint(ctx context.Context) (string, error)
GetTokenEndpoint provides a mock function with given fields: ctx
func (*MockInterface) GetTokenResponse ¶
func (_m *MockInterface) GetTokenResponse(ctx context.Context, clientId string, code string, redirecturi string) (*AuthTokenResponse, error)
GetTokenResponse provides a mock function with given fields: ctx, clientId, code, redirecturi
func (*MockInterface) GetUserInfo ¶
GetUserInfo provides a mock function with given fields: ctx, accessToken
type MockInterface_Expecter ¶
type MockInterface_Expecter struct {
// contains filtered or unexported fields
}
func (*MockInterface_Expecter) GetAuthorizationEndpoint ¶
func (_e *MockInterface_Expecter) GetAuthorizationEndpoint(ctx interface{}) *MockInterface_GetAuthorizationEndpoint_Call
GetAuthorizationEndpoint is a helper method to define mock.On call
- ctx context.Context
func (*MockInterface_Expecter) GetRefreshedAccessToken ¶
func (_e *MockInterface_Expecter) GetRefreshedAccessToken(ctx interface{}, clientId interface{}, refreshToken interface{}) *MockInterface_GetRefreshedAccessToken_Call
GetRefreshedAccessToken is a helper method to define mock.On call
- ctx context.Context
- clientId string
- refreshToken string
func (*MockInterface_Expecter) GetTokenEndpoint ¶
func (_e *MockInterface_Expecter) GetTokenEndpoint(ctx interface{}) *MockInterface_GetTokenEndpoint_Call
GetTokenEndpoint is a helper method to define mock.On call
- ctx context.Context
func (*MockInterface_Expecter) GetTokenResponse ¶
func (_e *MockInterface_Expecter) GetTokenResponse(ctx interface{}, clientId interface{}, code interface{}, redirecturi interface{}) *MockInterface_GetTokenResponse_Call
GetTokenResponse is a helper method to define mock.On call
- ctx context.Context
- clientId string
- code string
- redirecturi string
func (*MockInterface_Expecter) GetUserInfo ¶
func (_e *MockInterface_Expecter) GetUserInfo(ctx interface{}, accessToken interface{}) *MockInterface_GetUserInfo_Call
GetUserInfo is a helper method to define mock.On call
- ctx context.Context
- accessToken string
type MockInterface_GetAuthorizationEndpoint_Call ¶
MockInterface_GetAuthorizationEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAuthorizationEndpoint'
func (*MockInterface_GetAuthorizationEndpoint_Call) Return ¶
func (_c *MockInterface_GetAuthorizationEndpoint_Call) Return(_a0 string, _a1 error) *MockInterface_GetAuthorizationEndpoint_Call
func (*MockInterface_GetAuthorizationEndpoint_Call) Run ¶
func (_c *MockInterface_GetAuthorizationEndpoint_Call) Run(run func(ctx context.Context)) *MockInterface_GetAuthorizationEndpoint_Call
func (*MockInterface_GetAuthorizationEndpoint_Call) RunAndReturn ¶
func (_c *MockInterface_GetAuthorizationEndpoint_Call) RunAndReturn(run func(context.Context) (string, error)) *MockInterface_GetAuthorizationEndpoint_Call
type MockInterface_GetRefreshedAccessToken_Call ¶
MockInterface_GetRefreshedAccessToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRefreshedAccessToken'
func (*MockInterface_GetRefreshedAccessToken_Call) Return ¶
func (_c *MockInterface_GetRefreshedAccessToken_Call) Return(_a0 *AuthTokenResponse, _a1 error) *MockInterface_GetRefreshedAccessToken_Call
func (*MockInterface_GetRefreshedAccessToken_Call) Run ¶
func (_c *MockInterface_GetRefreshedAccessToken_Call) Run(run func(ctx context.Context, clientId string, refreshToken string)) *MockInterface_GetRefreshedAccessToken_Call
func (*MockInterface_GetRefreshedAccessToken_Call) RunAndReturn ¶
func (_c *MockInterface_GetRefreshedAccessToken_Call) RunAndReturn(run func(context.Context, string, string) (*AuthTokenResponse, error)) *MockInterface_GetRefreshedAccessToken_Call
type MockInterface_GetTokenEndpoint_Call ¶
MockInterface_GetTokenEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTokenEndpoint'
func (*MockInterface_GetTokenEndpoint_Call) Return ¶
func (_c *MockInterface_GetTokenEndpoint_Call) Return(_a0 string, _a1 error) *MockInterface_GetTokenEndpoint_Call
func (*MockInterface_GetTokenEndpoint_Call) Run ¶
func (_c *MockInterface_GetTokenEndpoint_Call) Run(run func(ctx context.Context)) *MockInterface_GetTokenEndpoint_Call
func (*MockInterface_GetTokenEndpoint_Call) RunAndReturn ¶
func (_c *MockInterface_GetTokenEndpoint_Call) RunAndReturn(run func(context.Context) (string, error)) *MockInterface_GetTokenEndpoint_Call
type MockInterface_GetTokenResponse_Call ¶
MockInterface_GetTokenResponse_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTokenResponse'
func (*MockInterface_GetTokenResponse_Call) Return ¶
func (_c *MockInterface_GetTokenResponse_Call) Return(_a0 *AuthTokenResponse, _a1 error) *MockInterface_GetTokenResponse_Call
func (*MockInterface_GetTokenResponse_Call) Run ¶
func (_c *MockInterface_GetTokenResponse_Call) Run(run func(ctx context.Context, clientId string, code string, redirecturi string)) *MockInterface_GetTokenResponse_Call
func (*MockInterface_GetTokenResponse_Call) RunAndReturn ¶
func (_c *MockInterface_GetTokenResponse_Call) RunAndReturn(run func(context.Context, string, string, string) (*AuthTokenResponse, error)) *MockInterface_GetTokenResponse_Call
type MockInterface_GetUserInfo_Call ¶
MockInterface_GetUserInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserInfo'
func (*MockInterface_GetUserInfo_Call) Return ¶
func (_c *MockInterface_GetUserInfo_Call) Return(_a0 *UserInfo, _a1 error) *MockInterface_GetUserInfo_Call
func (*MockInterface_GetUserInfo_Call) Run ¶
func (_c *MockInterface_GetUserInfo_Call) Run(run func(ctx context.Context, accessToken string)) *MockInterface_GetUserInfo_Call
func (*MockInterface_GetUserInfo_Call) RunAndReturn ¶
func (_c *MockInterface_GetUserInfo_Call) RunAndReturn(run func(context.Context, string) (*UserInfo, error)) *MockInterface_GetUserInfo_Call