auth

package
v0.0.0-...-a3cd39f Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2025 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Store       *sessions.CookieStore
	OAuthConfig *oauth2.Config
	Verifier    *oidc.IDTokenVerifier
	Provider    *oidc.Provider
	SessionName string
	DB          db.Querier
}

Config holds all auth-related configuration

func Setup

func Setup(database db.Querier) (*Config, error)

Setup initializes the auth configuration

func (*Config) CallbackHandler

func (c *Config) CallbackHandler(w http.ResponseWriter, r *http.Request)

CallbackHandler processes the OIDC callback

func (*Config) LoginHandler

func (c *Config) LoginHandler(w http.ResponseWriter, r *http.Request)

LoginHandler initiates the OIDC authentication flow

func (*Config) LogoutCallbackHandler

func (c *Config) LogoutCallbackHandler(w http.ResponseWriter, r *http.Request)

LogoutCallbackHandler handles the redirect after Keycloak logout

func (*Config) LogoutHandler

func (c *Config) LogoutHandler(w http.ResponseWriter, r *http.Request)

LogoutHandler handles user logout

func (*Config) Middleware

func (c *Config) Middleware() func(http.Handler) http.Handler

Middleware returns an auth middleware function

func (*Config) RegisterHandlers

func (c *Config) RegisterHandlers(mux *http.ServeMux)

RegisterHandlers adds all auth-related handlers to the router

func (*Config) RegistrationHandler

func (c *Config) RegistrationHandler(w http.ResponseWriter, r *http.Request)

RegistrationHandler redirects to the OIDC registration page

Jump to

Keyboard shortcuts

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