Skip to content

Pass "meta" headers in API calls to the registry#1627

Merged
crosbymichael merged 2 commits intomoby:masterfrom
shin-:registry_metaheaders
Aug 23, 2013
Merged

Pass "meta" headers in API calls to the registry#1627
crosbymichael merged 2 commits intomoby:masterfrom
shin-:registry_metaheaders

Conversation

@shin-
Copy link
Contributor

@shin- shin- commented Aug 22, 2013

This will allow us to implement registry storages that use external authentication. The first use case for this is to allow upen-stack support (by allowing keystone tokens to be passed through to the registry, then to glance)

cc @samalba

@samalba
Copy link
Contributor

samalba commented Aug 23, 2013

LGTM

cc @crosbymichael any chance to see this in 0.6? It's required for the openstack integration.
cc @creack Another pair of eyes to double check and test this would be appreciated!

@creack
Copy link
Contributor

creack commented Aug 23, 2013

It breaks the tests as the srv.ImagePull prototype changed

@samalba
Copy link
Contributor

samalba commented Aug 23, 2013

Ouch, LGTM

@shin- almost there! Could you fix the test asap?

@shin-
Copy link
Contributor Author

shin- commented Aug 23, 2013

sure, sorry about that

@shin-
Copy link
Contributor Author

shin- commented Aug 23, 2013

fix'd!

@samalba
Copy link
Contributor

samalba commented Aug 23, 2013

Restoring my... LGTM!

cc @creack @crosbymichael

@shykes
Copy link
Contributor

shykes commented Aug 23, 2013

It's too late for 0.6, but we can release a 0.6.1 hotfix if you need it urgently. We could even do it tomorrow.

  ​

  In the meantime, remember we have the http://test.docker.io release channel for master, so you can get this PR in a .deb before it's actually released. 



—

@solomonstre
@getdocker

On Thu, Aug 22, 2013 at 7:45 PM, Sam Alba notifications@github.com
wrote:

Restoring my... LGTM!

cc @creack @crosbymichael

Reply to this email directly or view it on GitHub:
#1627 (comment)

@samalba
Copy link
Contributor

samalba commented Aug 23, 2013

test.docker.io won't be useful for devstack, it's using the PPA.

@solomonstre
Copy link

We're no longer using the PPA as of 0.6... So you will need to change your apt-sources in any case. Sorry if that makes your life more complicated. If you want we can discuss on irc tomorrow morning to find a solution.

@solomonstre
@getdocker

On Thu, Aug 22, 2013 at 9:27 PM, Sam Alba notifications@github.com
wrote:

test.docker.io won't be useful for devstack, it's using the PPA.

Reply to this email directly or view it on GitHub:
#1627 (comment)

@crosbymichael
Copy link
Contributor

LGTM

1 similar comment
@creack
Copy link
Contributor

creack commented Aug 23, 2013

LGTM

crosbymichael added a commit that referenced this pull request Aug 23, 2013
Pass "meta" headers in API calls to the registry
@crosbymichael crosbymichael merged commit 9149c45 into moby:master Aug 23, 2013
@iamolegga
Copy link

I'm so sorry for bothering after all these years, but could anyone tell if we really need that X-Meta- limitation for headers?

Asking because there is the open issue for 5 years without any response from owners regarding this undocumented restriction for headers.

Thank you in advance 🙏

@thaJeztah
Copy link
Member

Looks like that constraint is there indeed, e.g.;

func (ir *imageRouter) postImagesPush(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
metaHeaders := map[string][]string{}
for k, v := range r.Header {
if strings.HasPrefix(k, "X-Meta-") {
metaHeaders[k] = v
}
}

@iamolegga
Copy link

Thank you @thaJeztah for the fast reaction 🙏 So, my question is is this limitation for headers really needed or we can drop it from the code and pass all the headers specified in the docker config or via DOCKER_CUSTOM_HEADERS?

Real life example: we have a registry behind some authorization layer which requires some headers, so when we push images we cannot set those headers simply via docker config due to this X-Meta- limitation.

@thaJeztah
Copy link
Member

Probably better to open a new ticket for that with more details; we'd probably need to look if there's potential risks in unconditionally forwarding all headers and if there's constraint that should be kept. If you can provide a more detailed use-case that would be good; also because there's various parts of the codebase being transitioned.

@iamolegga
Copy link

@thaJeztah will do. I've decided to ask it first here as this is the PR which introduces this feature.

@iamolegga
Copy link

Just opened here

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.

8 participants