Skip to content

Remove duplicate regexes, add test to spot duplicate regexes#215

Merged
bee-san merged 2 commits intobee-san:mainfrom
hexiro:Hexiro-patch-2
Oct 18, 2021
Merged

Remove duplicate regexes, add test to spot duplicate regexes#215
bee-san merged 2 commits intobee-san:mainfrom
hexiro:Hexiro-patch-2

Conversation

@hexiro
Copy link
Copy Markdown
Contributor

@hexiro hexiro commented Oct 17, 2021

Prerequisites

Why do we need this pull request?

Adds a test to check for duplicate regexes by name. This is useful to prevent someone from adding a regex for something that already exists. Though, this might not always work out because the names need to be an exact match.
This also deletes one of the duplicate regexes.

What GitHub issues does this fix?

Copy / paste of output

Please copy and paste the output of PyWhat with your new addition using an example that tests this addition below:

Gets rid of second match

Matched on: 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:test@github.com
Name: GitHub Access Token
Exploit: Use the command below to verify that the access token is valid:
  $ curl -s -u "user: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:test@github.com" https://api.github.com/user
  curl -s -H "Authorization: token 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:test@github.com" "https://api.github.com/users/[USERNAME]/orgs"
 . # Check scope of your api token
 $  curl "https://api.github.com/rate_limit" -i -u "user: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:test@github.com" | grep "X-OAuth-Scopes:"


Matched on: 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
Name: GitHub Personal Access Token
Exploit: Use the command below to verify that the access token is valid:
  $ curl -s -u "user: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" https://api.github.com/user
  curl -s -H "Authorization: token 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" "https://api.github.com/users/[USERNAME]/orgs"
 . # Check scope of your api token
 $  curl "https://api.github.com/rate_limit" -i -u "user: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" | grep "X-OAuth-Scopes:"


Matched on: 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:test@github.com
Name: Uniform Resource Locator (URL)

Matched on: test@github.com
Name: Email Address

Matched on: R4kszbsOnupGqTEGPx4mYQmeeaAIAC33tH
Name: Ripple (XRP) Wallet Address
Link:  https://xrpscan.com/account/R4kszbsOnupGqTEGPx4mYQmeeaAIAC33tH

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Oct 17, 2021

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.37%. Comparing base (e2e109e) to head (1083b4b).
⚠️ Report is 98 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #215      +/-   ##
==========================================
+ Coverage   92.35%   92.37%   +0.02%     
==========================================
  Files          14       14              
  Lines        1203     1207       +4     
==========================================
+ Hits         1111     1115       +4     
  Misses         92       92              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bee-san
Copy link
Copy Markdown
Owner

bee-san commented Oct 18, 2021

thanks so much!!!

@bee-san bee-san merged commit d6c6c00 into bee-san:main Oct 18, 2021
@hexiro hexiro deleted the Hexiro-patch-2 branch October 18, 2021 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

duplicate entries in regex.json

3 participants