willyw0nka / pygrype

A python wrapper for Anchore Grype
MIT License
3 stars 1 forks source link

Add support for using Docker based Grype executables #8

Closed robberwick closed 1 month ago

robberwick commented 1 month ago

It would be really helpful to be able to use this wrapper in my CI process without needing to include a particular binary in the image. So, it would be great if it were possible to specify a binary or docker backend when instantiating the wrapper.

I am proposing introducing both a GrypeBinaryBackend and a GrypeDockerBackend, an instance of which which can be optionally passed to the Grype constructor. All grype executable calls would be proxied through the specified backend instance. In the event a backend instance is not provided to the constructor, the default is to use a local binary named "grype" as per current usage.

willyw0nka commented 1 month ago

Thanks for the feedback @robberwick :+1: ! Taking a look at this PR on my free time.