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 1515
1616class Cheatsheets (ParserInterface ):
1717 name = "OWASP Cheat Sheets"
18+ cheatsheetseries_base_url = "https://cheatsheetseries.owasp.org/cheatsheets"
1819
1920 def cheatsheet (
2021 self , section : str , hyperlink : str , tags : List [str ]
@@ -33,6 +34,10 @@ def cheatsheet(
3334 hyperlink = hyperlink ,
3435 )
3536
37+ def official_cheatsheet_url (self , markdown_filename : str ) -> str :
38+ html_name = os .path .splitext (markdown_filename )[0 ] + ".html"
39+ return f"{ self .cheatsheetseries_base_url } /{ html_name } "
40+
3641 def parse (self , cache : db .Node_collection , ph : prompt_client .PromptHandler ):
3742 c_repo = "https://github.com/OWASP/CheatSheetSeries.git"
3843 cheatsheets_path = "cheatsheets/"
@@ -65,7 +70,7 @@ def register_cheatsheets(
6570 name = title .group ("title" )
6671 cre_id = cre .group ("cre" )
6772 cres = cache .get_CREs (external_id = cre_id )
68- hyperlink = f" { repo_path . replace ( '.git' , '' ) } /tree/master/ { cheatsheets_path } { mdfile } "
73+ hyperlink = self . official_cheatsheet_url ( mdfile )
6974 cs = self .cheatsheet (section = name , hyperlink = hyperlink , tags = [])
7075 for cre in cres :
7176 cs .add_link (
You can’t perform that action at this time.
0 commit comments