Skip to content

Commit

Permalink
Update BaseSignedEntity interface implementation (#333)
Browse files Browse the repository at this point in the history
The SignedEntity interface has gone through a few iterations. The
BaseSignedEntity struct was not keeping up with it, which wasn't caught
because it is never used in sigstore-go. This change updates the struct
to implement the interface it was meant to implement, and adds an
assignment statement to make sure future errors in updates are caught at
compile time.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
  • Loading branch information
cmurphy authored Nov 15, 2024
1 parent 6946a26 commit 5970df0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions pkg/verify/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (

in_toto "github.com/in-toto/attestation/go/v1"
"github.com/secure-systems-lab/go-securesystemslib/dsse"
protocommon "github.com/sigstore/protobuf-specs/gen/pb-go/common/v1"
"github.com/sigstore/sigstore-go/pkg/root"
"github.com/sigstore/sigstore-go/pkg/tlog"
)
Expand Down Expand Up @@ -95,19 +94,21 @@ type EnvelopeContent interface {
// that only implements a subset of the interfaces.
type BaseSignedEntity struct{}

func (b *BaseSignedEntity) VerificationProvider() (VerificationContent, error) {
return nil, errNotImplemented
var _ SignedEntity = &BaseSignedEntity{}

func (b *BaseSignedEntity) HasInclusionPromise() bool {
return false
}

func (b *BaseSignedEntity) Envelope() (*dsse.Envelope, error) {
return nil, errNotImplemented
func (b *BaseSignedEntity) HasInclusionProof() bool {
return false
}

func (b *BaseSignedEntity) MessageSignature() (*protocommon.MessageSignature, error) {
func (b *BaseSignedEntity) VerificationContent() (VerificationContent, error) {
return nil, errNotImplemented
}

func (b *BaseSignedEntity) Signature() ([]byte, error) {
func (b *BaseSignedEntity) SignatureContent() (SignatureContent, error) {
return nil, errNotImplemented
}

Expand Down

0 comments on commit 5970df0

Please sign in to comment.