Skip to content

Commit ee09eb6

Browse files
ericfitzclaude
andcommitted
feat(api): add include_in_report boolean field to sub-entity types
Add optional include_in_report field (default: true) to assets, documents, repositories, diagrams, notes, and threats. This allows users to control which items appear in generated PDF reports. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b085495 commit ee09eb6

File tree

10 files changed

+1529
-1344
lines changed

10 files changed

+1529
-1344
lines changed

api-schema/tmi-openapi.json

Lines changed: 89 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@
375375
],
376376
"created_at": "2024-01-17T14:00:00Z",
377377
"modified_at": "2024-01-17T14:00:00Z",
378-
"uri": "https://example.com/docs/security-policy.pdf"
378+
"uri": "https://example.com/docs/security-policy.pdf",
379+
"include_in_report": true
379380
}
380381
},
381382
"BaseDiagram": {
@@ -464,6 +465,11 @@
464465
"nullable": true,
465466
"description": "Optional description of the diagram",
466467
"pattern": "^[^<>\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]*$"
468+
},
469+
"include_in_report": {
470+
"type": "boolean",
471+
"description": "Whether this item should be included in generated reports",
472+
"default": true
467473
}
468474
},
469475
"required": [
@@ -485,7 +491,8 @@
485491
"name": "System Architecture",
486492
"description": "High-level system architecture diagram",
487493
"created_at": "2024-01-15T10:00:00Z",
488-
"modified_at": "2024-01-15T10:00:00Z"
494+
"modified_at": "2024-01-15T10:00:00Z",
495+
"include_in_report": true
489496
}
490497
},
491498
"BaseDiagramInput": {
@@ -544,6 +551,11 @@
544551
"nullable": true,
545552
"description": "Optional description of the diagram",
546553
"pattern": "^[^\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]*$"
554+
},
555+
"include_in_report": {
556+
"type": "boolean",
557+
"description": "Whether this item should be included in generated reports",
558+
"default": true
547559
}
548560
},
549561
"required": [
@@ -559,7 +571,8 @@
559571
"example": {
560572
"type": "DFD-1.0.0",
561573
"name": "New Architecture Diagram",
562-
"description": "Draft architecture for microservices migration"
574+
"description": "Draft architecture for microservices migration",
575+
"include_in_report": true
563576
}
564577
},
565578
"DfdDiagram": {
@@ -628,7 +641,8 @@
628641
"width": 140,
629642
"height": 70
630643
}
631-
]
644+
],
645+
"include_in_report": true
632646
},
633647
"description": "Data Flow Diagram with cells, edges, and visual styling for JointJS rendering"
634648
},
@@ -695,7 +709,8 @@
695709
"width": 60,
696710
"height": 60
697711
}
698-
]
712+
],
713+
"include_in_report": true
699714
},
700715
"description": "Input schema for creating or updating a Data Flow Diagram"
701716
},
@@ -1232,7 +1247,8 @@
12321247
"modified_at": "2024-01-16T09:00:00Z",
12331248
"threat_type": [
12341249
"spoofing"
1235-
]
1250+
],
1251+
"include_in_report": true
12361252
},
12371253
"description": "A security threat identified during threat modeling, with severity, status, and mitigation details"
12381254
},
@@ -1605,6 +1621,11 @@
16051621
},
16061622
"nullable": true,
16071623
"additionalProperties": false
1624+
},
1625+
"include_in_report": {
1626+
"type": "boolean",
1627+
"description": "Whether this item should be included in generated reports",
1628+
"default": true
16081629
}
16091630
},
16101631
"required": [
@@ -1622,7 +1643,8 @@
16221643
"description": "Data flow diagram showing payment processing flow",
16231644
"created_at": "2025-01-15T10:30:00Z",
16241645
"modified_at": "2025-01-15T14:22:00Z",
1625-
"image": null
1646+
"image": null,
1647+
"include_in_report": true
16261648
}
16271649
},
16281650
"TMListItem": {
@@ -2721,6 +2743,11 @@
27212743
},
27222744
"minItems": 1,
27232745
"maxItems": 10
2746+
},
2747+
"include_in_report": {
2748+
"type": "boolean",
2749+
"description": "Whether this item should be included in generated reports",
2750+
"default": true
27242751
}
27252752
},
27262753
"required": [
@@ -2742,7 +2769,8 @@
27422769
"vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
27432770
"score": 9.8
27442771
}
2745-
]
2772+
],
2773+
"include_in_report": true
27462774
}
27472775
},
27482776
"ThreatInput": {
@@ -2766,7 +2794,8 @@
27662794
],
27672795
"threat_type": [
27682796
"spoofing"
2769-
]
2797+
],
2798+
"include_in_report": true
27702799
}
27712800
},
27722801
"User": {
@@ -2947,7 +2976,8 @@
29472976
],
29482977
"created_at": "2024-01-15T10:00:00Z",
29492978
"modified_at": "2024-01-15T10:00:00Z",
2950-
"uri": "https://github.com/example/repo"
2979+
"uri": "https://github.com/example/repo",
2980+
"include_in_report": true
29512981
}
29522982
},
29532983
"Note": {
@@ -3152,13 +3182,19 @@
31523182
"maxLength": 128,
31533183
"nullable": true,
31543184
"pattern": "^[^\\x00-\\x1F]*$"
3185+
},
3186+
"include_in_report": {
3187+
"type": "boolean",
3188+
"description": "Whether this item should be included in generated reports",
3189+
"default": true
31553190
}
31563191
},
31573192
"example": {
31583193
"name": "Payment Database",
31593194
"type": "data",
31603195
"description": "PostgreSQL database storing customer payment information",
3161-
"criticality": "high"
3196+
"criticality": "high",
3197+
"include_in_report": true
31623198
}
31633199
},
31643200
"AssetInput": {
@@ -3171,7 +3207,8 @@
31713207
"example": {
31723208
"name": "User Database",
31733209
"type": "data",
3174-
"description": "Primary database storing user credentials"
3210+
"description": "Primary database storing user credentials",
3211+
"include_in_report": true
31753212
}
31763213
},
31773214
"DocumentBase": {
@@ -3208,12 +3245,18 @@
32083245
"binding": "required,url"
32093246
},
32103247
"pattern": "^[a-zA-Z][a-zA-Z0-9+.-]*://[^\\s]*$"
3248+
},
3249+
"include_in_report": {
3250+
"type": "boolean",
3251+
"description": "Whether this item should be included in generated reports",
3252+
"default": true
32113253
}
32123254
},
32133255
"example": {
32143256
"name": "Payment System Architecture",
32153257
"uri": "https://docs.example.com/architecture/payment-system.pdf",
3216-
"description": "High-level architecture diagram and documentation"
3258+
"description": "High-level architecture diagram and documentation",
3259+
"include_in_report": true
32173260
}
32183261
},
32193262
"DocumentInput": {
@@ -3234,7 +3277,8 @@
32343277
"value": "SecureTest Inc"
32353278
}
32363279
],
3237-
"uri": "https://example.com/docs/security-policy.pdf"
3280+
"uri": "https://example.com/docs/security-policy.pdf",
3281+
"include_in_report": true
32383282
}
32393283
},
32403284
"NoteBase": {
@@ -3271,11 +3315,17 @@
32713315
"maxLength": 1024,
32723316
"nullable": true,
32733317
"pattern": "^[^<>\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]*$"
3318+
},
3319+
"include_in_report": {
3320+
"type": "boolean",
3321+
"description": "Whether this item should be included in generated reports",
3322+
"default": true
32743323
}
32753324
},
32763325
"example": {
32773326
"name": "Security Review Notes",
3278-
"content": "Reviewed payment flow with security team. Key findings:\n- Need additional input validation\n- Consider rate limiting on payment endpoint"
3327+
"content": "Reviewed payment flow with security team. Key findings:\n- Need additional input validation\n- Consider rate limiting on payment endpoint",
3328+
"include_in_report": true
32793329
}
32803330
},
32813331
"NoteInput": {
@@ -3287,7 +3337,8 @@
32873337
],
32883338
"example": {
32893339
"name": "Security Analysis Notes",
3290-
"content": "Initial security analysis of the authentication flow."
3340+
"content": "Initial security analysis of the authentication flow.",
3341+
"include_in_report": true
32913342
}
32923343
},
32933344
"NoteListItem": {
@@ -3347,14 +3398,20 @@
33473398
"description": "Last modification timestamp (RFC3339)",
33483399
"readOnly": true,
33493400
"pattern": "^[0-9]*-[0-9]*-[0-9]*T[0-9]*:[0-9]*:[0-9]*(\\.[0-9]*)?(Z|[+-][0-9]*:[0-9]*)$"
3401+
},
3402+
"include_in_report": {
3403+
"type": "boolean",
3404+
"description": "Whether this item should be included in generated reports",
3405+
"default": true
33503406
}
33513407
},
33523408
"additionalProperties": false,
33533409
"example": {
33543410
"id": "ff0e8400-e29b-41d4-a716-44665544000a",
33553411
"name": "Security Review Notes",
33563412
"created_at": "2024-01-17T14:30:00Z",
3357-
"modified_at": "2024-01-17T15:00:00Z"
3413+
"modified_at": "2024-01-17T15:00:00Z",
3414+
"include_in_report": true
33583415
}
33593416
},
33603417
"RepositoryBase": {
@@ -3428,11 +3485,17 @@
34283485
"description": "URL to retrieve the referenced source code",
34293486
"maxLength": 1000,
34303487
"pattern": "^[a-zA-Z][a-zA-Z0-9+.-]*://[^\\s]*$"
3488+
},
3489+
"include_in_report": {
3490+
"type": "boolean",
3491+
"description": "Whether this item should be included in generated reports",
3492+
"default": true
34313493
}
34323494
},
34333495
"example": {
34343496
"uri": "https://github.com/example/payment-service",
3435-
"description": "Main repository for payment processing service"
3497+
"description": "Main repository for payment processing service",
3498+
"include_in_report": true
34363499
}
34373500
},
34383501
"RepositoryInput": {
@@ -3453,7 +3516,8 @@
34533516
"value": "Security"
34543517
}
34553518
],
3456-
"uri": "https://github.com/example/repo"
3519+
"uri": "https://github.com/example/repo",
3520+
"include_in_report": true
34573521
}
34583522
},
34593523
"WebhookSubscription": {
@@ -13599,7 +13663,8 @@
1359913663
"threat_model_id": "550e8400-e29b-41d4-a716-446655440000",
1360013664
"created_at": "2025-01-15T10:30:00Z",
1360113665
"modified_at": "2025-01-15T14:45:00Z",
13602-
"metadata": []
13666+
"metadata": [],
13667+
"include_in_report": true
1360313668
},
1360413669
{
1360513670
"id": "550e8400-e29b-41d4-a716-446655440004",
@@ -13615,7 +13680,8 @@
1361513680
"threat_model_id": "550e8400-e29b-41d4-a716-446655440000",
1361613681
"created_at": "2025-01-15T11:00:00Z",
1361713682
"modified_at": "2025-01-15T11:00:00Z",
13618-
"metadata": []
13683+
"metadata": [],
13684+
"include_in_report": true
1361913685
}
1362013686
],
1362113687
"total": 2,
@@ -14213,7 +14279,8 @@
1421314279
],
1421414280
"threat_type": [
1421514281
"tampering"
14216-
]
14282+
],
14283+
"include_in_report": true
1421714284
}
1421814285
}
1421914286
}

0 commit comments

Comments
 (0)