deps

package
v1.10.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultServices

type DefaultServices struct{}

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() *DefaultServices

NewDefaultServices constructs the default Services implementation for non-hydra builds. All hydra-related handlers return 404 stubs.

func (DefaultServices) BeginRegistration

func (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (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 (DefaultServices) NotifyGETHandler() gin.HandlerFunc

NotifyGETHandler returns a handler function that delegates to the core.NotifyGETHandler for processing GET requests.

func (DefaultServices) Register2FAHomeHandler

func (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 (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 (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
	Logger *slog.Logger
	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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL