From bc6ea310236970443ec5f3c2e6d967615c581f13 Mon Sep 17 00:00:00 2001 From: Johan Sydseter Date: Mon, 3 Jun 2024 13:24:42 +0200 Subject: [PATCH 1/3] Adding tarot as a template for the leaflet. --- .github/workflows/pre-release.yml | 3 +-- .github/workflows/release.yml | 5 ++--- scripts/convert.py | 3 --- tests/scripts/convert_utest.py | 4 ++-- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 154ce035..d7505d0c 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -81,11 +81,10 @@ title: "Latest pre-release" files: | CHANGELOG.md - LICENSE LICENSE.md README.md creative-commons-attribution-3.0.txt - output/owasp_cornucopia_mobileapp_1.00.zip + output/owasp_cornucopia_mobileapp_1.00_en.zip output/owasp_cornucopia_webapp_1.22_en.zip output/owasp_cornucopia_webapp_1.22_es.zip output/owasp_cornucopia_webapp_1.22_fr.zip diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 548b17d0..ffeec066 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -65,7 +65,7 @@ run: pipenv run coverage xml - name: Check test coverage - Report run: pipenv run coverage report --fail-under 85 scripts/convert* - - name: Generate new output files + - name: Generate new output file run: | pipenv run python scripts/convert.py -l all -lt all -t bridge -v 1.22 -e webapp pipenv run python scripts/convert.py -l all -lt all -t tarot -v 1.22 -e webapp @@ -94,11 +94,10 @@ prerelease: false files: | CHANGELOG.md - LICENSE LICENSE.md README.md creative-commons-attribution-3.0.txt - output/owasp_cornucopia_mobileapp_1.00.zip + output/owasp_cornucopia_mobileapp_1.00_en.zip output/owasp_cornucopia_webapp_1.22_en.zip output/owasp_cornucopia_webapp_1.22_es.zip output/owasp_cornucopia_webapp_1.22_fr.zip diff --git a/scripts/convert.py b/scripts/convert.py index 41b5c625..c503a9ee 100644 --- a/scripts/convert.py +++ b/scripts/convert.py @@ -804,9 +804,6 @@ def get_valid_mapping_for_version(version: str, edition: str) -> str: def get_valid_templates() -> List[str]: templates = [] - if convert_vars.args.layout.lower() in "leaflet": - templates.append("bridge") - return templates if convert_vars.args.template.lower() == "all": for template in [t for t in convert_vars.TEMPLATE_CHOICES if t not in ("all", "bridge_qr")]: templates.append(template) diff --git a/tests/scripts/convert_utest.py b/tests/scripts/convert_utest.py index cd428200..52959910 100644 --- a/tests/scripts/convert_utest.py +++ b/tests/scripts/convert_utest.py @@ -113,7 +113,7 @@ def test_get_valid_style_choices_dynamic(self) -> None: def test_get_valid_style_choices_blank(self) -> None: c.convert_vars.args = argparse.Namespace(template="", layout="") - want_template = ["bridge"] + want_template = ["bridge", "tarot"] got_template = c.get_valid_templates() self.assertListEqual(want_template, got_template) @@ -127,7 +127,7 @@ def test_get_valid_style_choices_all(self) -> None: def test_get_valid_style_choices_for_leaflet(self) -> None: c.convert_vars.args = argparse.Namespace(template="all", layout="leaflet") - want_template = ["bridge"] + want_template = ["bridge", "tarot"] got_template = c.get_valid_templates() self.assertListEqual(want_template, got_template) From 9445b0395e6526f68c134437bf8b0798ad922264 Mon Sep 17 00:00:00 2001 From: "pixeebot[bot]" <104101892+pixeebot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 11:29:51 +0000 Subject: [PATCH 2/3] Remove Unnecessary F-strings --- scripts/convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/convert.py b/scripts/convert.py index c503a9ee..81f6ae4c 100644 --- a/scripts/convert.py +++ b/scripts/convert.py @@ -445,7 +445,7 @@ def get_mapping_data_for_edition( """Get the raw data of the replacement text from correct yaml file""" data: Dict[Any, Dict[Any, Any]] = {} logging.debug( - f" --- Starting get_mapping_data_for_edition() for edition: " + " --- Starting get_mapping_data_for_edition() for edition: " f"{edition} , language: {language} and version: {version} " f" with mapping to version {get_valid_mapping_for_version(version, edition)}" ) From 0f82fe9bbcda7b74784aa31d4f9e5e312f2d51e5 Mon Sep 17 00:00:00 2001 From: Johan Sydseter Date: Mon, 3 Jun 2024 13:39:26 +0200 Subject: [PATCH 3/3] In copi the suits need to match to be injectable, change to all caps in order to make it so. --- source/webapp-mappings-2.00.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/webapp-mappings-2.00.yaml b/source/webapp-mappings-2.00.yaml index 9859304a..ba27c189 100644 --- a/source/webapp-mappings-2.00.yaml +++ b/source/webapp-mappings-2.00.yaml @@ -9,7 +9,7 @@ meta: languages: ["en", "es", "fr", "nl", "nl", "no-nb", "pt-br"] suits: - - name: "Data Validation & Encoding" + name: "DATA VALIDATION & ENCODING" cards: - id: "DV2" @@ -108,7 +108,7 @@ suits: capec: [ 23, 28, 76, 152, 160, 261 ] safecode: [ 2, 19, 20 ] - - name: "Authentication" + name: "AUTHENTICATION" cards: - id: "AC2" @@ -207,7 +207,7 @@ suits: capec: [ 115, 207, 554 ] safecode: [ 14, 28 ] - - name: "Session Management" + name: "SESSION MANAGEMENT" cards: - id: "SM2" @@ -306,7 +306,7 @@ suits: capec: [ 21 ] safecode: [ 14, 28 ] - - name: "Authorization" + name: "AUTHORIZATION" cards: - id: "AZ2" @@ -405,7 +405,7 @@ suits: capec: [ 207, 554 ] safecode: [ 8, 10, 11 ] - - name: "Cryptography" + name: "CRYPTOGRAPHY" cards: - id: "CR2" @@ -504,7 +504,7 @@ suits: capec: [ 207, 554 ] safecode: [ 14, 21, 29 ] - - name: "Cornucopia" + name: "CORNUCOPIA" cards: - id: "CO2"