Giter Site home page Giter Site logo

Comments (3)

adamjmcgrath avatar adamjmcgrath commented on July 19, 2024

Hi @tzuge - thanks for raising this

Failure to find the key from the jwks endpoint leads to a SigningKeyNotFoundError, and lru-memoizer does not appear to cache this 'no key' result,

This is expected behaviour, otherwise the cache could be filled up with spurious results.

from node-jwks-rsa.

tzuge avatar tzuge commented on July 19, 2024

@adamjmcgrath , could you clarify what you mean by spurious results?

The response coming back with 200 and a body that does not contain the kid is a legitimate result and distinguishable from a response coming back a failure status code. Assuming the caching did account for this, subsequent requests for the kid at the particular url would cache hit with the 'no key' result still subject to cache TTL. Requests that fail would continue to not be cached.

I acknowledge that this might be a pain to change since the error is used for both cases and the memoize lib is quite reasonably not memoizing that.

from node-jwks-rsa.

adamjmcgrath avatar adamjmcgrath commented on July 19, 2024

Hi @tzuge

could you clarify what you mean by spurious results?

Sure, if you cached non existent kids - someone could generate many access tokens with different kid's and quickly fill the cache.

The SDK is not optimised to accept access tokens from the wrong issuer, you'll need to find a way to select the correct issuer based on the request (like the workaround you described)

from node-jwks-rsa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.