Skip to content

Commit a4ff9ab

Browse files
ericfitzclaude
andauthored
feat(api): add data_assets array to cells and enhance minimal model (#116)
- Add data_assets array property to Cell.data for referencing Asset UUIDs - Update MinimalNode/MinimalEdge: rename dataAssetId to dataAssetIds (array) - Add assets array to MinimalDiagramModel containing referenced Asset objects - Update diagram model transform to: - Populate dataAssetIds from cell data (excluding text-box/security-boundary) - Fetch and include referenced assets in minimal model output - Set SecurityBoundary flag based on shape or explicit cell data - Update tests for new MinimalDiagramModel structure Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 001440b commit a4ff9ab

File tree

7 files changed

+1136
-927
lines changed

7 files changed

+1136
-927
lines changed

.version

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"major": 0,
3-
"minor": 272,
4-
"patch": 6
3+
"minor": 273,
4+
"patch": 0
55
}

api-schema/tmi-openapi.json

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,20 @@
796796
"type": "boolean",
797797
"description": "Indicates whether this cell represents a security boundary in the threat model",
798798
"default": false
799+
},
800+
"data_assets": {
801+
"type": "array",
802+
"description": "References to Asset IDs associated with this cell. Each UUID must reference an existing Asset in the same threat model.",
803+
"items": {
804+
"type": "string",
805+
"format": "uuid",
806+
"description": "UUID reference to an Asset object",
807+
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
808+
"maxLength": 36
809+
},
810+
"minItems": 1,
811+
"maxItems": 100,
812+
"uniqueItems": true
799813
}
800814
},
801815
"additionalProperties": true,
@@ -5459,7 +5473,8 @@
54595473
"name",
54605474
"description",
54615475
"metadata",
5462-
"cells"
5476+
"cells",
5477+
"assets"
54635478
],
54645479
"properties": {
54655480
"id": {
@@ -5493,6 +5508,14 @@
54935508
"$ref": "#/components/schemas/MinimalCell"
54945509
},
54955510
"maxItems": 10000
5511+
},
5512+
"assets": {
5513+
"type": "array",
5514+
"description": "Asset objects referenced by cells in this diagram via dataAssetIds",
5515+
"items": {
5516+
"$ref": "#/components/schemas/Asset"
5517+
},
5518+
"maxItems": 1000
54965519
}
54975520
},
54985521
"additionalProperties": false,
@@ -5504,7 +5527,8 @@
55045527
"environment": "production",
55055528
"compliance": "PCI-DSS"
55065529
},
5507-
"cells": []
5530+
"cells": [],
5531+
"assets": []
55085532
}
55095533
},
55105534
"MinimalCell": {
@@ -5595,13 +5619,16 @@
55955619
},
55965620
"maxItems": 100
55975621
},
5598-
"dataAssetId": {
5599-
"type": "string",
5600-
"format": "uuid",
5601-
"description": "Optional reference to a data asset entity",
5602-
"nullable": true,
5603-
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
5604-
"maxLength": 36
5622+
"dataAssetIds": {
5623+
"type": "array",
5624+
"description": "References to Asset IDs associated with this node",
5625+
"items": {
5626+
"type": "string",
5627+
"format": "uuid",
5628+
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
5629+
"maxLength": 36
5630+
},
5631+
"maxItems": 100
56055632
},
56065633
"metadata": {
56075634
"type": "object",
@@ -5627,7 +5654,7 @@
56275654
"labels": [
56285655
"Payment Gateway"
56295656
],
5630-
"dataAssetId": "960e8400-e29b-41d4-a716-446655440004",
5657+
"dataAssetIds": ["960e8400-e29b-41d4-a716-446655440004"],
56315658
"metadata": {
56325659
"technology": "Java"
56335660
},
@@ -5686,13 +5713,16 @@
56865713
},
56875714
"maxItems": 100
56885715
},
5689-
"dataAssetId": {
5690-
"type": "string",
5691-
"format": "uuid",
5692-
"description": "Optional reference to a data asset entity",
5693-
"nullable": true,
5694-
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
5695-
"maxLength": 36
5716+
"dataAssetIds": {
5717+
"type": "array",
5718+
"description": "References to Asset IDs associated with this edge",
5719+
"items": {
5720+
"type": "string",
5721+
"format": "uuid",
5722+
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
5723+
"maxLength": 36
5724+
},
5725+
"maxItems": 100
56965726
},
56975727
"metadata": {
56985728
"type": "object",
@@ -5715,7 +5745,7 @@
57155745
"labels": [
57165746
"Credit Card Data"
57175747
],
5718-
"dataAssetId": null,
5748+
"dataAssetIds": [],
57195749
"metadata": {
57205750
"protocol": "https"
57215751
}

0 commit comments

Comments
 (0)