config

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeTrustedOriginForCSRF added in v0.3.0

func NormalizeTrustedOriginForCSRF(raw string) (string, error)

NormalizeTrustedOriginForCSRF canonicalizes a configured/request origin for CSRF checks.

Types

type AuthConfig

type AuthConfig struct {
	Mode AuthMode
	OIDC OIDCConfig
	CSRF CSRFConfig
}

type AuthMode

type AuthMode string
const (
	AuthModeDisabled AuthMode = "disabled"
	AuthModeOIDC     AuthMode = "oidc"
)

type CSRFConfig added in v0.3.0

type CSRFConfig struct {
	TrustedOrigins []string
}

type Config

type Config struct {
	Server        ServerConfig
	Auth          AuthConfig
	Security      SecurityConfig
	GitHub        GitHubConfig
	Database      DatabaseConfig
	Orchestrator  OrchestratorConfig
	Event         EventConfig
	Observability ObservabilityConfig
	Logging       LoggingConfig
	Metadata      Metadata
}

func Load

func Load(opts LoadOptions) (Config, error)

func (Config) ResolvedEventDriver

func (cfg Config) ResolvedEventDriver() (EventDriver, error)

func (Config) ResolvedSecurityCipherSeed added in v0.4.0

func (cfg Config) ResolvedSecurityCipherSeed() string

type DatabaseConfig

type DatabaseConfig struct {
	DSN string
}

type EventConfig

type EventConfig struct {
	Driver EventDriver
}

type EventDriver

type EventDriver string
const (
	EventDriverAuto     EventDriver = "auto"
	EventDriverChannel  EventDriver = "channel"
	EventDriverPGNotify EventDriver = "pgnotify"
)

type GitHubConfig

type GitHubConfig struct {
	WebhookSecret string
}

type LoadOptions

type LoadOptions struct {
	ConfigFile string
	Overrides  map[string]any
}

type LogFormat

type LogFormat string
const (
	LogFormatText LogFormat = "text"
	LogFormatJSON LogFormat = "json"
)

type LoggingConfig

type LoggingConfig struct {
	Level  slog.Level
	Format LogFormat
}

type Metadata

type Metadata struct {
	ConfigFile string
}

type MetricsConfig

type MetricsConfig struct {
	Enabled bool
	Export  MetricsExportConfig
}

type MetricsExportConfig

type MetricsExportConfig struct {
	Prometheus   bool
	OTLPEndpoint string
}

type OIDCConfig

type OIDCConfig struct {
	IssuerURL            string
	ClientID             string
	ClientSecret         string
	RedirectURL          string
	Scopes               []string
	EmailClaim           string
	NameClaim            string
	UsernameClaim        string
	GroupsClaim          string
	AllowedEmailDomains  []string
	BootstrapAdminEmails []string
	SessionTTL           time.Duration
	SessionIdleTTL       time.Duration
}

type ObservabilityConfig

type ObservabilityConfig struct {
	Metrics MetricsConfig
	Tracing TraceConfig
}

type OrchestratorConfig

type OrchestratorConfig struct {
	TickInterval             time.Duration
	WorkspacePrepareTimeout  time.Duration
	AgentSessionStartTimeout time.Duration
}

type SecurityConfig added in v0.4.0

type SecurityConfig struct {
	CipherSeed string
}

type ServerConfig

type ServerConfig struct {
	Mode            ServerMode
	Host            string
	Port            int
	ReadTimeout     time.Duration
	WriteTimeout    time.Duration
	ShutdownTimeout time.Duration
}

type ServerMode

type ServerMode string
const (
	ServerModeAllInOne    ServerMode = "all-in-one"
	ServerModeServe       ServerMode = "serve"
	ServerModeOrchestrate ServerMode = "orchestrate"
)

type TraceConfig

type TraceConfig struct {
	Enabled     bool
	Endpoint    string
	ServiceName string
	SampleRatio float64
}

Jump to

Keyboard shortcuts

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