Git Product home page Git Product logo

Comments (8)

robotdan avatar robotdan commented on May 27, 2024

Seems reasonable.

from fusionauth-jwt.

jamietanna avatar jamietanna commented on May 27, 2024

Hey @robotdan would you be OK if I refactor JSONWebKeySetTest slightly? It'll be easier to unit test if we're not going out to real endpoints (especially as I can't seem to find many public servers supporting the spec) - would you be happy with that?

(Originally published at: https://www.jvt.me/mf2/2020/10/oxt9d/)

from fusionauth-jwt.

robotdan avatar robotdan commented on May 27, 2024

Is this just to add some additional tests you mean? The ones that are there should work since those are legit endpoints.
https://github.com/FusionAuth/fusionauth-jwt/blob/48cd5897019b923ad7fe318aa0d632484a0ccddd/src/test/java/io/fusionauth/jwks/JSONWebKeySetTest.java

Or do you mean in order to add code for retrieveKeysFromIssuer?

from fusionauth-jwt.

jamietanna avatar jamietanna commented on May 27, 2024

Sorry, I wasn't clear. In JSONWebKeySetTest we're reaching out to a real set of endpoints.

However, I can't seem to find a public OAuth2 server that supports RFC8414 to write a test.

I was thinking of using something like Wiremock to create a fake server so I can stub it out, and wondered if you'd be happy with that as a change to the existing tests in JSONWebKeySetTest?

(Originally published at: https://www.jvt.me/mf2/2020/10/wczpu/)

from fusionauth-jwt.

robotdan avatar robotdan commented on May 27, 2024

Ah, ok, got it. Yeah, don't have to test real endpoints if there aren't any public ones that we can hit reliably.

You can just build some expected JSON and then parse it similar to how we do JWKS.

https://github.com/FusionAuth/fusionauth-jwt/tree/master/src/test/resources/jwk
https://github.com/FusionAuth/fusionauth-jwt/blob/013a981b7c82173fdd40b26a0384584677aaf7f0/src/test/java/io/fusionauth/jwks/JSONWebKeyBuilderTest.java

I can help write tests as well if you know what code you want to write.

from fusionauth-jwt.

voidmain avatar voidmain commented on May 27, 2024

If you have a valid response from that RFC, you could use the internal HTTP server that Java ships with for testing.

from fusionauth-jwt.

robotdan avatar robotdan commented on May 27, 2024

@jamietanna I stubbed this out under 314d76f. Let me know if that will work for you.

Feel free to submit some more tests if you have a specific use case you want to test for:

from fusionauth-jwt.

robotdan avatar robotdan commented on May 27, 2024

Releasing in 4.1.0, if there are additional features or missing capabilities from what I've described here, please open a new issue to track. Thanks!

from fusionauth-jwt.

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.