config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 11 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 {
	Mode   string       `yaml:"mode"`
	Trust  TrustConfig  `yaml:"trust"`
	Verify VerifyConfig `yaml:"verify"`
	Custom CustomConfig `yaml:"custom"`
}

type ClaimsConfig

type ClaimsConfig struct {
	UserID string `yaml:"user_id"`
	Roles  string `yaml:"roles"`
}

type Config

type Config struct {
	Server   ServerConfig   `yaml:"server"`
	Database DatabaseConfig `yaml:"database"`
	Auth     AuthConfig     `yaml:"auth"`
	Webhook  WebhookConfig  `yaml:"webhook"`
	Expiry   ExpiryConfig   `yaml:"expiry"`
	Tenant   TenantConfig   `yaml:"tenant"`
	Metrics  MetricsConfig  `yaml:"metrics"`
	Console  ConsoleConfig  `yaml:"console"`
}

func Load

func Load(path string) (*Config, error)

type ConsoleConfig

type ConsoleConfig struct {
	Enabled       bool              `yaml:"enabled"`
	JWTSecret     string            `yaml:"jwt_secret"`
	SecureCookies bool              `yaml:"secure_cookies"`
	Suggestions   SuggestionsConfig `yaml:"suggestions"`
}

type CustomConfig

type CustomConfig struct {
	Endpoint string        `yaml:"endpoint"`
	Timeout  time.Duration `yaml:"timeout"`
}

type DatabaseConfig

type DatabaseConfig struct {
	Driver       string            `yaml:"driver"`
	Host         string            `yaml:"host"`
	Port         int               `yaml:"port"`
	User         string            `yaml:"user"`
	Password     string            `yaml:"password"`
	Name         string            `yaml:"name"`
	Params       map[string]string `yaml:"params"`
	MaxOpenConns int               `yaml:"max_open_conns"`
	MaxIdleConns int               `yaml:"max_idle_conns"`
}

func (DatabaseConfig) DSN

func (d DatabaseConfig) DSN() string

type ExpiryConfig

type ExpiryConfig struct {
	CheckInterval time.Duration `yaml:"check_interval"`
}

type MetricsConfig

type MetricsConfig struct {
	Enabled bool   `yaml:"enabled"`
	Path    string `yaml:"path"`
}

type ServerConfig

type ServerConfig struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
}

func (ServerConfig) Addr

func (s ServerConfig) Addr() string

type SuggestionsConfig added in v0.1.2

type SuggestionsConfig struct {
	RolesURL       string `yaml:"roles_url"`
	PermissionsURL string `yaml:"permissions_url"`
	AuthHeader     string `yaml:"auth_header"`
	AuthValue      string `yaml:"auth_value"`
}

type TenantConfig

type TenantConfig struct {
	CacheRefreshInterval time.Duration `yaml:"cache_refresh_interval"`
}

type TrustConfig

type TrustConfig struct {
	UserIDHeader      string `yaml:"user_id_header"`
	RolesHeader       string `yaml:"roles_header"`
	PermissionsHeader string `yaml:"permissions_header"`
	TenantIDHeader    string `yaml:"tenant_id_header"`
}

type VerifyConfig

type VerifyConfig struct {
	JWKSURL  string       `yaml:"jwks_url"`
	Issuer   string       `yaml:"issuer"`
	Audience string       `yaml:"audience"`
	Claims   ClaimsConfig `yaml:"claims"`
}

type WebhookConfig

type WebhookConfig struct {
	MaxRetries      int           `yaml:"max_retries"`
	RetryInterval   time.Duration `yaml:"retry_interval"`
	RetryWindow     time.Duration `yaml:"retry_window"`
	MaxRetryDelay   time.Duration `yaml:"max_retry_delay"`
	Timeout         time.Duration `yaml:"timeout"`
	Heartbeat       time.Duration `yaml:"heartbeat"`
	OutboxRetention time.Duration `yaml:"outbox_retention"`
	BlockPrivateIPs bool          `yaml:"block_private_ips"`
}

Jump to

Keyboard shortcuts

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