Skip to main content
Tweeted twitter.com/StackCodeReview/status/1345429671534616578
JWT isn't the Java Windowing Toolkit, in this context! Also fix some spelling and grammar, and inline the links
Source Link
Toby Speight
  • 81.7k
  • 14
  • 101
  • 308

Edit: this is a base library for including in larger projects for the overall management of JWT tokensJSON Web Tokens (JWT) that should be compatible with other JWT libraries that share an encryption secret --also also remote systems can reach out to the issuing system (with my library or a different JWT library) to verify the token works. The encryption "secret" thing is the crux of the matter...: you can't encode, modify, or verify without it, regardless of the library.

This is my first time posting here. This is so "reinventing the wheel" but, but somewhat an earnest thing I wanted to try, and a representative sample of where I am at in this skill. I would be grateful for any comments or suggestions that might make me a better developer tomorrow.

The code coverage is 100%, mostly as a good start for letting me know if I specifically broke broke something when I modify the code-  - specifically one of the things I would like to improve next year (tomorrow... as today is 2020-12-31) is expectingto be able to expect a specific RuntimeExceptionRuntimeException message, telling me that I am triggering the specific predicted runtime exception when I expect that I should get an exception in a particular place in the code.


There's a GitHub repo, and a 20-minute Youtube video of stepping through the tests.

The github link: https://github.com/bradchesney79/effortless-hs256-jwt(you shouldn't need a video to see how it works. ... And you don't. I just included it to be helpful as I believe more people have access to youtube than phpunit.)

A 20 minute Youtube video of stepping through the tests: https://youtu.be/lx1FYXB6fB4


Edit: Someone had expressed that you shouldn't need a video to see how it works. ...And you don't. I just included it to be helpful as I believe more people have access to youtube than phpunit.


 

I know revocation storage and handling is not part of JWT officially-  - but, I wanted it, so I baked it in, complete with an SQL table creation script.

Edit: this is a base library for including in larger projects for the overall management of JWT tokens that should be compatible with other JWT libraries that share an encryption secret --also remote systems can reach out to the issuing system (with my library or a different JWT library) to verify the token works. The encryption "secret" thing is the crux of the matter... can't encode, modify, or verify without it regardless of the library.

This is my first time posting here. This is so "reinventing the wheel" but, somewhat an earnest thing I wanted to try and a representative sample of where I am at in this skill. I would be grateful for any comments or suggestions that might make me a better developer tomorrow.

The code coverage is 100%, mostly as a good start for letting me know if I specifically broke something when I modify the code-- specifically one of the things I would like to improve next year (tomorrow... as today is 2020-12-31) is expecting a specific RuntimeException message telling me that I am triggering the specific predicted runtime exception when I expect that I should get an exception in a particular place in the code.

The github link: https://github.com/bradchesney79/effortless-hs256-jwt

A 20 minute Youtube video of stepping through the tests: https://youtu.be/lx1FYXB6fB4


Edit: Someone had expressed that you shouldn't need a video to see how it works. ...And you don't. I just included it to be helpful as I believe more people have access to youtube than phpunit.


I know revocation storage and handling is not part of JWT officially-- but, I wanted it, so I baked it in complete with an SQL table creation script.

Edit: this is a base library for including in larger projects for the overall management of JSON Web Tokens (JWT) that should be compatible with other JWT libraries that share an encryption secret - also remote systems can reach out to the issuing system (with my library or a different JWT library) to verify the token works. The encryption "secret" thing is the crux of the matter: you can't encode, modify, or verify without it, regardless of the library.

This is my first time posting here. This is "reinventing the wheel", but somewhat an earnest thing I wanted to try, and a representative sample of where I am at in this skill. I would be grateful for any comments or suggestions that might make me a better developer tomorrow.

The code coverage is 100%, mostly as a good start for letting me know if I broke something when I modify the code  - one of the things I would like to improve next year (tomorrow... as today is 2020-12-31) is to be able to expect a specific RuntimeException message, telling me that I am triggering the specific predicted runtime exception when I expect that I should get an exception in a particular place in the code.


There's a GitHub repo, and a 20-minute Youtube video of stepping through the tests.

(you shouldn't need a video to see how it works. ... And you don't. I just included it to be helpful as I believe more people have access to youtube than phpunit.)

 

I know revocation storage and handling is not part of JWT officially  - but, I wanted it, so I baked it in, complete with an SQL table creation script.

Removed concerns from title -- title should describe the code's functionality/purpose
Link
mickmackusa
  • 8.7k
  • 1
  • 16
  • 31

A reinventng the wheel PHP JWT management base library for inclusion in larger projects presented for ridicule, tar, & feathering

[Edit removed during grace period]; added 221 characters in body
Source Link
 

Edit: Someone had expressed that you shouldn't need a video to see how it works. ...And you don't. I just included it to be helpful as I believe more people have access to youtube than phpunit.


 

Edit: Someone had expressed that you shouldn't need a video to see how it works. ...And you don't. I just included it to be helpful as I believe more people have access to youtube than phpunit.


edited title
Link
Loading
added 448 characters in body
Source Link
Loading
Source Link
Loading