config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 8 Imported by: 0

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
}

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 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