Help us shape the future of Go! Take the 2026 Go Developer Survey

bootstrap

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 56 Imported by: 0

Documentation

Index

Constants

View Source
const GoogleWorkspaceBigQuerySyncWakeChannel = "aperio_google_workspace_bigquery_sync_requested"

GoogleWorkspaceBigQuerySyncWakeChannel is the Postgres LISTEN/NOTIFY channel the google-workspace-bigquery-sync worker subscribes to for out-of-cycle BigQuery export ingestion after config save or manual force-sync.

View Source
const GoogleWorkspaceDirectorySyncWakeChannel = "aperio_google_workspace_directory_sync_requested"

GoogleWorkspaceDirectorySyncWakeChannel wakes the Directory users sync worker for a targeted integration.

View Source
const GoogleWorkspaceOAuthSyncWakeChannel = "aperio_google_workspace_oauth_sync_requested"

GoogleWorkspaceOAuthSyncWakeChannel wakes the OAuth grants sync worker for a targeted integration.

View Source
const GoogleWorkspaceSyncWakeChannel = "aperio_google_workspace_sync_requested"

GoogleWorkspaceSyncWakeChannel is the Postgres LISTEN/NOTIFY channel name the google-workspace-poller subscribes to so freshly-connected integrations trigger an out-of-cycle poll instead of waiting up to a full poll interval for the next ticker fire. The payload is the integration_connections.id.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App owns the Go/ConnectRPC HTTP surface. It deliberately keeps only infrastructural dependencies here so endpoint implementations stay easy to move from the current TypeScript API into Go one route at a time.

func NewApp

func NewApp(cfg config.Config, db *sql.DB) *App

NewApp wires routes but does not open network sockets. Tests can mount the returned handler directly, while cmd/aperio decides how to listen in runtime.

func (*App) CallApi

CheckHealth is the first ConnectRPC method exposed by the Go service. It matches Cerebro's generated-handler pattern and gives TypeScript clients a stable endpoint to verify transport compatibility.

func (*App) GetDashboardMetrics

GetDashboardMetrics is the first product endpoint migrated behind ConnectRPC. It preserves the existing tenant cookie model so the web client can opt in via NEXT_PUBLIC_CONNECT_API_BASE_URL without changing login flow.

func (*App) GetOperationalHealth

GetOperationalHealth returns tenant-scoped connector, queue, SIEM, and rule receipts. Unlike /readyz and CheckHealth, this endpoint is deliberately authenticated because its state is an operator view rather than a process liveness signal.

func (*App) Handler

func (a *App) Handler() http.Handler

Handler returns the complete HTTP handler stack. CORS is applied outside the route mux so every ConnectRPC method and the liveness endpoint share the same browser boundary.

func (*App) ListDetectionPacks

ListDetectionPacks returns every detection pack the worker knows about, each hydrated with the rules it owns. The shape is intentionally flat so the operator UI can render the catalog in a single render pass without follow-up requests. Provider filter is optional; an empty provider returns every pack in display order.

func (*App) WithCerebroContextClient

func (a *App) WithCerebroContextClient(runtimeID string, client saasCerebroContextClient) *App

func (*App) WithCerebroMCPServerURL

func (a *App) WithCerebroMCPServerURL(serverURL string) *App

func (*App) WithCerebroOAuthIssuerURL

func (a *App) WithCerebroOAuthIssuerURL(issuerURL string) *App

func (*App) WithCerebroSourceID

func (a *App) WithCerebroSourceID(sourceID string) *App

func (*App) WithCerebroWebURL

func (a *App) WithCerebroWebURL(webURL string) *App

type GoogleOAuthResolver

type GoogleOAuthResolver struct {
	DB *sql.DB
}

GoogleOAuthResolver is a small, dependency-free adapter that satisfies internal/googleworkspacepoller.OAuthResolver without forcing that package to import bootstrap (which would create an import cycle: bootstrap → poller → bootstrap). The resolver reads per-tenant client credentials from integration_oauth_clients, falls back to the operator env vars, and decrypts the stored client_secret using the same AAD scheme the rest of the bootstrap package uses (oauthClientSecretAAD).

func (GoogleOAuthResolver) ResolveGoogleOAuthClient

func (r GoogleOAuthResolver) ResolveGoogleOAuthClient(ctx context.Context, organizationID string) (poolerOAuthConfig, bool)

ResolveGoogleOAuthClient returns the per-organization Google OAuth client id / secret pair. The bool is false when neither a per-tenant row nor the operator env fallback is configured, in which case the caller should skip the integration with a log line rather than fail loudly.

Jump to

Keyboard shortcuts

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