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

Add OAuth2::Client#http_client #10452

Merged

Conversation

straight-shoota
Copy link
Member

This patch let's OAuth2::Client use a configurable HTTP::Client instance.

A use case is already demonstrated in the second commit: Specs can inject an instance with a hard-wired handler, thus skipping the network stack.

This also allows more customization, for example when using custom certificates.

The default behaviour stays the same, i.e. every request creates a new HTTP::Client instance. The autocreated client is not cached by default because there's no proper connection management (see #6011) and making a single authentication request could keep up a long-running HTTP connection.

@straight-shoota
Copy link
Member Author

Resolves #4382

Copy link
Member

@sdogruyol sdogruyol left a comment

Choose a reason for hiding this comment

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

Thanks @straight-shoota 🙏

@straight-shoota straight-shoota added this to the 1.1.0 milestone Mar 23, 2021
@straight-shoota straight-shoota merged commit a0ce5f3 into crystal-lang:master Mar 30, 2021
@straight-shoota straight-shoota deleted the feature/oauth2-http-client branch March 30, 2021 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants