Skip to content

Commit 31eac18

Browse files
authored
Fix for docs links to schemas (PR #1436)
1 parent 6ab8792 commit 31eac18

File tree

10 files changed

+33
-26
lines changed

10 files changed

+33
-26
lines changed

.github/workflows/.trivyignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ CVE-2025-15284
2525

2626
# ignore diff vulnerability as used in development package only
2727
GHSA-73rr-hh4g-fpgx
28+
29+
# tar is used during development/build only, not runtime
30+
CVE-2026-23745

.github/workflows/pull_request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
uses: actions/[email protected]
6666

6767
- name: Spell check EN language
68-
uses: rojopolis/spellcheck-github-actions@0.55.0
68+
uses: rojopolis/spellcheck-github-actions@0.56.0
6969
with:
7070
config_path: .spellcheck.yaml
7171

docs/development/schema.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,20 @@ Threat Dragon will check a threat model against the schema when it is loading an
1717
but it will not stop the threat model from loading.
1818

1919
If there is doubt about a threat model then ajv (Another JSON Validator) can be run from the
20-
command line to provide details of any discrepancy:
20+
command line to provide detail for most errors or omissions:
2121

2222
```text
2323
sudo npm install -g ajv-cli
2424
# if validating a version 1.x threat model
25-
ajv validate -s ~/owasp.threat-dragon.schema.V1.json --all-errors --verbose \
25+
ajv validate -s ~/threat-dragon-v1.schema.json --all-errors --verbose \
2626
-d ThreatDragonModels/demo-threat-model.json
2727
# or if validating a version 2.x threat model
28-
ajv validate --allow-union-types -s ~/owasp.threat-dragon.schema.V2.json --all-errors --verbose \
28+
ajv validate --allow-union-types -s ~/threat-dragon-v2.schema.json --all-errors --verbose \
2929
-d ThreatDragonModels/v2-threat-model.json
3030
```
3131

32+
The commands use a schema downloaded from either [version 1][td-v1-schema] or [version 2][td-v2-schema] schema files.
33+
3234
### TM-BOM
3335

3436
The schema for the Threat Modeling - Bill of Materials (TM-BOM) file format is being developed as part of the
@@ -83,7 +85,7 @@ Threat Dragon: _making threat modeling less threatening_
8385

8486
[json-schema]: https://json-schema.org/
8587
[otm-schema]: https://github.com/iriusrisk/OpenThreatModel/blob/main/otm_schema.json
86-
[td-v1-schema]: https://github.com/OWASP/threat-dragon/blob/main/td.vue/src/assets/owasp.threat-dragon.schema.V1.json
87-
[td-v2-schema]: https://github.com/OWASP/threat-dragon/blob/main/td.vue/src/assets/owasp.threat-dragon.schema.V2.json
88+
[td-v1-schema]: https://github.com/OWASP/threat-dragon/blob/main/td.vue/src/assets/schema/threat-dragon-v1.schema.json
89+
[td-v2-schema]: https://github.com/OWASP/threat-dragon/blob/main/td.vue/src/assets/schema/threat-dragon-v2.schema.json
8890
[tm-library]: https://github.com/OWASP/www-project-threat-model-library
8991
[tm-library-schema]: https://github.com/OWASP/www-project-threat-model-library/blob/main/threat-model.schema.json

docs/testing/unit.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@ navigating to the `td.vue` directory and running `npm run test:unit -- --watch`
2121
### Mocha backend testing
2222

2323
Unit testing for the server application `td.server` is done using [Mocha](https://mochajs.org/),
24-
with a little help from our friends Sinon.JS and [chai](https://www.chaijs.com/).
25-
To run the tests locally navigate to the `td.server` directory and run: `npm run test:unit`
24+
with a little help from our friends [Sinon.JS][sinon] and [chai][chai].
25+
To run the tests locally navigate to the `td.server` directory and run `npm run test:unit` or `npm test`.
2626

2727
## Code Coverage
2828

29-
When you run unit tests for both the front-end and back-end application,
30-
you will be presented with a code coverage report.
29+
Run unit tests with `npm test` for either the front-end and back-end application to obtain the code coverage report.
3130
There will be an HTML report generated as well that you can view to
3231
dig deeper into what sections may be missing coverage.
3332

@@ -36,3 +35,6 @@ We hope to keep the code coverage as high as possible. If you need help writing
3635
----
3736

3837
Threat Dragon: _making threat modeling less threatening_
38+
39+
[chai]: https://www.chaijs.com/
40+
[sinon]: https://sinonjs.org/

td.vue/src/assets/schema/owasp-threat-dragon-v1.schema.json renamed to td.vue/src/assets/schema/threat-dragon-v1.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "https://owasp.org/www-project-threat-dragon/assets/schemas/owasp.threat-dragon.schema.V1.json",
2+
"$id": "https://github.com/OWASP/threat-dragon/tree/main/td.vue/src/assets/schema/threat-dragon-v1.schema.json",
33
"title": "Threat Dragon model schema",
44
"description": "The threat models used by OWASP Threat Dragon",
55
"type": "object",

td.vue/src/assets/schema/owasp-threat-dragon-v2.schema.json renamed to td.vue/src/assets/schema/threat-dragon-v2.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "https://owasp.org/www-project-threat-dragon/assets/schemas/owasp.threat-dragon.schema.V2.json",
2+
"$id": "https://github.com/OWASP/threat-dragon/tree/main/td.vue/src/assets/schema/threat-dragon-v2.schema.json",
33
"title": "Threat Dragon model schema",
44
"description": "The threat models used by OWASP Threat Dragon",
55
"type": "object",

td.vue/src/assets/schema/threat-model-format.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "https://owasp.org/www-project-threat-dragon/assets/schemas/threat.model.format.schema.json",
2+
"$id": "https://github.com/OWASP/threat-dragon/tree/main/td.vue/src/assets/schema/threat-model-format.schema.json",
33
"title": "Threat Model Format",
44
"description": "An open Threat Model Format (TMF) for threat models",
55
"type": "object",

td.vue/src/components/ThreatEditDialog.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ export default {
340340
return this.activeGame?.getCardCategory(this.card.number);
341341
},
342342
cardUrl() {
343-
return this.activeGame?.getCardUrl(this.card.number)
343+
return this.activeGame?.getCardUrl(this.card.number);
344344
}
345345
},
346346
data() {
@@ -391,7 +391,7 @@ export default {
391391
);
392392
} else {
393393
this.selectedGameId = this.threat.eopGameId;
394-
this.card.suit = this.activeGame?.getCardCategory(this.threat.cardNumber);;
394+
this.card.suit = this.activeGame?.getCardCategory(this.threat.cardNumber);
395395
this.card.number = this.threat.cardNumber;
396396
this.number = this.threat.number;
397397
this.newThreat = state === 'new';

td.vue/src/service/schema/ajv.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import addFormats from 'ajv-formats';
33
import otm from '@/service/migration/otm/openThreatModel';
44
import tmBom from '@/service/migration/tmBom/threatModelBom';
55

6-
const schemaV1 = require('@/assets/schema/owasp-threat-dragon-v1.schema');
7-
const schemaV2 = require('@/assets/schema/owasp-threat-dragon-v2.schema');
6+
const schemaV1 = require('@/assets/schema/threat-dragon-v1.schema');
7+
const schemaV2 = require('@/assets/schema/threat-dragon-v2.schema');
88

99
const ajv = new Ajv({'allowUnionTypes' : true});
1010
addFormats(ajv);

td.vue/src/service/threats/models/eop/cornucopia.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ export default {
1111

1212
getData() {
1313
switch (i18n.get().locale) {
14-
case 'spa':
15-
return cornucopiaES;
16-
case 'fra':
17-
return cornucopiaFR;
18-
case 'rus':
19-
return cornucopiaRU;
20-
case 'eng':
21-
default:
22-
return cornucopiaEN;
14+
case 'spa':
15+
return cornucopiaES;
16+
case 'fra':
17+
return cornucopiaFR;
18+
case 'rus':
19+
return cornucopiaRU;
20+
case 'eng':
21+
default:
22+
return cornucopiaEN;
2323
}
2424
},
2525

0 commit comments

Comments
 (0)