aquasecurity / harbor-scanner-trivy

Use Trivy as a plug-in vulnerability scanner in the Harbor registry
https://goharbor.io
Apache License 2.0
218 stars 77 forks source link

/api/v1/scan API should return 400 to the client when the enabled_capabilities.produces_mime_types not specified #443

Open stonezdj opened 8 months ago

stonezdj commented 8 months ago

What steps did you take and what happened:

Install the prototype trivy scanner and send a request to POST /api/v1/scan, the enabled_capabilities.produces_mime_types is missed in the request json

What did you expect to happen:

The HTTP response code should be 400 and log error message like that: enabled_capabilities.produces_mime_types is not specified in the request in the trivy log, so that user could get the http 400 error and check the trivy log to diagnostic.

Environment:

knqyf263 commented 8 months ago

Fixed in https://github.com/aquasecurity/harbor-scanner-trivy/pull/422/commits/3bc74554d3eec8a968b0c54138a2045def9d1ced