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

API: add POST based API #112

Closed
philips opened this issue Mar 18, 2016 · 13 comments
Closed

API: add POST based API #112

philips opened this issue Mar 18, 2016 · 13 comments
Labels
area/dev tooling related to tools used by developers kind/design relates to the fundamental design of a component kind/feature request wishes for new functionality/docs

Comments

@philips
Copy link
Contributor

philips commented Mar 18, 2016

For playing around with clair it would be much nicer if I could POST the image for analysis instead of going through hoops, as analyze-local-images does, to pull from a web server. This is a local development nicety but I bet it would make it easier for people to participate. It certainly tripped me up while I tried to use analyze-local-images.

@philips philips added area/dev tooling related to tools used by developers low hanging fruit easy for new contributors kind/feature request wishes for new functionality/docs component/api labels Mar 18, 2016
@jzelinskie
Copy link
Contributor

This is might be a little tricky because we'd have to be able to determine all of the metadata usually passed in the JSON body of a POST to /v1/layers from whatever blob we get over the wire. What formats would the images be (docker save and rkt image extract)? I'm adding the design tag to this issue.

@jzelinskie jzelinskie added kind/design relates to the fundamental design of a component and removed low hanging fruit easy for new contributors labels Mar 18, 2016
@philips
Copy link
Contributor Author

philips commented Mar 21, 2016

@jzelinskie seems like a query param, content-type, or path could differentiate that stuff.

@jakedt
Copy link

jakedt commented Mar 31, 2016

There's also always multipart. @philips would that work or is the construction of the multipart request too high of a barrier for local development?

@jgsqware
Copy link
Contributor

Hello, you could have a look at github.com/wemanity-belgium/hyperclair.

It try to address that problem, with an easier cli to interact with clair

@Quentin-M
Copy link
Contributor

Related to #148.

Data detectors are used to detect the filesystem of container layers. Therefore, there's a bit of a container spec dependency there. However, this logic currently applies to single layers and can't be used to detect multiple layers / organize them. I don't want to add extra spec dependencies (i.e. reading a manifest) in another subsystem of Clair. Thus, we might want to extend its purpose.

@Quentin-M Quentin-M added this to the 2.0 milestone Apr 19, 2016
@Quentin-M
Copy link
Contributor

Quentin-M commented Jun 9, 2016

As @jgsqware mentioned, what about at least posting the content of individual layers? That would remove the need of having an HTTP server able to serve layer, and thus, simplify Clair's integration and security management. In that case, Hyperclair/clairctl would still ease of proper image posting.

It should be an easy change and non-breaking in regard to the API.

@Quentin-M
Copy link
Contributor

Quentin-M commented Jun 9, 2016

I still think that we may definitely accept images as well, maybe through another API call. To do so, we might extend the worker.DataDetector interface and wrap worker.Process.

@jgsqware
Copy link
Contributor

jgsqware commented Jun 9, 2016

Agree with @Quentin-M, it should be 2 different way to upload. The advantage i can see of pushing image than layer tarball, is to avoid to push so layer already pushed to clair.

@jgsqware
Copy link
Contributor

jgsqware commented Jun 9, 2016

However, the work of metadata extraction from images/manifests is already done in clairctl, so we can move it quite easily to a process in clair

@Quentin-M
Copy link
Contributor

Quentin-M commented Jun 9, 2016

True. While accepting posted layers would ease usage (as explained above), accepting posted images would ease usage even further, to the point where no client side logic would be required anymore, however, users might end up pushing data that have already been analyzed (which may or may not be a drawback for some use cases). In my opinion, both solutions could be provided by Clair eventually. At first, we should accept posted layers (no API change, little code change) and get #164 in.

@jgsqware
Copy link
Contributor

for POST layer: what do you prefer:

  • POST v1/layers (with multipart) (need to evaluate if it breaks current POST method)
  • POST /v1/layers/sha256:123587453 (with multipart to send needed info like parent...)

@ghost
Copy link

ghost commented Apr 11, 2017

Two queries:

  1. Does latest clair release support POSTing of layers/images instead of starting HTTP server etc?

  2. One of the comments above says hyperclair (clairctl) solves this issue, how does the issue get solved is clair doesnt support the POST api?

Any pointers would be helpful. This is one of the reasons we are not using clair as the infra team sees this as a security issue.

@hdonnay
Copy link
Member

hdonnay commented Aug 31, 2020

We’re declaring bug bankruptcy as part of the release process for a new major version of Clair. Please open a ticket in our issue tracker if you feel this still needs to be addressed, and we'll triage as part of our v4 development process. Thanks!

@hdonnay hdonnay closed this as completed Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dev tooling related to tools used by developers kind/design relates to the fundamental design of a component kind/feature request wishes for new functionality/docs
Development

No branches or pull requests

6 participants