config

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	PublicBaseURL      string
	JWTIssuer          string
	JWTAudience        string
	JWTHMACSecret      string
	AccessTokenTTL     time.Duration
	RefreshIdleTTL     time.Duration
	RefreshAbsoluteTTL time.Duration
	DeviceCodeTTL      time.Duration
	DevicePollInterval time.Duration
	RateLimit          AuthRateLimitConfig
}

type AuthRateLimitConfig

type AuthRateLimitConfig struct {
	DeviceCodeCreate    AuthRateLimitRule
	DeviceTokenExchange AuthRateLimitRule
	DeviceDecision      AuthRateLimitRule
	RefreshToken        AuthRateLimitRule
	Logout              AuthRateLimitRule
}

type AuthRateLimitRule

type AuthRateLimitRule struct {
	Limit  int64
	Window time.Duration
}

type AuthorizationConfig

type AuthorizationConfig struct{ AdminGroups []string }

type Config

type Config struct {
	Server        ServerConfig
	Database      DatabaseConfig
	LogLevel      LogLevel
	Auth          AuthConfig
	TrustedProxy  TrustedProxyConfig
	Authorization AuthorizationConfig
	RADIUSMAB     RADIUSMABConfig
}

func Load

func Load() (Config, error)

func (Config) Validate

func (c Config) Validate() error

type DatabaseConfig

type DatabaseConfig struct{ URL string }

type LogLevel

type LogLevel string
const (
	LogLevelDebug LogLevel = "debug"
	LogLevelInfo  LogLevel = "info"
	LogLevelWarn  LogLevel = "warn"
	LogLevelError LogLevel = "error"
)

func (LogLevel) Leveler

func (l LogLevel) Leveler() slog.Leveler

func (LogLevel) String

func (l LogLevel) String() string

type RADIUSMABConfig added in v0.4.7

type RADIUSMABConfig struct{ TokenHashes []RADIUSMABTokenHash }

type RADIUSMABTokenHash added in v0.4.7

type RADIUSMABTokenHash struct {
	Site   string
	SHA256 [sha256.Size]byte
}

type ServerConfig

type ServerConfig struct{ Addr string }

type TrustedProxyConfig

type TrustedProxyConfig struct {
	CIDRs        []netip.Prefix
	UserHeader   string
	NameHeader   string
	EmailHeader  string
	GroupsHeader string
	MarkerHeader string
	MarkerValue  string
}

Jump to

Keyboard shortcuts

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