Documentation
¶
Overview ¶
Package app is the application: it builds the GitHub, Okta, and Slack clients from the configuration, serves the webhook, admin, and scheduled endpoints, and runs the Okta sync, PR compliance, and security alert features.
Index ¶
Constants ¶
const ( ActionOktaSync = "okta-sync" ActionSecurityAlerts = "security-alerts" ActionSlackTest = "slack-test" )
Scheduled actions.
const JobTimeout = 10 * time.Minute
JobTimeout bounds a sync or report, and a queued follow-up sync.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the configured application. It is safe for concurrent use.
func New ¶
New builds the application. It makes no network calls, so it fails only on invalid configuration.
func (*App) RunScheduled ¶ added in v1.0.0
RunScheduled runs a scheduled action. Callers authenticate the request first: the HTTP endpoint requires the admin token, and EventBridge invocations are authorized by AWS.
type Background ¶ added in v1.0.0
Background runs work after the response to a request is sent, with a context of its own.
type Option ¶ added in v1.0.0
type Option func(*deps)
Option replaces a dependency that New would otherwise build.
func WithBackground ¶ added in v1.0.0
func WithBackground(b Background) Option
WithBackground runs webhook-triggered syncs in the background, so the webhook is answered at once. Without it they run before responding, as Lambda requires.
func WithGitHubClient ¶ added in v1.0.0
func WithGitHubClient(c domain.GitHubClient) Option
WithGitHubClient replaces the GitHub client.
func WithHTTPClient ¶ added in v1.0.0
WithHTTPClient sets the HTTP client every API client sends requests with.
func WithNotifier ¶ added in v1.0.0
WithNotifier replaces the Slack notifier.
func WithOktaClient ¶ added in v1.0.0
func WithOktaClient(c domain.OktaClient) Option
WithOktaClient replaces the Okta client.
type Status ¶ added in v1.0.0
type Status struct {
Status string `json:"status"`
GitHubOrg string `json:"github_org"`
OktaSyncEnabled bool `json:"okta_sync_enabled"`
PRComplianceEnabled bool `json:"pr_compliance_enabled"`
SecurityAlertsEnabled bool `json:"security_alerts_enabled"`
SlackEnabled bool `json:"slack_enabled"`
}
Status describes the application and its enabled features.
type WebhookResult ¶ added in v1.0.0
type WebhookResult string
WebhookResult says what was done with a webhook.
const ( WebhookProcessed WebhookResult = "processed" WebhookQueued WebhookResult = "queued" WebhookIgnored WebhookResult = "ignored" WebhookPong WebhookResult = "pong" )
Webhook results.