Documentation
¶
Index ¶
- Constants
- func MapServiceError(err error) error
- func NewBackendSecurityMiddlewareForApp(sessionStore *session.Store, logger *slog.Logger, ...) fiber.Handler
- func NewBearerAuthMiddleware(apiKeysService interface{ ... }, patsService interface{ ... }) fiber.Handler
- func NewOpenAPIRequestValidator(schema *openapi3.T) (fiber.Handler, error)
- func NewSessionAuthenticationMiddleware(users userssvc.UsersService, store *session.Store) fiber.Handler
- func PublicOpenAPIDocument(schema *openapi3.T) ([]byte, error)
- func RegisterGitHubAppWebhookRoute(app *fiber.App, lifecycle githubAppLifecycleAcceptor, secret []byte, ...) error
- func RegisterGitHubProofWebhookRoute(app *fiber.App, acceptor ProofWebhookAcceptor, ...) error
- func RegisterGitLabProofWebhookRoute(app *fiber.App, resolver GitLabProofWebhookResolver, ...) error
- func RegisterOpenAPIRoute(app *fiber.App, document []byte)
- func RegisterProbeRoutes(app *fiber.App, cfg ProbeRoutesConfig)
- type GitLabProofWebhookResolver
- type ProbeDatabase
- type ProbeLifecycle
- type ProbeMigrationPreflight
- type ProbeRoutesConfig
- type ProofWebhookAcceptor
- type RequestAuthorization
- type Server
Constants ¶
const GitHubAppEndpointPath = "/api/webhooks/github/pull-requests"
GitHubAppEndpointPath remains the shared GitHub App endpoint when Proof pull-request intake lands.
const GitHubProofWebhookPath = "/api/webhooks/github/pull-requests"
const GitLabProofWebhookPath = "/api/webhooks/gitlab/merge-requests/:routeKey"
Variables ¶
This section is empty.
Functions ¶
func MapServiceError ¶
MapServiceError converts a service-layer error into an appropriate API error. It extracts the kind, code, and message from the xerror.Error in the error chain to build the response. Non-xerror errors are logged and mapped to 500.
func NewBackendSecurityMiddlewareForApp ¶
func NewBackendSecurityMiddlewareForApp( sessionStore *session.Store, logger *slog.Logger, abuseLimiter httpsecurity.AbuseLimiter, authAttempts int, authWindow time.Duration, expensiveClientAttempts int, expensiveTenantAttempts int, credentialAttempts int, expensiveWindow time.Duration, ) fiber.Handler
func NewBearerAuthMiddleware ¶
func NewOpenAPIRequestValidator ¶
NewOpenAPIRequestValidator validates requests before generated handlers bind them.
func NewSessionAuthenticationMiddleware ¶
func NewSessionAuthenticationMiddleware(users userssvc.UsersService, store *session.Store) fiber.Handler
NewSessionAuthenticationMiddleware checks shared credential state on every request.
func PublicOpenAPIDocument ¶
PublicOpenAPIDocument omits internal paths and types without changing server validation.
func RegisterGitLabProofWebhookRoute ¶
func RegisterGitLabProofWebhookRoute(app *fiber.App, resolver GitLabProofWebhookResolver, acceptor ProofWebhookAcceptor, logger *slog.Logger) error
func RegisterOpenAPIRoute ¶
RegisterOpenAPIRoute publishes the already-validated API document at a stable unauthenticated endpoint for programmatic consumers and API docs.
func RegisterProbeRoutes ¶
func RegisterProbeRoutes(app *fiber.App, cfg ProbeRoutesConfig)
RegisterProbeRoutes registers unauthenticated backend liveness and readiness endpoints.
Types ¶
type GitLabProofWebhookResolver ¶
type GitLabProofWebhookResolver interface {
Resolve(context.Context, string) (gitlabproofwebhooksvc.ResolvedWebhook, error)
}
type ProbeDatabase ¶
ProbeDatabase is the database dependency boundary used by readiness probes.
type ProbeLifecycle ¶
type ProbeLifecycle interface {
IsDraining() bool
}
ProbeLifecycle is the process drain-state boundary used by readiness probes.
type ProbeMigrationPreflight ¶
ProbeMigrationPreflight is the migration-state dependency boundary used by readiness probes.
type ProbeRoutesConfig ¶
type ProbeRoutesConfig struct {
Database ProbeDatabase
Migrations ProbeMigrationPreflight
Lifecycle ProbeLifecycle
}
ProbeRoutesConfig contains dependencies needed by the backend probe routes.
type ProofWebhookAcceptor ¶
type ProofWebhookAcceptor interface {
Accept(context.Context, gitprovider.VerifiedChangeEvent) (queue.QueuedJob, error)
}
type RequestAuthorization ¶
type RequestAuthorization interface {
CurrentUser(fiber.Ctx) (reqctx.UserPrincipal, bool)
Can(fiber.Ctx, model.Action, model.Resource) error
CanOrg(fiber.Ctx, slug.Slug, model.Action, model.Resource) error
}
RequestAuthorization exposes the request-scoped authentication and authorization boundary needed by an optional HTTP extension without exposing server state.
type Server ¶
type Server = server
Server implements the shared HTTP handlers.
func NewServer ¶
func NewServer( usersService userssvc.UsersService, accountClosureService *accountclosuresvc.Service, oidcService oidc.Service, sessionStore *session.Store, authorizationService authorization.Service, orgService orgsvc.Service, admissionService admissionsvc.Service, projectsService projectssvc.Service, repositorySetupService projectRepositorySetupService, pipelineCreationsService pipelineCreationService, odcsContractsService odcscontractsvc.Service, compiledPlansService compiledPlanService, odcsArtifactImporter *odcscontractsvc.ArtifactImporter, environmentsService environmentssvc.Service, membersService memberssvc.Service, rolesService rolessvc.Service, apiKeysService apikeyssvc.Service, patsService patssvc.Service, credentialsService credentialssvc.Service, datasourcesService datasourcessvc.Service, dataSourceRefsService datasourcerefssvc.Service, queriesService queriessvc.Service, eventsService eventssvc.Service, githubAppService *githubappsvc.Service, notificationsService notificationsvc.Service, retentionService retentionsvc.Service, pipelinesService pipelinesvc.Service, proofReceiptService proofreceiptsvc.Service, proofConfigurationService *proofconfigsvc.Service, proofObservationService *proofreceiptsvc.LiveCompiler, pipelineTriggersService pipelinetriggersvc.Service, pipelineWebhookService *pipelinewebhooksvc.Service, runRecencyService runRecencyService, frontendURL string, googleRedirectURI string, selfServiceRegistrationEnabled bool, externalOnboardingEnabled bool, memberAdmission memberAdmissionService, ) *Server
Source Files
¶
- account_deletion.go
- api_keys.go
- auth.go
- compiled_plans.go
- data_source_refs.go
- datasources.go
- environments.go
- errors.go
- events.go
- github_app_connections.go
- github_app_webhook.go
- github_proof_webhook.go
- gitlab_connections.go
- gitlab_proof_webhook.go
- list_params.go
- member_invitations.go
- members.go
- notification_connections.go
- notifications.go
- odcs_artifacts.go
- odcs_contracts.go
- openapi.go
- openapi_validation.go
- organizations.go
- personal_access_tokens.go
- pipeline_completion.go
- pipeline_creations.go
- pipeline_triggers.go
- pipeline_webhooks.go
- pipelines.go
- probes.go
- project_repository_setup.go
- projects.go
- proof_configuration.go
- proof_observations.go
- proof_operational.go
- proof_receipts.go
- provider_connectors.go
- queries.go
- roles.go
- run_inspection.go
- run_progress.go
- run_recency.go
- security.go
- server.go
- session.go
- session_authentication.go
- structural_checks.go
- users.go