From 08f5f789479fef7ee099fb3789c5c09f68ba68bd Mon Sep 17 00:00:00 2001 From: spicyyboi <34308782+spicyyboi@users.noreply.github.com> Date: Mon, 25 Oct 2021 18:36:32 +0200 Subject: [PATCH 1/2] Update Mailchimp with example tokens --- pywhat/Data/regex.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pywhat/Data/regex.json b/pywhat/Data/regex.json index 0318227..25a67b0 100644 --- a/pywhat/Data/regex.json +++ b/pywhat/Data/regex.json @@ -1330,7 +1330,7 @@ "Regex": "(?i)^([0-9a-f]{32}-us[0-9]{1,2})$", "plural_name": false, "Description": null, - "Exploit": "Use the command below to verify that the API key is valid:\n $ curl --request GET --url 'https://.api.mailchimp.com/3.0/' --user 'anystring:API_KEY_HERE' --include\n", + "Exploit": "Use the command below to verify that the API key is valid (substitute for your datacenter, i. e. us5):\n $ curl --request GET --url 'https://.api.mailchimp.com/3.0/' --user 'anystring:API_KEY_HERE' --include\n", "Rarity": 0.8, "URL": null, "Tags": [ @@ -1338,7 +1338,15 @@ "API Keys", "Credentials", "Mailchimp" - ] + ], + "Examples": { + "Valid": [ + "d619ce3b691e29ec064fede7ff9afbff-us5", + "4bf6010e49fb0791f3940681791934e7-us5", + "a80122b2565c3e26a61cbf58d1d1aad7-us5" + ], + "Invalid": [] + } }, { "Name": "Notion Integration Token", From 1e340f2c059338d4131f0475feb262ce43014b9b Mon Sep 17 00:00:00 2001 From: spicyyboi <34308782+spicyyboi@users.noreply.github.com> Date: Mon, 25 Oct 2021 18:44:52 +0200 Subject: [PATCH 2/2] Add Mailchimp to test fixture --- fixtures/file | 2 ++ tests/test_click.py | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/fixtures/file b/fixtures/file index 9824d5b..99df774 100644 --- a/fixtures/file +++ b/fixtures/file @@ -101,3 +101,5 @@ https://hooks.slack.com/services/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 doi:10.1392/BC1.0 10.1000/123 + +a80122b2565c3e26a61cbf58d1d1aad7-us5 diff --git a/tests/test_click.py b/tests/test_click.py index 15779ba..cdaf5ec 100644 --- a/tests/test_click.py +++ b/tests/test_click.py @@ -357,6 +357,13 @@ def test_file_fixture_doi(): assert re.findall("DOI", str(result.output)) +def test_file_fixture_mailchimp(): + runner = CliRunner() + result = runner.invoke(main, ["-db", "fixtures/file"]) + assert result.exit_code == 0 + assert re.findall("Mailchimp", str(result.output)) + + def test_file_cors(): runner = CliRunner() result = runner.invoke(main, ["-db", "Access-Control-Allow: *"])