Skip to content

Commit 8aa81ab

Browse files
cogwirrelagdimech
andauthored
fix(cdk-graph-plugin-threat-composer): use smaller svg diagram to avoid size limit (#728)
Embed the svg diagram into the generated threat model instead of the png as it is much smaller, and does not exceed threat composer's 1MB image size limit. Fixes #721 Co-authored-by: Adrian Dimech <[email protected]>
1 parent 556c890 commit 8aa81ab

File tree

1 file changed

+2
-2
lines changed
  • packages/cdk-graph-plugin-threat-composer/src

1 file changed

+2
-2
lines changed

packages/cdk-graph-plugin-threat-composer/src/plugin.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ export class CdkGraphThreatComposerPlugin implements ICdkGraphPlugin {
9595
let architectureImageDataUri: string | undefined = undefined;
9696

9797
const architectureDiagramArtifact: CdkGraphArtifact | undefined =
98-
context.artifacts.DIAGRAM_PNG;
98+
context.artifacts.DIAGRAM_SVG;
9999
if (architectureDiagramArtifact) {
100100
const diagramBinaryContent = fs.readFileSync(
101101
architectureDiagramArtifact.filepath
102102
);
103-
architectureImageDataUri = `data:image/png;base64,${diagramBinaryContent.toString(
103+
architectureImageDataUri = `data:image/svg+xml;base64,${diagramBinaryContent.toString(
104104
"base64"
105105
)}`;
106106
}

0 commit comments

Comments
 (0)