Documentation
¶
Overview ¶
Package auth is a generated GoMock package.
Index ¶
- Constants
- type AuthRouter
- type MockProvider
- func (m *MockProvider) AuthCodeURL(state string) (string, error)
- func (m *MockProvider) AuthURL() string
- func (m *MockProvider) Authorization(ctx context.Context, token *oauth2.Token) (bool, string, map[string]any, error)
- func (m *MockProvider) EXPECT() *MockProviderMockRecorder
- func (m *MockProvider) Exchange(c *gin.Context, state string) (*oauth2.Token, error)
- func (m *MockProvider) Name() string
- func (m *MockProvider) RedirectURL() string
- func (m *MockProvider) Type() string
- type MockProviderMockRecorder
- func (mr *MockProviderMockRecorder) AuthCodeURL(state any) *gomock.Call
- func (mr *MockProviderMockRecorder) AuthURL() *gomock.Call
- func (mr *MockProviderMockRecorder) Authorization(ctx, token any) *gomock.Call
- func (mr *MockProviderMockRecorder) Exchange(c, state any) *gomock.Call
- func (mr *MockProviderMockRecorder) Name() *gomock.Call
- func (mr *MockProviderMockRecorder) RedirectURL() *gomock.Call
- func (mr *MockProviderMockRecorder) Type() *gomock.Call
- type Provider
- func NewGithubProvider(oauthEndpoint, apiURL, clientID, clientSecret, externalURL string, ...) (Provider, error)
- func NewGoogleProvider(externalURL, clientID, clientSecret string, allowedUsers []string, ...) (Provider, error)
- func NewOIDCProvider(configurationURL string, scopes []string, userIDField string, ...) (Provider, error)
Constants ¶
const ( LoginEndpoint = "/.auth/login" LogoutEndpoint = "/.auth/logout" GoogleAuthEndpoint = "/.auth/google" GoogleCallbackEndpoint = "/.auth/google/callback" GitHubAuthEndpoint = "/.auth/github" GitHubCallbackEndpoint = "/.auth/github/callback" OIDCAuthEndpoint = "/.auth/oidc" OIDCCallbackEndpoint = "/.auth/oidc/callback" PasswordProvider = "password" PasswordUserID = "password_user" SessionKeyAuthorized = "authorized" SessionKeyRedirectURL = "redirect_url" SessionKeyOAuthState = "oauth_state" SessionKeyUserID = "user_id" SessionKeyUserInfo = "user_info" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthRouter ¶
type AuthRouter struct {
// contains filtered or unexported fields
}
func NewAuthRouter ¶
func (*AuthRouter) RequireAuth ¶
func (a *AuthRouter) RequireAuth() gin.HandlerFunc
func (*AuthRouter) SetupRoutes ¶
func (a *AuthRouter) SetupRoutes(router gin.IRouter)
type MockProvider ¶
type MockProvider struct {
// contains filtered or unexported fields
}
MockProvider is a mock of Provider interface.
func NewMockProvider ¶
func NewMockProvider(ctrl *gomock.Controller) *MockProvider
NewMockProvider creates a new mock instance.
func (*MockProvider) AuthCodeURL ¶
func (m *MockProvider) AuthCodeURL(state string) (string, error)
AuthCodeURL mocks base method.
func (*MockProvider) Authorization ¶
func (m *MockProvider) Authorization(ctx context.Context, token *oauth2.Token) (bool, string, map[string]any, error)
Authorization mocks base method.
func (*MockProvider) EXPECT ¶
func (m *MockProvider) EXPECT() *MockProviderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockProvider) RedirectURL ¶
func (m *MockProvider) RedirectURL() string
RedirectURL mocks base method.
type MockProviderMockRecorder ¶
type MockProviderMockRecorder struct {
// contains filtered or unexported fields
}
MockProviderMockRecorder is the mock recorder for MockProvider.
func (*MockProviderMockRecorder) AuthCodeURL ¶
func (mr *MockProviderMockRecorder) AuthCodeURL(state any) *gomock.Call
AuthCodeURL indicates an expected call of AuthCodeURL.
func (*MockProviderMockRecorder) AuthURL ¶
func (mr *MockProviderMockRecorder) AuthURL() *gomock.Call
AuthURL indicates an expected call of AuthURL.
func (*MockProviderMockRecorder) Authorization ¶
func (mr *MockProviderMockRecorder) Authorization(ctx, token any) *gomock.Call
Authorization indicates an expected call of Authorization.
func (*MockProviderMockRecorder) Exchange ¶
func (mr *MockProviderMockRecorder) Exchange(c, state any) *gomock.Call
Exchange indicates an expected call of Exchange.
func (*MockProviderMockRecorder) Name ¶
func (mr *MockProviderMockRecorder) Name() *gomock.Call
Name indicates an expected call of Name.
func (*MockProviderMockRecorder) RedirectURL ¶
func (mr *MockProviderMockRecorder) RedirectURL() *gomock.Call
RedirectURL indicates an expected call of RedirectURL.
func (*MockProviderMockRecorder) Type ¶
func (mr *MockProviderMockRecorder) Type() *gomock.Call
Type indicates an expected call of Type.
type Provider ¶
type Provider interface {
Name() string
Type() string
RedirectURL() string
AuthURL() string
AuthCodeURL(state string) (string, error)
Exchange(c *gin.Context, state string) (*oauth2.Token, error)
Authorization(ctx context.Context, token *oauth2.Token) (bool, string, map[string]any, error)
}