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

useJWT plugin: allow overriding any JwksClient options #3182

Merged
merged 3 commits into from
May 17, 2024

Conversation

bgentry
Copy link
Contributor

@bgentry bgentry commented Feb 5, 2024

I noticed the JwksClient from jwks-rsa has quite a few options which are not made available in the useJWT config properties. For my particular use case, I was wanting access to getKeysInterceptor so that I could intercept jwks loading in my test suite.

However, rather than attempt to add support for just one or all of these options, I thought it would be best to allow the user to specify any of these client options by directly referencing its type and merging those props with the props passed to the JwksClient constructor.

I wasn't clear on whether I could easily add test coverage for this, because it doesn't appear that any of the coverage is directly using a real jwks setup atm.

Copy link

changeset-bot bot commented Feb 5, 2024

🦋 Changeset detected

Latest commit: e6a6800

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@graphql-yoga/plugin-jwt Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@EmrysMyrddin EmrysMyrddin merged commit 8663e78 into dotansimha:main May 17, 2024
25 checks passed
Copy link
Contributor

✅ Benchmark Results

     ✓ no_errors{mode:graphql}
     ✓ expected_result{mode:graphql}
     ✓ no_errors{mode:graphql-jit}
     ✓ expected_result{mode:graphql-jit}
     ✓ no_errors{mode:graphql-response-cache}
     ✓ expected_result{mode:graphql-response-cache}
     ✓ no_errors{mode:graphql-no-parse-validate-cache}
     ✓ expected_result{mode:graphql-no-parse-validate-cache}

     checks.......................................: 100.00% ✓ 404424      ✗ 0     
     data_received................................: 1.7 GB  14 MB/s
     data_sent....................................: 82 MB   680 kB/s
     http_req_blocked.............................: avg=1.43µs   min=1.01µs   med=1.3µs    max=263.24µs p(90)=1.88µs   p(95)=2.07µs  
     http_req_connecting..........................: avg=2ns      min=0s       med=0s       max=141.5µs  p(90)=0s       p(95)=0s      
     http_req_duration............................: avg=382.38µs min=215.05µs med=337.72µs max=23.69ms  p(90)=537.4µs  p(95)=557.28µs
       { expected_response:true }.................: avg=382.38µs min=215.05µs med=337.72µs max=23.69ms  p(90)=537.4µs  p(95)=557.28µs
     ✓ { mode:graphql-jit }.......................: avg=287.9µs  min=215.05µs med=266.94µs max=18.23ms  p(90)=297.01µs p(95)=308.9µs 
     ✓ { mode:graphql-no-parse-validate-cache }...: avg=564.35µs min=472.86µs med=536.73µs max=12.14ms  p(90)=579.6µs  p(95)=617.26µs
     ✓ { mode:graphql-response-cache }............: avg=361.29µs min=287.6µs  med=341.2µs  max=16.66ms  p(90)=372.91µs p(95)=383.38µs
     ✓ { mode:graphql }...........................: avg=378.49µs min=288.44µs med=344.7µs  max=23.69ms  p(90)=390.7µs  p(95)=432.25µs
     http_req_failed..............................: 0.00%   ✓ 0           ✗ 202212
     http_req_receiving...........................: avg=32.89µs  min=16.53µs  med=33.05µs  max=836.46µs p(90)=38.26µs  p(95)=40.35µs 
     http_req_sending.............................: avg=8.04µs   min=5.89µs   med=7.18µs   max=1.16ms   p(90)=10.64µs  p(95)=11.32µs 
     http_req_tls_handshaking.....................: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting.............................: avg=341.43µs min=186.36µs med=297.61µs max=23.54ms  p(90)=495.96µs p(95)=513.68µs
     http_reqs....................................: 202212  1685.076109/s
     iteration_duration...........................: avg=588.57µs min=387.34µs med=540.42µs max=24.37ms  p(90)=746.03µs p(95)=770.13µs
     iterations...................................: 202212  1685.076109/s
     vus..........................................: 1       min=1         max=1   
     vus_max......................................: 2       min=2         max=2   

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.

None yet

2 participants