2.8 KiB
2.8 KiB
SBOM Source Trigger Dispatch Service (Webhook + Scheduler + Retry)
Module
Scanner
Status
IMPLEMENTED
Description
Trigger dispatcher routing events to 4 source-type handlers, webhook endpoints supporting 8+ registry types (Harbor, DockerHub, ACR, ECR, GCR, GHCR, Gitea, Quay), scheduler integration for periodic scans, and retry logic with exponential backoff.
Implementation Details
- Trigger Dispatcher:
src/Scanner/__Libraries/StellaOps.Scanner.Sources/Triggers/SourceTriggerDispatcher.cs-SourceTriggerDispatcherroutes trigger events to the appropriate source-type handler based on source typesrc/Scanner/__Libraries/StellaOps.Scanner.Sources/Triggers/ISourceTriggerDispatcher.cs- Interface for trigger dispatchingsrc/Scanner/__Libraries/StellaOps.Scanner.Sources/Triggers/TriggerContext.cs-TriggerContextcarrying webhook payload, source metadata, and retry state
- Webhook Endpoints:
src/Scanner/StellaOps.Scanner.WebService/Endpoints/WebhookEndpoints.cs-WebhookEndpointsexposing REST endpoints for registry webhook payloads from Harbor, DockerHub, ACR, ECR, GCR, GHCR, Gitea, Quay
- Source-Type Handlers:
src/Scanner/__Libraries/StellaOps.Scanner.Sources/Handlers/ISourceTypeHandler.cs-ISourceTypeHandlerinterface for source-type-specific handlingsrc/Scanner/__Libraries/StellaOps.Scanner.Sources/Handlers/Zastava/ZastavaSourceHandler.cs- Zastava registry handlersrc/Scanner/__Libraries/StellaOps.Scanner.Sources/Handlers/Docker/DockerSourceHandler.cs- Docker registry handlersrc/Scanner/__Libraries/StellaOps.Scanner.Sources/Handlers/Cli/CliSourceHandler.cs- CLI-triggered handlersrc/Scanner/__Libraries/StellaOps.Scanner.Sources/Handlers/Git/GitSourceHandler.cs- Git repository handler
- Scheduler Integration:
src/Scanner/__Libraries/StellaOps.Scanner.Sources/Scheduling/SourceSchedulerHostedService.cs-SourceSchedulerHostedServicebackground service managing periodic scan schedules with cron-like scheduling
- DI Registration:
src/Scanner/__Libraries/StellaOps.Scanner.Sources/DependencyInjection/ServiceCollectionExtensions.cs- Registers trigger dispatcher, handlers, and scheduler
E2E Test Plan
- Send a webhook payload from a Harbor registry push event and verify the trigger dispatcher routes it to the correct source-type handler
- Verify webhook endpoints accept payloads from all supported registry types (DockerHub, ACR, ECR, GCR, GHCR, Gitea, Quay)
- Configure a periodic scan schedule and verify the
SourceSchedulerHostedServicetriggers scans at the configured intervals - Verify retry logic with exponential backoff when a handler fails to process a trigger event
- Verify the
TriggerContextcarries the correct webhook payload metadata and source configuration to the handler