feat(ttp): E.1.9 API contract — seven router endpoints, admin-gated state mutations, response models

Mounts /api/v1/ttp/* with empty-list / empty-Navigator responses.
GET endpoints viewer-gated; POST/DELETE /rules/{rule_id}/state
admin-gated server-side. POST parses JSON manually so a malformed
body returns the documented 400 (per feedback_schemathesis_400).

Drops xfail-strict markers from E.2.8 tests now that the router is
mounted; 26 tests pass against the contract handlers.
This commit is contained in:
2026-05-01 07:20:13 -04:00
parent cfbfaabfcd
commit b7f206c8c5
15 changed files with 515 additions and 56 deletions

View File

@@ -186,13 +186,21 @@ from .tarpit import (
TarpitStatusResponse,
)
from .ttp import (
CampaignTechniqueRow,
CanaryFingerprintEvidence,
CommandEvidence,
EmailEvidence,
IdentityTechniqueRow,
IntelEvidence,
NavigatorLayer,
NavigatorTechnique,
RuleCatalogueRow,
RuleStateRequest,
RuleStateResponse,
TTPRule,
TTPRuleState,
TTPTag,
TechniqueRollupRow,
compute_tag_uuid,
)
@@ -356,12 +364,20 @@ __all__ = [
"TarpitRuleResponse",
"TarpitStatusResponse",
# ttp
"CampaignTechniqueRow",
"CanaryFingerprintEvidence",
"CommandEvidence",
"EmailEvidence",
"IdentityTechniqueRow",
"IntelEvidence",
"NavigatorLayer",
"NavigatorTechnique",
"RuleCatalogueRow",
"RuleStateRequest",
"RuleStateResponse",
"TTPRule",
"TTPRuleState",
"TTPTag",
"TechniqueRollupRow",
"compute_tag_uuid",
]