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

Added support for Notion Notes and API keys #177

Merged
merged 12 commits into from
Oct 8, 2021
36 changes: 36 additions & 0 deletions pywhat/Data/regex.json
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,30 @@
"AWS"
]
},
{
"Name": "Notion Note URI",
"Regex": "(?i)^(https:\/\/www\\.notion\\.so\/[A-Za-z0-9-_]+\/.*-[0-9a-f]{32})$",
"plural_name": false,
"Description": null,
"Rarity": 1,
"URL": null,
"Tags": [
"Bug Bounty",
"URL"
]
},
{
"Name": "Notion Team Note URI",
"Regex": "(?i)^(https:\/\/[A-Za-z0-9-_]+\\.notion\\.site\/.*-[0-9a-f]{32})$",
"plural_name": false,
"Description": null,
"Rarity": 1,
"URL": null,
"Tags": [
"Bug Bounty",
"URL"
]
},
{
"Name": "Nano (NANO) Wallet Address",
"Regex": "^((nano|xrb)_[13]{1}[1a-km-z3-9]{59})$",
Expand Down Expand Up @@ -906,6 +930,18 @@
"Credentials"
]
},
{
"Name": "Notion Integration Token",
"Regex": "(?i)^((secret_)([a-zA-Z0-9]{43}))$",
"plural_name": false,
"Description": "A Notion API integration's internal integration token.",
"Rarity": 0.8,
"URL": "https://www.notion.so/",
alb marked this conversation as resolved.
Show resolved Hide resolved
"Tags": [
"Credentials",
"API Keys"
]
bee-san marked this conversation as resolved.
Show resolved Hide resolved
},
{
"Name": "Internet Protocol (IP) Address Version 6",
"Regex": "^((?=.*[0-9])\\[?(?:(?:[0-9a-f]{1,4}:){7,7}[0-9a-f]{1,4}|([0-9a-f]{4}:){1,7}:|([0-9a-f]{1,4}:){1,6}:[0-9a-f]{1,4}|([0-9a-f]{1,4}:){1,5}(:[0-9a-f]{1,4}){1,2}|([0-9a-f]{1,4}:){1,4}(:[0-9a-f]{1,4}){1,3}|([0-9a-f]{1,4}:){1,3}(:[0-9a-f]{1,4}){1,4}|([0-9a-fA]{1,4}:){1,2}(:[0-9a-f]{1,4}){1,5}|[0-9a-f]{1,4}:((:[0-9a-f]{1,4}){1,6})|:((:[0-9a-f]{1,4}){1,7}|:)|fe80:(:[0-9a-f]{0,4}){0,4}%[0-9a-z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|(?:[0-9a-f]{1,4}:){1,4}:(?:(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(?:2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\\]?(?::[0-9]{1,5})?)$",
Expand Down
21 changes: 21 additions & 0 deletions tests/test_regex_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,22 @@ def test_google_cal():
assert "Google Calendar URI" in str(res)


def test_notion_note():
res = r.check(
["https://www.notion.so/test-user/My-Note-fa45346d9dd4421abc6857ce2e7fb0db"]
)
assert "Notion Note URI" in str(res)


def test_notion_team_note():
res = r.check(
[
"https://testorganization.notion.site/My-Note-ha45346d9dd4421abc6857ce4e7fb0db"
]
)
assert "Notion Team Note URI" in str(res)


def test_aws_access_key_id():
res = r.check(["AKIA31OMZKYAARWZ3ERH"])
_assert_match_first_item("Amazon Web Services Access Key", res)
Expand Down Expand Up @@ -713,6 +729,11 @@ def test_slack_token():
)


def test_notion_integration_token():
res = r.check(["secret_n2ZeRrMx743JQ5wiucZ0DBEe47opfKubUp22N0wIrOy"])
_assert_match_first_item("Notion Integration Token", res)


def test_pgp_public_key():
res = r.check(
[
Expand Down