docker / docker/docker-py

Feature Proposal: Allow custom headers in RESTful requests

Open
#2,568 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.