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

Improve JWT RegExp #236

Merged
2 commits merged into from Dec 3, 2021
Merged

Improve JWT RegExp #236

2 commits merged into from Dec 3, 2021

Conversation

nodtem66
Copy link
Contributor

@nodtem66 nodtem66 commented Dec 1, 2021

Prerequisites

Why do we need this pull request?

What GitHub issues does this fix?

Copy / paste of output

shell:~$ poetry run what cm.8.
Nothing found!
shell:~$ poetry run what yaJhbGciOiJIUzI1NiJ9.e30.4E_Bsx-pJi3kOW9wVXN8CgbATwP09D9V5gxh9-9zSZ0
Nothing found!
shell:~$ poetry run what eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Matched on: MjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG
Name: Litecoin (LTC) Wallet Address
Link:  https://live.blockcypher.com/ltc/address/MjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG

Matched on: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDI
yfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Name: JSON Web Token (JWT)

@codecov-commenter
Copy link

codecov-commenter commented Dec 1, 2021

Codecov Report

Merging #236 (6cc0765) into main (d5ea9ce) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #236   +/-   ##
=======================================
  Coverage   92.60%   92.60%           
=======================================
  Files          15       15           
  Lines        1217     1217           
=======================================
  Hits         1127     1127           
  Misses         90       90           

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 d5ea9ce...6cc0765. Read the comment docs.

@ghost ghost requested a review from amadejpapez December 1, 2021 10:35
@ghost ghost enabled auto-merge December 2, 2021 14:18
@bee-san
Copy link
Owner

bee-san commented Dec 2, 2021

Mind squashing the commits and a better commit message / PR title please? 🥺
Screenshot 2021-12-02 at 16 12 13

@nodtem66 nodtem66 changed the title Fixed #211 Improve JWT RegExp Dec 3, 2021
- add new RegExp for JWT that check header and payload length and prefix
  `eyJ` and `e`
- add valid/invalid examples
- This idea comes from observing that the minimum length of each parts of JWT is 20, 3, 43, respectively
```
Header
{"alg":"HS256"}
Payload
{}
```
-
auto-merge was automatically disabled December 3, 2021 06:31

Head branch was pushed to by a user without write access

@ghost ghost merged commit 1e843aa into bee-san:main Dec 3, 2021
This pull request was closed.
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.

JSON Web Token (JWT) matches incorrectly
4 participants