baude / image-scanner

[Deprecated] Vulnerability scanner for containers and images
GNU Lesser General Public License v2.1
14 stars 8 forks source link

Document and stabilize API (v1) #77

Open simon3z opened 9 years ago

simon3z commented 9 years ago

The image-scanner-d API should be documented and we should start planning a roadmap to v1 so that the image inspection service can be consumed also from other clients.

Probably the first thing to do is to scope it with /v1beta1/... (or straight to /v1/...) prefixes.

simon3z commented 9 years ago

My current concern about the API is that it seems that only one result can be fetched at time.

If two clients are running at the same time we could end up in a race as:

(client1)$ curl -H 'Content-type: application/json' -q http://<host>:5001/image-scanner/api/scan -d '{"number": 2, "scan": ["<image1>"]}'
(client2)$ curl -H 'Content-type: application/json' -q http://<host>:5001/image-scanner/api/scan -d '{"number": 2, "scan": ["<image2>"]}'

(client1)$ curl -q http://<host>:5001/reports/docker_state.json
{
...
  "scanned_content": [
    "<image2-hash>"
  ],
...
}