Documentation ¶
Overview ¶
Package loginapi provides an HTTP API for user authentication.
Index ¶
- func NewService(options ...ConfigOption) auth.LoginAPI
- func SetupHTTPHandler(svc auth.LoginAPI, router *mux.Router, tokenSvc auth.TokenService, ...)
- type ConfigOption
- func WithLogger(l log.Logger) ConfigOption
- func WithMessaging(m auth.MessagingService) ConfigOption
- func WithOTP(o auth.OTPService) ConfigOption
- func WithPassword(p auth.PasswordService) ConfigOption
- func WithRepoManager(repoMngr auth.RepositoryManager) ConfigOption
- func WithTokenService(tokenSvc auth.TokenService) ConfigOption
- func WithWebAuthn(w auth.WebAuthnService) ConfigOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewService ¶
func NewService(options ...ConfigOption) auth.LoginAPI
NewService returns a new implementation of auth.LoginAPI.
func SetupHTTPHandler ¶
func SetupHTTPHandler(svc auth.LoginAPI, router *mux.Router, tokenSvc auth.TokenService, logger log.Logger)
SetupHTTPHandler converts a service's public methods to http handlers.
Types ¶
type ConfigOption ¶
type ConfigOption func(*service)
ConfigOption configures the service.
func WithLogger ¶
func WithLogger(l log.Logger) ConfigOption
WithLogger configures the service with a logger.
func WithMessaging ¶
func WithMessaging(m auth.MessagingService) ConfigOption
WithMessaging configures the service with a MessagingService.
func WithOTP ¶
func WithOTP(o auth.OTPService) ConfigOption
WithOTP configures the service with an OTP validator.
func WithPassword ¶
func WithPassword(p auth.PasswordService) ConfigOption
WithPassword configures the servicewith a PasswordService.
func WithRepoManager ¶
func WithRepoManager(repoMngr auth.RepositoryManager) ConfigOption
WithRepoManager configures the service with a new RepositoryManager.
func WithTokenService ¶
func WithTokenService(tokenSvc auth.TokenService) ConfigOption
WithTokenService configures the service with a new TokenService.
func WithWebAuthn ¶
func WithWebAuthn(w auth.WebAuthnService) ConfigOption
WithWebAuthn configures the service with a WebAuthn library.
Click to show internal directories.
Click to hide internal directories.