Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex Tests: Added Hawk API test and Fixed Discord WebHook Regex #173

Merged
merged 2 commits into from
Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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