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

Sending a content-type with a charset specified in requests to docker prevent correct interactions with authorization plugins present on the daemon. #945

Open
nathanburrell opened this issue Feb 15, 2018 · 2 comments

Comments

@nathanburrell
Copy link

nathanburrell commented Feb 15, 2018

Due to a bug 36317 with docker in how it chooses whether or not to forward bodies of requests to authorization plugins, the maven plugin cannot make any successful requests if the docker daemon uses the body in any authorization plugins present.

Docker will most likely fix this in a newer version, however as this plugin seems to be compatible with older docker daemons, line 120 of ApacheHttpClientDelegate could be updated to just pass the content type " application/json" with no charset to allow the plugin to interact with older daemons and authorization plugins correctly.

Steps to reproduce:

  1. Install the debug auth plugin I created to demonstrate this (it simply logs the content length, content type and the length of the body).

https://bitbucket.org/nburrell/authz/src/master/

  1. Use the attached pom file (changing the extension to xml due to github not allowing uploads of xml files) and run mvn clean to docker (note the content-type is simply "application/json") and note the length of the body being 0, even though the content length is correct:

pom.txt

@rhuss
Copy link
Collaborator

rhuss commented Feb 20, 2018

@nathanburrell makes sense to me. Fancy doing a pull request ? (sorry, I'm on the road this week, but will fix this when being back).

BTW, dmp has an API detection mechanism and react differently on different Docker versions. Not sure whether this is usable at that level though.

@foxstephen
Copy link
Contributor

I've made a PR to fix this issue #956

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

No branches or pull requests

3 participants