Skip to content

Commit

Permalink
Show MASVS v1 IDs in the tests teables (#2522)
Browse files Browse the repository at this point in the history
* add masvs v1 IDs to tests table

* Refactor column_titles and masvs_v1_id formatting in populate_dynamic_pages.py
  • Loading branch information
cpholguera authored Feb 2, 2024
1 parent 80c64ce commit 6bfdaf8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/scripts/populate_dynamic_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def reorder_dict_keys(original_dict, key_order):

# tests/index.md

column_titles = {'id': 'ID', 'title': 'Name', 'masvs_v2_id': "MASVS ID", 'last_updated': 'Last Updated'} #'id': 'ID', ... , 'refs': 'Refs', 'techniques': 'Techniques'
column_titles = {'id': 'ID', 'title': 'Name', 'masvs_v2_id': "MASVS v2 ID", 'masvs_v1_id': "MASVS v1 IDs"} #'id': 'ID', ... , 'refs': 'Refs', 'techniques': 'Techniques', 'last_updated': 'Last Updated'

tests = get_mastg_components_dict("docs/MASTG/tests")
test_types = ["android", "ios"]
Expand All @@ -87,6 +87,8 @@ def reorder_dict_keys(original_dict, key_order):
tests_of_type = [reorder_dict_keys(test, column_titles.keys()) for test in tests if test['platform'] == test_type]
for test in tests_of_type:
test['masvs_v2_id'] = test['masvs_v2_id'][0]
if test.get("masvs_v1_id"):
test['masvs_v1_id'] = "<br>".join([f"{v1_id}" for v1_id in test['masvs_v1_id']])


for group_id, checklist in CHECKLIST_DICT.items():
Expand Down

0 comments on commit 6bfdaf8

Please sign in to comment.