Skip to content

Commit

Permalink
Merge pull request #352 from iriusrisk/feature/OPT-1095
Browse files Browse the repository at this point in the history
[feature/OPT-1095] to dev
  • Loading branch information
dfernandezvigo authored Feb 5, 2024
2 parents 743fc5b + a83ca93 commit 3b1eb74
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 33 deletions.
70 changes: 38 additions & 32 deletions otm/resources/schemas/otm_schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://iriusrisk.com/schema/otm-0.1.0.schema.json",
"$id": "https://iriusrisk.com/schema/otm-0.2.0.schema.json",
"title": "Open Threat Model Specification",
"$comment" : "Open Threat Model JSON schema is published under the terms of the Apache License 2.0.",
"type": "object",
Expand Down Expand Up @@ -29,41 +29,47 @@
},
"representations": {
"type": ["array", "null"],
"required": ["name", "id", "type"],
"properties": {
"name": {"type": "string"},
"id": {"type": "string"},
"type": {"type": "string"},
"description": {"type": ["string", "null"]},
"size": {"$ref": "#/definitions/size"},
"repository": {
"type": ["object", "null"],
"required": ["url"],
"properties": {
"url": {"type": ["string", "null"]}
}
},
"attributes": {"type": ["object", "null"]}
"items": {
"type": "object",
"required": ["name", "id", "type"],
"properties": {
"name": {"type": "string"},
"id": {"type": "string"},
"type": {"type": "string"},
"description": {"type": ["string", "null"]},
"size": {"$ref": "#/definitions/size"},
"repository": {
"type": ["object", "null"],
"required": ["url"],
"properties": {
"url": {"type": ["string", "null"]}
}
},
"attributes": {"type": ["object", "null"]}
}
}
},
"assets": {
"type": ["array", "null"],
"required": ["name", "id", "risk"],
"properties": {
"name": {"type": "string"},
"id": {"type": "string"},
"description": {"type": ["string", "null"]},
"risk": {
"type": "object",
"required": ["confidentiality", "integrity", "availability"],
"properties": {
"confidentiality": {"type": "number"},
"integrity": {"type": "number"},
"availability": {"type": "number"},
"comment": {"type": ["string", "null"]}
}
},
"attributes": {"type": ["object", "null"]}
"items": {
"type": "object",
"required": ["name", "id", "risk"],
"properties": {
"name": {"type": "string"},
"id": {"type": "string"},
"description": {"type": ["string", "null"]},
"risk": {
"type": "object",
"required": ["confidentiality", "integrity", "availability"],
"properties": {
"confidentiality": {"type": "number"},
"integrity": {"type": "number"},
"availability": {"type": "number"},
"comment": {"type": ["string", "null"]}
}
},
"attributes": {"type": ["object", "null"]}
}
}
},
"trustZones": {
Expand Down
5 changes: 4 additions & 1 deletion slp_drawio/slp_drawio/load/drawio_dict_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ def get_diagram_size(source) -> Optional[Dict]:
height = model.get('pageHeight', None)
width = model.get('pageWidth', None)

return {'width': width, 'height': height} if height and width else None
try:
return {'width': int(width), 'height': int(height)} if height and width else None
except ValueError:
return None


def is_multiple_pages(source):
Expand Down

0 comments on commit 3b1eb74

Please sign in to comment.