Documentation
¶
Index ¶
- type DefaultServices
- func (s *DefaultServices) BeginRegistration() gin.HandlerFunc
- func (s *DefaultServices) ConsentGETHandler() gin.HandlerFunc
- func (s *DefaultServices) ConsentPOSTHandler() gin.HandlerFunc
- func (s *DefaultServices) DeviceGETHandler() gin.HandlerFunc
- func (s *DefaultServices) DevicePOSTHandler() gin.HandlerFunc
- func (s *DefaultServices) FinishRegistration() gin.HandlerFunc
- func (s *DefaultServices) LoginGET2FAHandler() gin.HandlerFunc
- func (s *DefaultServices) LoginGETHandler() gin.HandlerFunc
- func (s *DefaultServices) LoginPOST2FAHandler() gin.HandlerFunc
- func (s *DefaultServices) LoginPOSTHandler() gin.HandlerFunc
- func (s *DefaultServices) LogoutGETHandler() gin.HandlerFunc
- func (s *DefaultServices) LogoutPOSTHandler() gin.HandlerFunc
- func (s *DefaultServices) NotifyGETHandler() gin.HandlerFunc
- func (s *DefaultServices) Register2FAHomeHandler() gin.HandlerFunc
- func (s *DefaultServices) RegisterTotpGETHandler() gin.HandlerFunc
- func (s *DefaultServices) RegisterTotpPOSTHandler() gin.HandlerFunc
- type Deps
- type Services
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultServices ¶
type DefaultServices struct {
// contains filtered or unexported fields
}
DefaultServices is the default implementation that delegates to core package handlers. In non-hydra builds, hydra-related handlers are stubbed with 404 responses.
func NewDefaultServices ¶
func NewDefaultServices(deps *Deps) *DefaultServices
NewDefaultServices constructs the default Services implementation for non-hydra builds. All hydra-related handlers return 404 stubs.
func (*DefaultServices) BeginRegistration ¶
func (s *DefaultServices) BeginRegistration() gin.HandlerFunc
BeginRegistration returns a handler function that responds with a 404 status, indicating the registration endpoint is disabled.
func (*DefaultServices) ConsentGETHandler ¶
func (s *DefaultServices) ConsentGETHandler() gin.HandlerFunc
ConsentGETHandler returns a handler function that responds with a 404 status, indicating the consent endpoint is disabled.
func (*DefaultServices) ConsentPOSTHandler ¶
func (s *DefaultServices) ConsentPOSTHandler() gin.HandlerFunc
ConsentPOSTHandler returns a handler function that responds with a 404 status, indicating the consent endpoint is disabled.
func (*DefaultServices) DeviceGETHandler ¶
func (s *DefaultServices) DeviceGETHandler() gin.HandlerFunc
DeviceGETHandler returns a handler function that responds with a 404 status, indicating the device endpoint is disabled.
func (*DefaultServices) DevicePOSTHandler ¶
func (s *DefaultServices) DevicePOSTHandler() gin.HandlerFunc
DevicePOSTHandler returns a handler function that responds with a 404 status, indicating the device endpoint is disabled.
func (*DefaultServices) FinishRegistration ¶
func (s *DefaultServices) FinishRegistration() gin.HandlerFunc
FinishRegistration returns a handler function that responds with a 404 status, indicating the registration endpoint is disabled.
func (*DefaultServices) LoginGET2FAHandler ¶
func (s *DefaultServices) LoginGET2FAHandler() gin.HandlerFunc
LoginGET2FAHandler returns a handler function that responds with a 404 status, indicating the 2FA login endpoint is disabled.
func (*DefaultServices) LoginGETHandler ¶
func (s *DefaultServices) LoginGETHandler() gin.HandlerFunc
LoginGETHandler returns a handler function that responds with a 404 status, indicating the login endpoint is disabled.
func (*DefaultServices) LoginPOST2FAHandler ¶
func (s *DefaultServices) LoginPOST2FAHandler() gin.HandlerFunc
LoginPOST2FAHandler returns a handler function that responds with a 404 status, indicating the 2FA POST login endpoint is disabled.
func (*DefaultServices) LoginPOSTHandler ¶
func (s *DefaultServices) LoginPOSTHandler() gin.HandlerFunc
LoginPOSTHandler returns a handler function that responds with a 404 status, indicating the login endpoint is disabled.
func (*DefaultServices) LogoutGETHandler ¶
func (s *DefaultServices) LogoutGETHandler() gin.HandlerFunc
LogoutGETHandler returns a handler function that responds with a 404 status, indicating the logout endpoint is disabled.
func (*DefaultServices) LogoutPOSTHandler ¶
func (s *DefaultServices) LogoutPOSTHandler() gin.HandlerFunc
LogoutPOSTHandler returns a handler function that responds with a 404 status, indicating the logout endpoint is disabled.
func (*DefaultServices) NotifyGETHandler ¶
func (s *DefaultServices) NotifyGETHandler() gin.HandlerFunc
NotifyGETHandler returns a handler function that delegates to the core.NotifyGETHandler for processing GET requests.
func (*DefaultServices) Register2FAHomeHandler ¶
func (s *DefaultServices) Register2FAHomeHandler() gin.HandlerFunc
Register2FAHomeHandler returns a handler function that responds with a 404 status, indicating the 2FA home endpoint is disabled.
func (*DefaultServices) RegisterTotpGETHandler ¶
func (s *DefaultServices) RegisterTotpGETHandler() gin.HandlerFunc
RegisterTotpGETHandler returns a handler function that responds with a 404 status, indicating the TOTP endpoint is disabled.
func (*DefaultServices) RegisterTotpPOSTHandler ¶
func (s *DefaultServices) RegisterTotpPOSTHandler() gin.HandlerFunc
RegisterTotpPOSTHandler returns a handler function that responds with a 404 status, indicating the TOTP POST endpoint is disabled.
type Deps ¶
type Deps struct {
Cfg config.File
CfgProvider configfx.Provider
Env config.Environment
Logger *slog.Logger
Redis rediscli.Client
AccountCache *accountcache.Manager
Channel backend.Channel
Svc Services
}
Deps aggregates top-level dependencies to be injected into handler modules. Keep it minimal initially to avoid large refactors while enabling future DI.
type Services ¶
type Services interface {
// LoginGETHandler returns a gin.HandlerFunc to handle GET requests for the login endpoint and display the login page.
LoginGETHandler() gin.HandlerFunc
// LoginPOSTHandler processes POST requests for user login, including authentication and session management logic.
LoginPOSTHandler() gin.HandlerFunc
// DeviceGETHandler returns a gin.HandlerFunc to handle GET requests for device-based login or authentication workflows.
DeviceGETHandler() gin.HandlerFunc
// DevicePOSTHandler processes POST requests for device-based login or authentication, handling validation and security logic.
DevicePOSTHandler() gin.HandlerFunc
// ConsentGETHandler returns a gin.HandlerFunc to handle GET requests for user consent, rendering the consent page or details.
ConsentGETHandler() gin.HandlerFunc
// ConsentPOSTHandler handles POST requests for the consent endpoint, managing user consent submissions in ongoing sessions.
ConsentPOSTHandler() gin.HandlerFunc
// LogoutGETHandler handles GET requests for user logout functionality, orchestrating necessary session termination processes.
LogoutGETHandler() gin.HandlerFunc
// LogoutPOSTHandler handles POST requests for user logout by terminating the active session and cleaning up related resources.
LogoutPOSTHandler() gin.HandlerFunc
// NotifyGETHandler provides a handler function for the Notify GET endpoint, commonly used for serving notifications.
NotifyGETHandler() gin.HandlerFunc
// LoginGET2FAHandler handles GET requests for initiating the two-factor authentication (2FA) login process.
LoginGET2FAHandler() gin.HandlerFunc
// LoginPOST2FAHandler handles the POST requests for Two-Factor Authentication during the login process.
LoginPOST2FAHandler() gin.HandlerFunc
// Register2FAHomeHandler handles the registration process for two-factor authentication home setup.
Register2FAHomeHandler() gin.HandlerFunc
// RegisterTotpGETHandler returns a gin.HandlerFunc for handling GET requests to initiate TOTP registration.
RegisterTotpGETHandler() gin.HandlerFunc
// RegisterTotpPOSTHandler handles HTTP POST requests for registering a TOTP device and returns a gin.HandlerFunc.
RegisterTotpPOSTHandler() gin.HandlerFunc
// BeginRegistration initializes the user registration process and returns a gin.HandlerFunc to handle the request.
BeginRegistration() gin.HandlerFunc
// FinishRegistration finalizes the registration process after the initial setup, validating and storing user details.
FinishRegistration() gin.HandlerFunc
}
Services defines the transport-agnostic business endpoints that HTTP handlers depend on. Each method returns a gin.HandlerFunc to keep registration code unchanged while allowing a clean DI seam.