Skip to content

Commit

Permalink
Regex Tests: Added Hawk API test and Fixed Discord WebHook Regex (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmostafam committed Oct 5, 2021
1 parent ac0ffeb commit 89797b5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pywhat/Data/regex.json
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@
},
{
"Name": "Discord Webhook",
"Regex": "(?i)^(https://discordapp\\.com/api/webhooks/[0-9]+/[A-Za-z0-9-_]+)$",
"Regex": "(?i)^(https://discord\\.com/api/webhooks/[0-9]+/[A-Za-z0-9-_]+)$",
"plural_name": false,
"Description": null,
"Exploit": null,
Expand Down
14 changes: 14 additions & 0 deletions tests/test_regex_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,11 @@ def test_instapayment():
_assert_match_first_item("Insta Payment Card Number", res)


def test_instapayment():
res = r.check(["hawk.wz6bAoFDwcVQFCD9dofE.w2R1PWI8UTvEM4jd56XQ"])
_assert_match_first_item("StackHawk API Key", res)


def test_jcb_card():
res = r.check(["3537124887293334"])
_assert_match_first_item("JCB Card Number", res)
Expand Down Expand Up @@ -766,6 +771,15 @@ def test_github_personal_access_token():
_assert_match_first_item("GitHub Personal Access Token", res)


def test_discord_webhook():
res = r.check(
[
"https://discord.com/api/webhooks/894893734582452235/KhNc2-_zwY9FfCAK0iGUa_KfYyW8m5Ja_5i-V24fEY6ETwvLLn-GmdT_vq0Do9-YRsij"
]
)
_assert_match_first_item("Discord Webhook", res)


def test_github_oauth_token():
res = r.check(["gho_16C7e42F292c6912E7710c838347Ae178B4a"])
_assert_match_first_item("GitHub OAuth Access Token", res)
Expand Down

0 comments on commit 89797b5

Please sign in to comment.