http

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRouter

func NewRouter(cfg ServerConfig, mw Middlewares) http.Handler

Types

type Middlewares

type Middlewares struct {
	RedirectIfAuthenticated func(http.Handler) http.Handler

	RequireAppAccessAuthWithRefresh   func(http.Handler) http.Handler
	RequireAppAccessAuthAPI           func(http.Handler) http.Handler
	RequireAdminAccessAuthWithRefresh func(http.Handler) http.Handler
	RequireAdminAccessAuthAPI         func(http.Handler) http.Handler
	RequireAdminRole                  func(http.Handler) http.Handler

	RequireCSRF    func(http.Handler) http.Handler
	RequireAPICSRF func(http.Handler) http.Handler

	ReturnTo                  func(http.Handler) http.Handler
	HTMX                      func(http.Handler) http.Handler
	RequireChallengeEnabled   func(http.Handler) http.Handler
	RequireAllowlistEnabled   func(http.Handler) http.Handler
	OptionalAppAccessIdentity func(http.Handler) http.Handler
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(cfg ServerConfig, mw Middlewares) *Server

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

func (*Server) Start

func (s *Server) Start() error

type ServerConfig

type ServerConfig struct {
	Version           string
	Addr              string
	Dev               bool
	TrustProxyHeaders bool
	Admin             *admin.Service
	Auth              *auth.Service
	Passkeys          *passkey.Service
	Session           *session.Service
	Challenge         *challenge.Service
	Features          features.Features
	Verification      *challenge.VerificationCodeService
	Logger            *slog.Logger
	Store             *store.Store
	AuthLimiter       ratelimiter.AuthLimiter
	Google            *google.Client
	OAuthProviders    oauth.OAuthProviders
	AccessTokenTTL    time.Duration
	RefreshTokenTTL   time.Duration
	Render            render.Renderer
}

Jump to

Keyboard shortcuts

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