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

feat(transport-http): Http with header auth #1202

Closed
wants to merge 2 commits into from

Conversation

yash-atreya
Copy link
Member

Motivation

There is no easy way to send authenticated HTTP requests. Users would have to write a custom transport client implementation.

Solution

  • Adds a new field in the transport-http::Http<T> called auth: Option<Authorization>.

  • Made accommodations for reqwest and hyper implementations to incorporate and set the header authorization if auth is set.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

hmm, not sure we really need this for the Http<reqwest::Client> because this is a static auth header, and the user could install that as a default header on the client directly. so we should recommend doing that.

we could however use some examples for this

@mattsse
Copy link
Member

mattsse commented Sep 4, 2024

closing this in favor of #1227 which will allow dynamic headers and other features, static headers can be installed manually already on reqwest client

@mattsse mattsse closed this Sep 4, 2024
@mattsse mattsse deleted the yash/http-with-auth branch September 4, 2024 14:40
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.

2 participants