Comments (5)
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.
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.
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.
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.
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)
- ERROR Wrong authentication method used: client_secret_post != client_secret_basic HOT 6
- Not able to find sp_config HOT 3
- Document release process / pypi upload HOT 2
- Create python 3.11 compatible release for pypi HOT 2
- Update conda-forge packages HOT 1
- Update URL references after repo move HOT 2
- AttributeError: 'dict' object has no attribute 'create_cookie' HOT 3
- Allow using different authn_method in Consumer.complete()
- Consumer.backchannel_logout and handling state HOT 11
- Architecture question regardings multiple app instances HOT 3
- Cannot add `scope` to registration request HOT 5
- Release 1.5.1 HOT 4
- Investigate failing readthedocs.io build HOT 1
- pydantic 2 seems to be incompatible with oic currently HOT 1
- Now in seconds vs. milliseconds: IATError: Issued in the future HOT 2
- Multiple matching kid support HOT 1
- Add support for RFC 9207 (?) HOT 1
- Why does `Client.do_access_token_refresh` require `state`? HOT 2
- Use SLSA workflow to create releases for PyPi HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyoidc.