Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a short and simple header-based auth backend (and tests!). This allows greater flexibility in auth mechanisms out of the box.
For example, I'm working on on an internal library to interface with OGC services and three providers use three different auth mechanisms. Being able to consolidate this via the auth parameter seems like the correct solution.
It's worth noting that because of when this executes, auth objects override the headers provided both by the session and request call. This has been appropriately documented, and I don't believe any other option would be preferable.
Looks like someone proposed this in 2018 (#4823) but was rejected because of a feature freeze at the time.
If this is acceptable, would the team be interested in something similar like HTTPParamAuth that uses a dict of parameters in a similar fashion? Going back to my library example, one provider uses oauth, which requests supports, one uses headers, and one uses a custom api key parameter. Totally willing to add it to this PR if it simplifies approval :)