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 NewMCPDelegatedOperationAuth(tokens *mcpauthsvc.TokenService) (func(fiber.Ctx, fiber.Handler) error, error)
- func NewMCPOAuthConsentHandler(tokens *mcpauthsvc.TokenService, store *session.Store, ...) (fiber.Handler, error)
- 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 RegisterMCPMachineAdministrationRoutes(app *fiber.App, cfg MCPMachineAdministrationConfig) error
- func RegisterMCPOAuthRoutes(app *fiber.App, cfg MCPOAuthRoutesConfig) error
- func RegisterOpenAPIRoute(app *fiber.App, document []byte)
- func RegisterProbeRoutes(app *fiber.App, cfg ProbeRoutesConfig)
- func RequireMappedOperation(c fiber.Ctx, next fiber.Handler) error
- type GitLabProofWebhookResolver
- type MCPMachineAdministrationConfig
- type MCPOAuthRoutesConfig
- 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 and takes public detail from that error or its causes. 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 NewMCPDelegatedOperationAuth ¶
func NewMCPDelegatedOperationAuth(tokens *mcpauthsvc.TokenService) (func(fiber.Ctx, fiber.Handler) error, error)
NewMCPDelegatedOperationAuth adapts an OAuth grant to the shared Core operation handlers. Use it only at the operation boundary, after route parameters are available.
func NewMCPOAuthConsentHandler ¶
func NewMCPOAuthConsentHandler(tokens *mcpauthsvc.TokenService, store *session.Store, render func(c fiber.Ctx, prompt model.MCPConsentPrompt, action, csrf string) error, renderContinuation func(c fiber.Ctx, callback string) error, ) (fiber.Handler, error)
NewMCPOAuthConsentHandler requires the issuer and browser login to share an origin.
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 RegisterMCPMachineAdministrationRoutes ¶
func RegisterMCPMachineAdministrationRoutes(app *fiber.App, cfg MCPMachineAdministrationConfig) error
RegisterMCPMachineAdministrationRoutes mounts same-origin browser management routes under the issuer. Core startup does not register them.
func RegisterMCPOAuthRoutes ¶
func RegisterMCPOAuthRoutes(app *fiber.App, cfg MCPOAuthRoutesConfig) error
RegisterMCPOAuthRoutes mounts the issuer protocol separately from the product API. Authorize owns browser authentication and consent. Runtime composition must place the configured public origins behind trusted HTTPS ingress.
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 MCPMachineAdministrationConfig ¶
type MCPMachineAdministrationConfig struct {
Tokens *mcpauthsvc.TokenService
Audit workerproducer.EventProducer
Sessions *session.Store
Policy authorization.Service
Admission admissionsvc.Service
AbuseLimiter httpsecurity.AbuseLimiter
RequestLimit int
RequestWindow time.Duration
}
type MCPOAuthRoutesConfig ¶
type MCPOAuthRoutesConfig struct {
Tokens *mcpauthsvc.TokenService
Authorize fiber.Handler
AbuseLimiter httpsecurity.AbuseLimiter
RequestLimit int
RequestWindow time.Duration
}
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
- authorization_matrix.go
- authorization_target.go
- compiled_plans.go
- data_source_refs.go
- datasources.go
- effective_permissions.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
- mcp_delegated_operation.go
- mcp_machine_admin.go
- mcp_oauth.go
- mcp_oauth_consent.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_execution_control.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
- readiness.go
- role_grants.go
- roles.go
- run_inspection.go
- run_progress.go
- run_recency.go
- runtime_variable_definitions.go
- security.go
- server.go
- session.go
- session_authentication.go
- structural_checks.go
- users.go