Documentation
¶
Overview ¶
Package config provides application configuration loaded from environment variables.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// General
DebugEnabled bool
BasePath string
// GitHub App
GitHubOrg string
GitHubAppID int64
GitHubAppPrivateKey []byte
GitHubInstallationID int64
GitHubWebhookSecret string
GitHubBaseURL string
// PR Compliance
PRComplianceEnabled bool
PRMonitoredBranches []string
// Okta
OktaDomain string
OktaClientID string
OktaPrivateKey []byte
OktaPrivateKeyID string
OktaScopes []string
OktaBaseURL string
OktaGitHubUserField string
OktaSyncRules []types.SyncRule
OktaSyncSafetyThreshold float64
OktaOrphanedUserNotifications bool
// Slack
SlackEnabled bool
SlackToken string
SlackChannel string
SlackChannelPRBypass string
SlackChannelOktaSync string
SlackChannelOrphanedUsers string
SlackAPIURL string
}
Config holds all application configuration loaded from environment variables.
func NewConfig ¶
NewConfig loads configuration from environment variables. returns error if required values are missing or invalid. supports SSM parameter references in format: arn:aws:ssm:REGION:ACCOUNT:parameter/path/to/param
func NewConfigWithContext ¶
NewConfigWithContext loads configuration from environment variables with the given context. supports SSM parameter resolution with automatic decryption.
func (*Config) IsGitHubConfigured ¶
IsGitHubConfigured returns true if GitHub App credentials are configured.
func (*Config) IsOktaSyncEnabled ¶
IsOktaSyncEnabled returns true if Okta sync is fully configured.
func (*Config) IsPRComplianceEnabled ¶
IsPRComplianceEnabled returns true if PR compliance checking is enabled.
func (*Config) Redacted ¶
func (c *Config) Redacted() RedactedConfig
Redacted returns a copy of the config with secrets redacted.
func (*Config) ShouldMonitorBranch ¶
ShouldMonitorBranch returns true if the given branch should be monitored for PR compliance.
type RedactedConfig ¶
type RedactedConfig struct {
// General
DebugEnabled bool `json:"debug_enabled"`
BasePath string `json:"base_path"`
// GitHub App
GitHubOrg string `json:"github_org"`
GitHubAppID int64 `json:"github_app_id"`
GitHubAppPrivateKey string `json:"github_app_private_key"`
GitHubInstallationID int64 `json:"github_installation_id"`
GitHubWebhookSecret string `json:"github_webhook_secret"`
GitHubBaseURL string `json:"github_base_url"`
// PR Compliance
PRComplianceEnabled bool `json:"pr_compliance_enabled"`
PRMonitoredBranches []string `json:"pr_monitored_branches"`
// Okta
OktaDomain string `json:"okta_domain"`
OktaClientID string `json:"okta_client_id"`
OktaPrivateKey string `json:"okta_private_key"`
OktaPrivateKeyID string `json:"okta_private_key_id"`
OktaScopes []string `json:"okta_scopes"`
OktaBaseURL string `json:"okta_base_url"`
OktaGitHubUserField string `json:"okta_github_user_field"`
OktaSyncRules []types.SyncRule `json:"okta_sync_rules"`
OktaSyncSafetyThreshold float64 `json:"okta_sync_safety_threshold"`
OktaOrphanedUserNotifications bool `json:"okta_orphaned_user_notifications"`
// Slack
SlackEnabled bool `json:"slack_enabled"`
SlackToken string `json:"slack_token"`
SlackChannel string `json:"slack_channel"`
SlackChannelPRBypass string `json:"slack_channel_pr_bypass"`
SlackChannelOktaSync string `json:"slack_channel_okta_sync"`
SlackChannelOrphanedUsers string `json:"slack_channel_orphaned_users"`
SlackAPIURL string `json:"slack_api_url"`
}
RedactedConfig contains configuration with sensitive values redacted. safe for logging and API responses.