Rename ProtobufBundle to Bundle

Signed-off-by: Cody Soyland <codysoyland@github.com>
This commit is contained in:
Cody Soyland 2024-09-04 16:45:02 -04:00
parent 8446079656
commit ea1a3da1eb
No known key found for this signature in database
6 changed files with 8 additions and 8 deletions

View file

@ -25,7 +25,7 @@ func newErrNoAttestations(name, digest string) ErrNoAttestations {
}
type Attestation struct {
Bundle *bundle.ProtobufBundle `json:"bundle"`
Bundle *bundle.Bundle `json:"bundle"`
}
type AttestationsResponse struct {

View file

@ -132,7 +132,7 @@ func (c LiveClient) GetAttestations(ref name.Reference, digest string) ([]*api.A
return attestations, fmt.Errorf("error getting referrer image: %w", err)
}
b := &bundle.ProtobufBundle{}
b := &bundle.Bundle{}
err = b.UnmarshalJSON(bundleBytes)
if err != nil {

View file

@ -12,6 +12,6 @@ import (
var SigstoreBundleRaw []byte
// SigstoreBundle returns a test *sigstore.Bundle
func SigstoreBundle(t *testing.T) *bundle.ProtobufBundle {
func SigstoreBundle(t *testing.T) *bundle.Bundle {
return sgData.TestBundle(t, SigstoreBundleRaw)
}

View file

@ -86,7 +86,7 @@ func loadBundlesFromJSONLinesFile(path string) ([]*api.Attestation, error) {
decoder := json.NewDecoder(bytes.NewReader(fileContent))
for decoder.More() {
var bundle bundle.ProtobufBundle
var bundle bundle.Bundle
bundle.Bundle = new(protobundle.Bundle)
if err := decoder.Decode(&bundle); err != nil {
return nil, fmt.Errorf("failed to unmarshal bundle from JSON: %v", err)

View file

@ -92,7 +92,7 @@ func TestGetLocalAttestations(t *testing.T) {
func TestFilterAttestations(t *testing.T) {
attestations := []*api.Attestation{
{
Bundle: &bundle.ProtobufBundle{
Bundle: &bundle.Bundle{
Bundle: &protobundle.Bundle{
Content: &protobundle.Bundle_DsseEnvelope{
DsseEnvelope: &dsse.Envelope{
@ -104,7 +104,7 @@ func TestFilterAttestations(t *testing.T) {
},
},
{
Bundle: &bundle.ProtobufBundle{
Bundle: &bundle.Bundle{
Bundle: &protobundle.Bundle{
Content: &protobundle.Bundle_DsseEnvelope{
DsseEnvelope: &dsse.Envelope{
@ -116,7 +116,7 @@ func TestFilterAttestations(t *testing.T) {
},
},
{
Bundle: &bundle.ProtobufBundle{
Bundle: &bundle.Bundle{
Bundle: &protobundle.Bundle{
Content: &protobundle.Bundle_DsseEnvelope{
DsseEnvelope: &dsse.Envelope{

View file

@ -55,7 +55,7 @@ func NewLiveSigstoreVerifier(config SigstoreConfig) *LiveSigstoreVerifier {
}
}
func (v *LiveSigstoreVerifier) chooseVerifier(b *bundle.ProtobufBundle) (*verify.SignedEntityVerifier, string, error) {
func (v *LiveSigstoreVerifier) chooseVerifier(b *bundle.Bundle) (*verify.SignedEntityVerifier, string, error) {
if !b.MinVersion("0.2") {
return nil, "", fmt.Errorf("unsupported bundle version: %s", b.MediaType)
}