Feature Proposal: Allow custom headers in RESTful requests
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 13d 8h
- Merged PRs (30d)
- 2
Description
At the moment, the client, either the high level or the low-level APIClient does not allow one to specify a custom header, only the base_url.
The reason I propose such a feature is that sometime an authentication header is required to access the endpoint. For example, say I use portainter to remotely manage daemons, then, I will be able to access all docker API via http://<portainer_url>/endpoints/<endpoint_id>/docker. However, it is not possible use this as the base_url with docker-py, because an authorization header is required to accompany it in each request.
By allowing user specified headers, then all features of docker-py can be used in such context. I am not entirely sure about the high-level API, but I do think the APIClient shall work as it is one-to-one mapping with Docker API.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the low-level APIClient builds RESTful requests and how the high-level client delegates to it. Confirm the intended behavior for user-specified headers, including an authorization header, and determine whether both client layers should support them; done means custom headers accompany requests to the configured base_url.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100