Giter Club home page Giter Club logo

Comments (5)

ubik2 avatar ubik2 commented on September 17, 2024

Another approach to this is to change the Client.parse_response to handle the NoneResponse specially (acceptable for only_extras() to be true, and also ok for resp to evaluate to False). I dislike NoneResponse being special, but this also lets us still run the store_response and resp.verify.

from pyoidc.

schlenk avatar schlenk commented on September 17, 2024

Can you elaborate for which usecase you need the old behaviour please?

I see the issue, yes, the return type changed if you do not care for the response message and just want the response HTTP code. The only internal users of that functionality got changed to just handle the case directly, because it ends up being just http_request() + some minimal http status code handling. Seems i missed the docstring of the request_and_return() method that spells out the special handling for no expected responses.

If there is some convincing usecase for this usage pattern, we might simply add a convenience method that does it, but currently i do not see a real benefit over just calling http_request() directly and simply reading the status code yourself.

from pyoidc.

ubik2 avatar ubik2 commented on September 17, 2024

For my use case, I have a user management endpoint to which I submit a POST to delete a user, and get back an empty response.

I can easily work around this by passing None as the response type, so it's not a real problem for me.

It's easy to imagine an expected response that could be empty, but could also have fields where you want to take advantage of the verification when all the fields are optional, or storing the response, but I don't actually need that functionality myself.

Feel free to close this, if you don't think it needs to be handled by the library.

from pyoidc.

schlenk avatar schlenk commented on September 17, 2024

Ok, thank you.

I'll have to think about it a bit. The mix of Message and http status code as return type kind of makes the type annotations for that code really ugly and hard to reason about.

from pyoidc.

ubik2 avatar ubik2 commented on September 17, 2024

I did appreciate having the types cleaned up so much. Overall it's much nicer now, but I did want you to know about the compatibility issue with code that worked with 1.4. I'll use the workaround in my calling code for now.

from pyoidc.

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.