Skip to content

test(taxii): TAXII 2.1 contract-conformance suite#163

Merged
rinjanianalytics merged 1 commit into
masterfrom
test/taxii-contract-conformance
Jun 17, 2026
Merged

test(taxii): TAXII 2.1 contract-conformance suite#163
rinjanianalytics merged 1 commit into
masterfrom
test/taxii-contract-conformance

Conversation

@rinjanianalytics

Copy link
Copy Markdown
Owner

First of the cross-cutting hardening items. Locks the public TAXII 2.1 interop surface so a refactor can't silently break a downstream STIX consumer (OpenCTI / MISP / TheHive / a CERT).

Approach

Runs in-process via taxiiRouter.request()no live server, no Postgres — by exercising only the paths that resolve before any DB query. This makes it a fast unit test (regular pnpm test, ~1.3s), unlike the existing infra-heavy integration suite.

13 assertions:

  • Discovery / Collections / Collection — shape + required TAXII fields + application/taxii+json;version=2.1 media type
  • Auth gating — 401 (no token / non-Bearer) on objects, manifest, POST
  • Authorization — 403 (POST to read-only collection), 400 (malformed bundle), 404 (read-protected / unknown collection) — all resolve before the handler touches the DB

Honest scope note

DB-backed object/manifest bodies stay in the integration suite. And I found two real conformance gaps that I documented in the test header rather than asserting as "correct" (so this suite doesn't ossify them):

  1. GET .../objects/ returns a STIX bundle ({type,id,objects,more}); TAXII 2.1 §5.4 specifies an Envelope ({more,next?,objects}).
  2. No distinct API-Root resource ({title,versions,max_content_length}) — Discovery and the api-root share /taxii2/.

Both warrant a follow-up (needs the integration harness + a consumer-impact call, since the envelope change is consumer-facing). Flagging, not silently fixing.

gateway tsc + full api suite (1194 passed) green.

Locks the public TAXII interop surface so a refactor can't silently break a
downstream STIX consumer. Runs in-process via taxiiRouter.request() — no live
server, no Postgres — covering the paths that resolve before any DB query:
Discovery / Collections / Collection shapes + media type, auth gating (401),
write-protection (403), body validation (400), read-protection (404).

13 assertions, ~1.3s. DB-backed object/manifest bodies stay in the integration
suite. Documents (without ossifying) two real conformance gaps for a follow-up:
the objects endpoint returns a STIX `bundle` rather than a TAXII 2.1 Envelope,
and there's no distinct API-Root resource.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rinjanianalytics rinjanianalytics force-pushed the test/taxii-contract-conformance branch from 8188ee1 to 908579a Compare June 17, 2026 08:07
@rinjanianalytics rinjanianalytics merged commit 2dba9aa into master Jun 17, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant