Eop card browser/m3 eop api endpoints#3254
Conversation
Signed-off-by: Ayman Algamal <ayman01287985950@gmail.com>
|
{
"meta": {
"edition": "Elevation of Privilege Edition",
"component": "cards",
"language": "en",
"version": "5.0"
},
"standards": [
{
"doctype": "Tool",
"id": "https://cornucopia.owasp.org/edition/eop/SP2/5.0/en",
"name": "Elevation of Privilege Edition",
"section": "Spoofing",
"description": "An attacker could take over the port or socket that the server normally uses",
"sectionID": "SP2",
"hyperlink": "https://cornucopia.owasp.org/edition/eop/SP2/5.0/en",
"links": [],
"tags": [
"Threat modeling",
"Elevation of Privilege"
],
"tooltype": "Defensive"
},
...
]
}The Note: this branch is based on the M2 branch (#3181) since it needs the eop deck registration. I'll rebase onto master once M2 is merged. |
Yes, this is acceptable. Are we able to get it in Spanish and Russian as well? |
Signed-off-by: Ayman Algamal <ayman01287985950@gmail.com>
Done! Companion
DBD
Should those be fixed too? |
Signed-off-by: Ayman Algamal <ayman01287985950@gmail.com>
…d schema for LanguageMetaEop Signed-off-by: Ayman Algamal <ayman01287985950@gmail.com>
to provide information about supported languages for the EoP edition. Signed-off-by: Ayman Algamal <ayman01287985950@gmail.com>
Signed-off-by: Ayman Algamal <ayman01287985950@gmail.com>
Signed-off-by: Ayman Algamal <ayman01287985950@gmail.com>
d55b147 to
d837d96
Compare
…edition Signed-off-by: Ayman Algamal <ayman01287985950@gmail.com>
Signed-off-by: Ayman Algamal <ayman01287985950@gmail.com>
Signed-off-by: Ayman Algamal <ayman01287985950@gmail.com>
Signed-off-by: Ayman Algamal <ayman01287985950@gmail.com>
…owser/m3-eop-api-endpoints
…owser/m3-eop-api-endpoints
Description
GET /api/cre/eop/enis the endpoint mentioned there for adding the Elevation of Privilege game to Threat Dragon's EoP Games diagram.Changes
Feature 1: EoP API endpoints
GET /api/lang/eop/{version}
Returns the supported languages for an EoP deck version. The route is generic and already works, so no code change was needed for this endpoint, only tests were added (Feature 4).
GET /api/cre/eop/{lang}
Returns all 78 EoP cards with their codes, descriptions and card page links. This is the endpoint OWASP/threat-dragon#1448 will consume.
src/routes/api/cre/[edition]/[lang]/+server.ts: addedeopto the editions allowlistsrc/domain/cre/creController.ts: addedeopto the editions map as "Elevation of Privilege Edition" and the category map as "Elevation of Privilege"GET /api/cre/eop
Returns the eop edition metadata (name, languages, latest version). The route is generic and already works.
GET /api/mapping/eop/{version}
Returns the per-card STRIDE mappings (stride, stride_print, url). The route is generic and already works.
Feature 2: Spanish and Russian translations
The eop translations already existed in
source/, so registering them was enough:/api/lang/eop/5.0now returns["en", "es", "ru"]and/api/cre/eop/{lang}serves all three languages.src/lib/services/deckService.ts: addedesandruto the eop entries inlatestsanddeckssrc/domain/suit/suitController.ts: addedesandruto the eop entry in the languages mapFeature 3: API docs
Documented the EoP endpoints at /api/docs, all in
static/api/openapi.yaml:/lang/eop/{version}: new entry with theLanguageMetaEopschema/cre/eop/{lang}: new entry, noting the emptylinksas EoP has no Open CRE mappings/mapping/eop/{version}: new entry for the generic mapping route/lang/{edition}/{version}: addedeopto the edition enumLanguageMetaCompanionschema and the API description string, which had only mentioned the Website App and Mobile App editionsFeature 4: Tests
Mimicking the existing webapp endpoint tests:
src/routes/api/lang/[edition]/[version]/server.test.ts: response test for/api/lang/eop/5.0src/routes/api/cre/[edition]/[lang]/server.test.ts: response test for/api/cre/eop/ensrc/lib/services/deckService.test.ts: updated the eop languages tests after providing the new languagesScreenshots:
Notes
Resolved or fixed issue: none (partial progress on #1322)
AI Tool Disclosure
[e.g. GitHub CoPilot, ChatGPT, JetBrains Junie etc.][e.g. GPT-4.1, Claude Haiku 4.5, Gemini 2.5 Pro etc.][Summarize the key prompts or instructions given to the AI tools]Affirmation