Skip to content

Commit

Permalink
Added support for Notion Notes and API keys (#177)
Browse files Browse the repository at this point in the history
* Added support for Notion notes and API keys

* Added support for team notes

Co-authored-by: Bee <github@skerritt.blog>
  • Loading branch information
alb and bee-san authored Oct 8, 2021
1 parent 29070e7 commit 61bf3f7
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
37 changes: 37 additions & 0 deletions pywhat/Data/regex.json
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,30 @@
"Amazon"
]
},
{
"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 @@ -978,6 +1002,19 @@
"Mailchimp"
]
},
{
"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": null,
"Tags": [
"Credentials",
"API Keys",
"Bug Bounty"
]
},
{
"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
19 changes: 19 additions & 0 deletions tests/test_regex_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,20 @@ 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://testorg.notion.site/My-Note-9f8863871e024ea6acc64d6564004a22"]
)
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 @@ -768,6 +782,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

0 comments on commit 61bf3f7

Please sign in to comment.