Skip to content

Commit

Permalink
Update BaseSignedEntity interface implementation
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 <[email protected]>
  • Loading branch information
cmurphy committed Nov 15, 2024
1 parent 6946a26 commit d750fe4
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 d750fe4

Please sign in to comment.