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

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

Merged
merged 2 commits into from
Oct 18, 2021
Merged

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

merged 2 commits into from
Oct 18, 2021

Conversation

hexiro
Copy link
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

codecov-commenter commented Oct 17, 2021

Codecov Report

Merging #215 (1083b4b) into main (e2e109e) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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              
Impacted Files Coverage Δ
tests/test_regex_database.py 88.88% <100.00%> (+1.38%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e2e109e...1083b4b. Read the comment docs.

@bee-san
Copy link
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