Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for requests session #806

Closed
wants to merge 11 commits into from

Conversation

infohash
Copy link
Contributor

@infohash infohash commented Apr 4, 2022

  1. requests.Session allows session persistence across multiple requests.
  2. Custom Transport Adapters

Transport Adapters provide a mechanism to define interaction methods for an HTTP service. In particular, they allow you to apply per-service configuration.

Requests ships with a single Transport Adapter, the HTTPAdapter. This adapter provides the default Requests interaction with HTTP and HTTPS using the powerful urllib3 library. Whenever a Requests Session is initialized, one of these is attached to the Session object for HTTP, and one for HTTPS.

Requests enables users to create and use their own Transport Adapters that provide specific functionality. Once created, a Transport Adapter can be mounted to a Session object, along with an indication of which web services it should apply to.

In some enterprise services, there can be a requirement of using custom transport adapters. Allowing a user to directly pass requests.Session instance will satisfy such requirements and flexibility to manage and configure http requests

For session persistence and custom http adapters.
src/oic/oauth2/__init__.py Outdated Show resolved Hide resolved
src/oic/oauth2/__init__.py Outdated Show resolved Hide resolved
@infohash
Copy link
Contributor Author

infohash commented May 2, 2022

SKIPPED:  py36: InterpreterNotFound: python3.6
SKIPPED:  py37: InterpreterNotFound: python3.7
  py38: commands succeeded
  docs: commands succeeded
ERROR:   quality: commands failed
Error: Process completed with exit code 1.

@infohash infohash closed this May 3, 2022
@infohash infohash reopened this May 3, 2022
@infohash
Copy link
Contributor Author

infohash commented May 3, 2022

@tpazderka After merging upstream/python-versions, checks here are failing while #805 has passed all checks.

SKIPPED:  py37: InterpreterNotFound: python3.7
  py38: commands succeeded
SKIPPED:  py39: InterpreterNotFound: python3.9
SKIPPED:  py310: InterpreterNotFound: python3.10
  docs: commands succeeded
ERROR:   quality: commands failed
Error: Process completed with exit code 1.

@tpazderka
Copy link
Collaborator

You have errors in typing, you can run tox -equality to see that.

@infohash
Copy link
Contributor Author

infohash commented May 4, 2022

Fixed and ready to be merged. When will be the expected date of release?

@infohash infohash requested a review from tpazderka May 4, 2022 08:36
src/oic/oauth2/base.py Outdated Show resolved Hide resolved
src/oic/utils/settings.py Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented May 5, 2022

Codecov Report

Merging #806 (cf4ec39) into master (1e7ed6f) will increase coverage by 0.00%.
The diff coverage is 71.42%.

@@           Coverage Diff           @@
##           master     #806   +/-   ##
=======================================
  Coverage   63.75%   63.75%           
=======================================
  Files          64       64           
  Lines       11850    11856    +6     
  Branches     2410     2411    +1     
=======================================
+ Hits         7555     7559    +4     
- Misses       3698     3699    +1     
- Partials      597      598    +1     
Impacted Files Coverage Δ
src/oic/oauth2/base.py 54.79% <33.33%> (-1.55%) ⬇️
src/oic/utils/settings.py 87.87% <100.00%> (+1.67%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1e7ed6f...cf4ec39. Read the comment docs.

@infohash infohash requested a review from tpazderka May 5, 2022 07:27
@tpazderka tpazderka closed this in 2270076 May 6, 2022
@infohash infohash deleted the feature/request-session branch May 22, 2022 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants