Motivation
RDX is used both as standalone documents and embedded inside CycloneDX BOMs (RDX-036..039, RDX-099). Many consumers and orchestration systems would benefit from a standardized, server-oriented interchange pattern: a minimal REST API (OpenAPI 3.1) for publishing, querying, and incrementally updating RDX documents. Standardizing an API avoids ad-hoc endpoints, enables tool vendors to interoperate, and supports partial updates for large TARAs without re-uploading full documents.
Key capabilities: CRUD for RDX documents, query/filter by itemDefinition/documentId/createdBy, partial updates using RFC 6902 (JSON Patch) or RFC 7396 (JSON Merge Patch), strong versioning and ETag concurrency, and optional pagination for large riskSets.
Proposed change
-
New artifact: spec/api/rdx-openapi.yaml (OpenAPI 3.1) describing a REST profile with the following endpoints (all JSON media types):
- POST /rdx/documents — create RDX document (accepts full RDX JSON). Response includes documentId and location.
- GET /rdx/documents/{documentId} — fetch full RDX document (support query param
embedCycloneDX=true|false).
- GET /rdx/documents?itemId={id}&createdBy={actor}&since={date} — filter listing (supports pagination).
- PATCH /rdx/documents/{documentId} — partial update. Support
Content-Type: application/json-patch+json (RFC 6902) and application/merge-patch+json (RFC 7396). The OpenAPI schema SHALL document patchable paths (e.g., riskSet.attackPaths, controls[], relationships[]) and describe idempotency/ordering semantics for array edits (patch best-practices).
- PUT /rdx/documents/{documentId}/versions — append a new version (full document) to implement version history.
- DELETE /rdx/documents/{documentId} — delete or mark-retired (soft-delete with reason).
- HEAD /rdx/documents/{documentId} — return headers (ETag, last-modified, schemaVersion).
-
Server contract details in spec/api/rdx-openapi.yaml:
- ETag-based optimistic concurrency (ETag required on PATCH/PUT; server MUST return
412 Precondition Failed if mismatch).
- Support
If-Match / If-None-Match semantics for safe updates.
- Pagination headers (RFC 8288 style) and
Link for next/prev.
- Response codes documented and machine-friendly error model (problem+json format).
-
Add tools/api/mock_server/ reference server (Node.js/Express or Python/Flask) that implements the OpenAPI contract and demonstrates JSON Patch application to an example RDX document. Include tests exercising concurrency (ETag) and patch semantics.
-
Update docs in methodology/ describing how to embed CycloneDX-embedded RDX in the REST API responses and how consumers should handle large embedded CycloneDX BOMs (support Content-Encoding and chunking guidance).
-
New requirement in REQUIREMENTS.md: RDX-121: "Provide a standard OpenAPI REST profile for RDX document CRUD and partial updates using RFC 6902/7396 semantics" (new requirement).
Backward-compatible: this is an API profile and tooling; it does not change on-disk schemas.
References
Acceptance criteria
- Add
spec/api/rdx-openapi.yaml OpenAPI 3.1 file describing endpoints above, example requests/responses, security scheme (bearer token) and pagination.
- Add
tools/api/mock_server/ minimal reference server implementing create/get/patch semantics and a test suite that runs the following scenarios:
- Create an RDX document and receive documentId.
- Apply a JSON Patch that updates an attackPath step and verify other fields are untouched.
- Attempt concurrent PATCH with stale ETag and receive 412.
- Retrieve paginated listing for documents filtered by itemDefinition id.
- Document in
methodology/API.md guidance about embedding CycloneDX content, payload size recommendations, and recommended Content-Type headers.
- Update
REQUIREMENTS.md with RDX-121 (new requirement), and add a short conformance checklist for server implementers (ETag support, support for both RFC6902 and RFC7396 content types, error model).
- CI job to run mock_server tests on PRs touching spec or tooling files.
Generated by tools/ai_idea_scout.py via the AI Idea Scout workflow.
Review the proposal, refine the title/body/labels, and close if not desired.
Motivation
RDX is used both as standalone documents and embedded inside CycloneDX BOMs (RDX-036..039, RDX-099). Many consumers and orchestration systems would benefit from a standardized, server-oriented interchange pattern: a minimal REST API (OpenAPI 3.1) for publishing, querying, and incrementally updating RDX documents. Standardizing an API avoids ad-hoc endpoints, enables tool vendors to interoperate, and supports partial updates for large TARAs without re-uploading full documents.
Key capabilities: CRUD for RDX documents, query/filter by itemDefinition/documentId/createdBy, partial updates using RFC 6902 (JSON Patch) or RFC 7396 (JSON Merge Patch), strong versioning and ETag concurrency, and optional pagination for large riskSets.
Proposed change
New artifact:
spec/api/rdx-openapi.yaml(OpenAPI 3.1) describing a REST profile with the following endpoints (all JSON media types):embedCycloneDX=true|false).Content-Type: application/json-patch+json(RFC 6902) andapplication/merge-patch+json(RFC 7396). The OpenAPI schema SHALL document patchable paths (e.g., riskSet.attackPaths, controls[], relationships[]) and describe idempotency/ordering semantics for array edits (patch best-practices).Server contract details in
spec/api/rdx-openapi.yaml:412 Precondition Failedif mismatch).If-Match/If-None-Matchsemantics for safe updates.Linkfor next/prev.Add
tools/api/mock_server/reference server (Node.js/Express or Python/Flask) that implements the OpenAPI contract and demonstrates JSON Patch application to an example RDX document. Include tests exercising concurrency (ETag) and patch semantics.Update docs in
methodology/describing how to embed CycloneDX-embedded RDX in the REST API responses and how consumers should handle large embedded CycloneDX BOMs (support Content-Encoding and chunking guidance).New requirement in
REQUIREMENTS.md: RDX-121: "Provide a standard OpenAPI REST profile for RDX document CRUD and partial updates using RFC 6902/7396 semantics" (new requirement).Backward-compatible: this is an API profile and tooling; it does not change on-disk schemas.
References
Acceptance criteria
spec/api/rdx-openapi.yamlOpenAPI 3.1 file describing endpoints above, example requests/responses, security scheme (bearer token) and pagination.tools/api/mock_server/minimal reference server implementing create/get/patch semantics and a test suite that runs the following scenarios:methodology/API.mdguidance about embedding CycloneDX content, payload size recommendations, and recommended Content-Type headers.REQUIREMENTS.mdwith RDX-121 (new requirement), and add a short conformance checklist for server implementers (ETag support, support for both RFC6902 and RFC7396 content types, error model).Generated by
tools/ai_idea_scout.pyvia the AI Idea Scout workflow.Review the proposal, refine the title/body/labels, and close if not desired.