okta-jwt-verifier-php icon indicating copy to clipboard operation
okta-jwt-verifier-php copied to clipboard

Types and improvements

Open ctrl-f5 opened this issue 4 years ago • 4 comments

Build on https://github.com/okta/okta-jwt-verifier-php/pull/61 and adds some additional improvements. Separated in a new PR because they are not all BC (if people have extended classes they must also add the new type info).

  • renamed DiscoveryMethodInterface to DiscoveryMethod analog to how Adaptor is set up
  • extracted server config (issuer, metadata and jwks loading) from verifier
  • added unit tests for almost every class, including ssl certificate parsing
  • added namespacing for unit tests
  • added type info where possible, added docblocks where possible
  • consistent spaces in if and foreach
  • added docker file to run tests locally
  • updated README

ctrl-f5 avatar Nov 17 '20 12:11 ctrl-f5

Codecov Report

Merging #62 (3c06483) into develop (e432999) will increase coverage by 59.07%. The diff coverage is 92.70%.

Impacted file tree graph

@@              Coverage Diff               @@
##             develop      #62       +/-   ##
==============================================
+ Coverage      33.77%   92.85%   +59.07%     
- Complexity        98      110       +12     
==============================================
  Files              9       10        +1     
  Lines            225      238       +13     
==============================================
+ Hits              76      221      +145     
+ Misses           149       17      -132     
Impacted Files Coverage Δ Complexity Δ
src/Server/Discovery/Oauth.php 100.00% <ø> (ø) 1.00 <0.00> (?)
src/Adaptor/AutoDiscover.php 66.66% <50.00%> (ø) 4.00 <0.00> (?)
src/Adaptor/FirebasePhpJwt.php 84.50% <84.61%> (ø) 26.00 <26.00> (?)
src/Server/DefaultServer.php 91.17% <91.17%> (ø) 18.00 <18.00> (?)
src/Jwt.php 95.23% <93.75%> (+95.23%) 11.00 <7.00> (ø)
src/JwtVerifier.php 100.00% <100.00%> (+63.41%) 19.00 <16.00> (-3.00) :arrow_up:
src/JwtVerifierBuilder.php 100.00% <100.00%> (+32.00%) 19.00 <15.00> (ø)
src/Request.php 100.00% <100.00%> (ø) 9.00 <0.00> (ø)
src/Server/Discovery/DefaultDiscovery.php 100.00% <100.00%> (ø) 2.00 <2.00> (?)
src/Server/Discovery/Oidc.php 100.00% <100.00%> (ø) 1.00 <1.00> (?)
... and 5 more

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 e432999...3c06483. Read the comment docs.

codecov-io avatar Nov 17 '20 13:11 codecov-io

Thank you for the PR, we would need to have you sign a cla for this to be merged in after we do our internal review.

You can begin the cla process now by visiting developer.okta.com/cla

bretterer avatar Nov 17 '20 15:11 bretterer

I have sent in the CLA, not sure how it will be linked to my github account though

ctrl-f5 avatar Nov 18 '20 09:11 ctrl-f5

Thanks @ctrl-f5 we manage the CLA's externally right now. I see the CLA and will add this PR to our tasks to look at and possibly be merged in

bretterer avatar Nov 19 '20 13:11 bretterer