Git Product home page Git Product logo

Comments (4)

thomasheartman avatar thomasheartman commented on June 2, 2024 1

Nice one! I think we should add under "expected outcome":

If no token is supplied, the api should return all toggles belonging to default project and the result of their evaluation
If a token is supplied, the token's environment and project data should be respected.

But what happens if you provide an invalid token? 401 or the same as if no token? I'd lean towards the 401 because that's clearer to the user.

This also isn't entirely true:

The desired behavior is shown in the endpoint /api/client/features which works both with and without token when Unleash is configured with AuthType.None

Because the api/client/features endpoint disregards the token entirely if AuthType is None: so even if you provide a token with a specified enviroment / projects, it disregards it and gives you all projects in the default environment. That's a separate bug, though.

from unleash.

thomasheartman avatar thomasheartman commented on June 2, 2024

Oh, and for the record: I'm not entirely convinced that allowing you to call the endpoint without a token is the right thing to do, because it feels like we're encouraging it that way, and it probably won't do what you want it to do. However, there is an argument to be made that at least the client and frontend APIs will work the same if we do, so you get a consistent experience.

from unleash.

daveleek avatar daveleek commented on June 2, 2024

Thank you @thomasheartman!

I think we should add under "expected outcome":

Done!

But what happens if you provide an invalid token? 401 or the same as if no token? I'd lean towards the 401 because that's clearer to the user.

Yeah that makes sense to me as well!

This also isn't entirely true:

Ugh, I missed that! But yes, separate issue!

I'm not entirely convinced that allowing you to call the endpoint without a token is the right thing to do, because it feels like we're encouraging it that way, and it probably won't do what you want it to do. However, there is an argument to be made that at least the client and frontend APIs will work the same if we do, so you get a consistent experience.

Indeed, this feels like it needs doing now for consistency, but deprecation and clearer use case could be warranted down the road

from unleash.

thomasheartman avatar thomasheartman commented on June 2, 2024

Closing this now that #6247. It seems the github auto-closer doesn't like the word "and".

from unleash.

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.