File tree Expand file tree Collapse file tree
application/utils/external_project_parsers/parsers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515class Cheatsheets (ParserInterface ):
1616 name = "OWASP Cheat Sheets"
17+ cheatsheetseries_base_url = "https://cheatsheetseries.owasp.org/cheatsheets"
1718
1819 def cheatsheet (
1920 self , section : str , hyperlink : str , tags : List [str ]
@@ -25,6 +26,10 @@ def cheatsheet(
2526 hyperlink = hyperlink ,
2627 )
2728
29+ def official_cheatsheet_url (self , markdown_filename : str ) -> str :
30+ html_name = os .path .splitext (markdown_filename )[0 ] + ".html"
31+ return f"{ self .cheatsheetseries_base_url } /{ html_name } "
32+
2833 def parse (self , cache : db .Node_collection , ph : prompt_client .PromptHandler ):
2934 c_repo = "https://github.com/OWASP/CheatSheetSeries.git"
3035 cheatsheets_path = "cheatsheets/"
@@ -55,7 +60,7 @@ def register_cheatsheets(
5560 name = title .group ("title" )
5661 cre_id = cre .group ("cre" )
5762 cres = cache .get_CREs (external_id = cre_id )
58- hyperlink = f" { repo_path . replace ( '.git' , '' ) } /tree/master/ { cheatsheets_path } { mdfile } "
63+ hyperlink = self . official_cheatsheet_url ( mdfile )
5964 cs = self .cheatsheet (section = name , hyperlink = hyperlink , tags = [])
6065 for cre in cres :
6166 cs .add_link (
You can’t perform that action at this time.
0 commit comments