config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: Apache-2.0 Imports: 16 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

View Source
const (
	OIDCDefaultTenantClaim    = "tenant_id"
	OIDCDefaultWorkspaceClaim = "workspace_id"
	OIDCDefaultGroupsClaim    = "groups"
	OIDCDefaultRolesClaim     = "roles"
)

Variables

This section is empty.

Functions

func SecurityWarnings

func SecurityWarnings(cfg Config) []string

SecurityWarnings returns non-fatal security posture warnings.

func StartupDiagnostics

func StartupDiagnostics(cfg Config) []string

StartupDiagnostics returns startup-safe key runtime mode summaries.

func ValidateSecurity

func ValidateSecurity(cfg Config) error

ValidateSecurity checks hard-fail security misconfigurations.

func ValidateSessionKeyMaterial added in v1.0.2

func ValidateSessionKeyMaterial(envName string, raw string) error

Types

type Config

type Config struct {
	HTTPAddr                      string
	LogLevel                      string
	Provider                      string
	ServiceName                   string
	BaselineGitSHA                string
	TrustedProxies                []string
	CORSAllowedOrigins            []string
	DatabaseURL                   string
	AllowMemoryStore              bool
	AWSSource                     string
	AWSRegion                     string
	AWSProfile                    string
	AWSCloudFormationTemplateURL  string
	AWSCloudFormationTemplateSHA  string
	AWSAccountID                  string
	AWSCloudTrailS3Bucket         string
	AWSCloudTrailS3Prefix         string
	AWSCloudTrailEventBridgeQueue string
	AWSConnectorCapabilities      []string
	AWSFixturePath                []string
	KubernetesFixturePath         []string
	KubernetesSource              string
	KubectlPath                   string
	KubeContext                   string
	RequireLiveSources            bool

	ScanInterval        time.Duration
	WorkerRunNow        bool
	APIKeys             []string
	WriteAPIKeys        []string
	APIKeyScopes        map[string][]string
	APIKeyScopeBindings map[string]db.Scope

	RateLimitRPM                  int
	RateLimitBurst                int
	RunMigrations                 bool
	RunMigrationsOnly             bool
	MigrationsDir                 string
	PostgresRLSEnforced           bool
	AuditLogFile                  string
	AuditForwardURL               string
	AuditForwardTimeout           time.Duration
	AuditForwardMaxRetries        int
	AuditForwardRetryBackoff      time.Duration
	AuditForwardHMACSecret        string
	AuditFingerprintSecret        string
	ConnectorSecretKeys           string
	ConnectorSecretKeysRequired   bool
	AlertWebhookURL               string
	AlertMinSeverity              string
	AlertTimeout                  time.Duration
	AlertHMACSecret               string
	AlertMaxFindings              int
	AlertMaxRetries               int
	AlertRetryBackoff             time.Duration
	RepoScanEnabled               bool
	RepoScanHistoryLimit          int
	RepoScanMaxFindings           int
	RepoScanHistoryLimitMax       int
	RepoScanMaxFindingsMax        int
	RepoScanAllowlist             []string
	ScanQueueMaxPending           int
	RepoQueueMaxPending           int
	WorkerScanEnabled             bool
	WorkerRepoScanEnabled         bool
	WorkerRepoScanRunNow          bool
	WorkerRepoScanInterval        time.Duration
	WorkerRepoScanTargets         []string
	WorkerRepoScanHistory         int
	WorkerRepoScanFindings        int
	WorkerScanPolicyEnabled       bool
	WorkerScanPolicyInterval      time.Duration
	WorkerAPIJobQueueEnabled      bool
	WorkerAPIJobQueueInterval     time.Duration
	WorkerAPIJobQueueBatchSize    int
	WorkerUserPurgeEnabled        bool
	WorkerUserPurgeInterval       time.Duration
	WorkerUserPurgeBatchSize      int
	WorkerWorkspacePurgeEnabled   bool
	WorkerWorkspacePurgeInterval  time.Duration
	WorkerWorkspacePurgeBatchSize int
	LockBackend                   string
	LockNamespace                 string
	DefaultTenantID               string
	DefaultWorkspaceID            string
	RequireExplicitScope          bool
	OIDCIssuerURL                 string
	OIDCAudience                  string
	OIDCWriteScopes               []string
	OIDCTenantClaim               string
	OIDCWorkspaceClaim            string
	OIDCGroupsClaim               string
	OIDCRolesClaim                string
	FeatureNewAuth                bool
	FeatureWorkOSLogin            bool
	FeatureConnectorAWS           bool
	FeatureConnectorGitHubV2      bool
	FeatureConnectorK8S           bool
	FeatureOnboardingWizard       bool
	FeatureNativeSSO              bool
	GitHubAppID                   string
	GitHubAppName                 string
	GitHubAppPrivateKey           string
	GitHubAppWebhookSecret        string
	GitHubAppOAuthClientID        string
	GitHubAppOAuthClientSecret    string
	GitHubPATAllowedBaseURLs      []string
	PublicBaseURL                 string
	SessionKey                    string
	SessionKeyPrevious            string
	AuthManualMode                bool
	AuthManualModeAllowUnsafe     bool
	AuthRequireSocialMFA          bool
	WorkOSClientID                string
	WorkOSAPIKey                  string
	WorkOSWebhookSecret           string
	WorkOSEnvironmentID           string
	EmailProvider                 string
	EmailAPIKey                   string
	EmailFromAddress              string
	EmailReplyToAddress           string
	EmailAppBaseURL               string
	EmailTimeout                  time.Duration
	AppModeEnabled                bool
	AppModeConnectorsEnabled      bool
	AppModeSchedulerEnabled       bool
	AppModeRemediationEnabled     bool
	AppModePremiumEnabled         bool
	AppModePremiumReports         bool
	AppModePremiumAutofix         bool
	AppModeRolloutEnabled         bool
	AppModeRolloutCanary          int
	AppModeTenantAllowlist        []string
	AppModeWorkspaceAllowlist     []string
	WorkerHeartbeatPath           string
	// UserDataExportPath is the on-disk base directory for self-serve
	// "Download my data" bundles (#1421). Empty disables the local-disk
	// backend so dev deployments without a configured path are obvious rather
	// than silently writing to /tmp.
	UserDataExportPath     string
	UserDataExportS3Bucket string
	UserDataExportS3Prefix string
	UserDataExportS3Region string
	// WorkerUserExportGCEnabled controls whether the worker runs the
	// retention-window GC pass for completed export bundles.
	WorkerUserExportGCEnabled bool
	// WorkerUserExportGCInterval is the cadence for the export bundle GC
	// pass. Defaults to one hour so the 7-day retention window is enforced
	// within a small window of slop.
	WorkerUserExportGCInterval time.Duration
	// contains filtered or unexported fields
}

Config centralizes process-level configuration. It keeps module wiring simple and deterministic for API, worker, and CLI binaries.

func Load

func Load() Config

Load reads environment variables and applies safe defaults for local and CI use.

Jump to

Keyboard shortcuts

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