Skip to content

Commit a1baed9

Browse files
arpcvgildub
authored andcommitted
External HTTP API/Webhook Wraper
1 parent 8aeb0f9 commit a1baed9

1 file changed

Lines changed: 31 additions & 40 deletions

File tree

docs/adrs/00014-enterprise-contract-integration.md

Lines changed: 31 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ Users need the ability to:
2525

2626
## Decision
2727

28-
We will integrate Conforma into Trustify as an optional validation service by spawning the Conforma CLI asynchronously.
28+
We will integrate Conforma into Trustify as a user triggered validation service by interacting with Conforma CLI.
2929
Validation is manually triggered — not automatic on SBOM upload.
3030
Validation on upload is deferred to a follow-up version.
3131

32+
Conforma CLI is deployed separately from Trustify as either a standalone container or equivalent.
33+
A HTTP wrapper will act as a proxy between Trustify EC service and Conforma CLI.
34+
3235
Uploaded SBOMs start in "Pending" status and are not discoverable until validated. EC validation is one mechanism by which an SBOM can move from "Pending" to "Accepted" or "Rejected":
3336

3437
- An SBOM in "Pending" can be submitted for EC validation.
@@ -46,39 +49,21 @@ Storing full JSON in S3 rather than only a summary was chosen explicitly to pres
4649

4750
## Consequences
4851

49-
Integrating via CLI spawning rather than a native API introduces an external process dependency that adds operational overhead (Conforma must be installed and version-pinned on every server) and per-validation process spawning overhead. These are accepted trade-offs given that no Conforma API exists yet. The executor is built behind an adapter interface so the implementation can be swapped for a REST client in Phase 3 without changes to the service layer or API.
52+
Using a HTTP API wrapper decouples the validation process into a external service.
53+
This will better catter for large-scale deployments as EC validation has its own constraint.
54+
Meanwhile it adds infrastructure complexity as the Webhook will need to be deployed alongside the EC system
5055

51-
### Trade-off/Risk & Mitigation
52-
53-
- Conforma must be installed on servers
54-
- Health check on startup
55-
- graceful degradation showing cached results
56-
- Process spawn overhead per validation
57-
- Async execution; configurable timeout (default 5 min)
58-
- CLI injection attacks
59-
- Args array only, never shell strings; all user inputs sanitized
60-
- Version compatibility
61-
- Document required Conforma version; validate on startup
62-
- Concurrent load exhausting resources
63-
- Semaphore (default: 5)
64-
- 429 on exhaustion
65-
- No native API yet
66-
- Adapter pattern for future migration (Phase 3)
67-
- Large SBOMs causing OOM
68-
- Stream to temp file
69-
- pass path to Conforma
70-
- Growing S3 storage costs
71-
- Retention policy (90-day default)
56+
Integrating via CLI spawning rather than a native API introduces an external process dependency that adds operational overhead (Conforma must be installed and version-pinned on every server) and per-validation process spawning overhead. These are accepted trade-offs given that no Conforma API exists yet. The executor is built behind an adapter interface so the implementation can be swapped for a REST client in Phase 3 without changes to the service layer or API.
7257

7358
### Alternatives Considered
7459

7560
#### In-Process Policy Engine: Rejected
7661

7762
Reimplementing Enterprise Contract logic in Rust would diverge from upstream and create significant maintenance burden.
7863

79-
#### Webhook-based Integration: Deferred
64+
#### Direct Integration: Rejected
8065

81-
Decouples validation into a separate service, which is better for large-scale deployments but adds infrastructure complexity premature for initial scope.
66+
Couple validation integrated within Trustify service through a directly controlled component was simpler but worse for large-scale deployments.
8267

8368
#### Embedded WASM Module: Rejected
8469

@@ -168,19 +153,23 @@ C4Container
168153
C4Component
169154
title EC Validation Module - Component Diagram
170155
171-
Container(api, "API Gateway", "Actix-web", "REST API for EC operations")
172-
173-
Container_Boundary(ecModule, "EC Validation Module") {
174-
Component(ecEndpoints, "EC Endpoints", "Actix-web handlers", "REST endpoints for validation operations")
175-
Component(conformaExecutor, "Conforma Executor", "Async Process", "Spawns Conforma CLI and captures output")
176-
Component(ecService, "EC Service", "Business logic", "Orchestrates validation workflow")
177-
Component(resultParser, "Result Parser", "JSON parser", "Parses Conforma output into structured data")
178-
Component(policyManager, "Policy Manager", "Business logic", "Manages EC policy references and configuration")
179-
Component(resultPersistence, "Result Persistence", "Database layer", "Saves validation results")
156+
Deployment_Node(trustifySystem, "Trustify System") {
157+
Container(api, "API Gateway", "Actix-web", "REST API for EC operations")
158+
Container_Boundary(ecModule, "EC Validation Module") {
159+
Container(ecEndpoints, "EC Endpoints", "Actix-web handlers", "REST endpoints for validation operations")
160+
Component(ecService, "EC Service", "Business logic", "Orchestrates validation workflow")
161+
Component(resultParser, "Result Parser", "JSON parser", "Parses Conforma output into structured data")
162+
Component(policyManager, "Policy Manager", "Business logic", "Manages EC policy references and<br/>configuration")
163+
Component(resultPersistence, "Result Persistence", "Database layer", "Saves validation results")
164+
}
180165
}
181-
182-
Container_Boundary(external, "External System") {
183-
System_Ext(conforma, "Conforma CLI", "Enterprise Contract validation tool")
166+
Deployment_Node(external, "External System") {
167+
Deployment_Node(trustifyPod, "Trustify Pod") {
168+
Component(conformaECWrapper, "EC Wrapper", "HTTP API/Webhook")
169+
}
170+
Deployment_Node(conformaPod, "Conforma Pod") {
171+
System_Ext(conforma, "Conforma CLI", "Enterprise Contract validation tool")
172+
}
184173
}
185174
186175
Container_Boundary(dbms, "Database") {
@@ -194,17 +183,19 @@ C4Component
194183
Rel(ecEndpoints, ecService, "validate_sbom() / get_ec_report()", "Function call")
195184
Rel(ecService, policyManager, "get_policy_config()", "Function call")
196185
Rel(policyManager, postgres, "SELECT ec_policies", "SQL")
197-
Rel(ecService, conformaExecutor, "request_validation()", "Function call")
198-
Rel(conformaExecutor, conforma, "Runs CLI command", "Process spawn")
186+
Rel(ecService, conformaECWrapper, "POST /api/v1/validation", "HTTP")
187+
Rel(conformaECWrapper, conforma, "ec validate", "Process spawn")
199188
Rel(ecService, resultParser, "parse_output()", "Function call")
200189
Rel(ecService, resultPersistence, "save_results()", "Function call")
201190
Rel(resultPersistence, postgres, "INSERT ec_validation_results", "SQL")
202191
Rel(ecService, s3, "Store EC report", "S3 API")
203192
204193
UpdateRelStyle(api, ecEndpoints, $offsetX="-50", $offsetY="-50")
194+
UpdateRelStyle(ecEndpoints, ecService, $offsetX="-60", $offsetY="+40")
195+
UpdateRelStyle(ecService, resultParser, $offsetX="-60", $offsetY="+0")
196+
UpdateRelStyle(ecService, resultPersistence, $offsetX="-60", $offsetY="+80")
205197
206198
UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="2")
207-
208199
```
209200

210201
### The main sequence Diagram

0 commit comments

Comments
 (0)