Skip to content

Allowing transport layer to be customized #169

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

Merged
merged 37 commits into from
Apr 21, 2020
Merged

Conversation

abhidnya13
Copy link
Contributor

@abhidnya13 abhidnya13 commented Mar 7, 2020

Separating everything related to requests to http module. Lot of changes around that. I can walk through all the changes.

Copy link
Collaborator

@rayluo rayluo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for keep working on this PR!
I've not yet review the entire PR (especially not yet review the application.py), the following would be enough for our walk-through discussion to discuss.

2 high level topics are:

  • Whether we would need a DefaultHttpClient in our code path
  • Comparing the oauth2.py in this PR to an existing implementation

@@ -35,13 +34,12 @@ def __init__(
self,
server_configuration, # type: dict
client_id, # type: str
http_client, # type: HttpClient
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Historically, that internal variable in this oauth2.py was named session, serving as a strong hint for the caller to provide a session instance, rather than just an http client instance. I would suggest to follow that prevailing tradition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the current implementation, it is an http_client which can also be a session, session will hold true for session objects only which is what we historically do. But http_client is what we expect, if the passed http client is a session object it still a http_client as we assume it is supposed to have qualities similar to that http_client interface.

Copy link
Collaborator

@rayluo rayluo Apr 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entire file looks in good shape. And, as part of the final cross-check, I compare it to my async branch, and notice some line(s) are missing/different. A few of them are actually important.
At this point, rather than pointing them out one-by-one in this PR (which would be very time-consuming) and then you need to hand-pick them, we can probably just download this file into your laptop, and then, either run a "diff" to see the difference, or you can just use it and see the tests presumably still pass.
(Note that I've changed my previous session naming to adopt your http_client, so you can use it as a drop-in replacement.)

Copy link
Collaborator

@rayluo rayluo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Captured most (if not all) of our recent conversations, as well as some quick Github Suggestios.

@abhidnya13 abhidnya13 requested a review from rayluo April 16, 2020 06:48
Copy link
Collaborator

@rayluo rayluo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there. Added a comment on MinimalResponse. And the rest of the comments are all one-click suggestions.

@abhidnya13 abhidnya13 requested a review from rayluo April 17, 2020 21:47
Copy link
Collaborator

@rayluo rayluo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's have some finishing touch. Look forward to merge at early next week!

@@ -35,13 +34,12 @@ def __init__(
self,
server_configuration, # type: dict
client_id, # type: str
http_client, # type: HttpClient
Copy link
Collaborator

@rayluo rayluo Apr 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This entire file looks in good shape. And, as part of the final cross-check, I compare it to my async branch, and notice some line(s) are missing/different. A few of them are actually important.
At this point, rather than pointing them out one-by-one in this PR (which would be very time-consuming) and then you need to hand-pick them, we can probably just download this file into your laptop, and then, either run a "diff" to see the difference, or you can just use it and see the tests presumably still pass.
(Note that I've changed my previous session naming to adopt your http_client, so you can use it as a drop-in replacement.)

Copy link
Collaborator

@rayluo rayluo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOVE IT! Squash it! Merge it! :shipit:

@abhidnya13 abhidnya13 merged commit c235d4e into dev Apr 21, 2020
@abhidnya13 abhidnya13 deleted the custom_http_client branch April 21, 2020 00:24
@abhidnya13 abhidnya13 linked an issue Apr 21, 2020 that may be closed by this pull request
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.

Customizable transport layer
2 participants