Shopify / ruby-sigstore

Rubygems sigstore signing plugin
Apache License 2.0
7 stars 6 forks source link

Fix NoMethodError for `gem verify` on an unsigned gem #45

Closed rochlefebvre closed 2 years ago

rochlefebvre commented 2 years ago
> gem verify ruby-sigstore-0.1.0.gemVerifying ruby-sigstore-0.1.0.gem
ERROR:  While executing gem ... (NoMethodError)
    undefined method `map' for nil:NilClass

When we look up rekor log entries by file digest, always call response.body.reduce(:merge).map {...} which blows up when response.body is an empty array (reduce then returns nil).

I'm making a few changes to support nonexistent signatures. I'm also breaking up the API#where method into smaller chunks.