Rename ProtobufBundle to Bundle
Signed-off-by: Cody Soyland <codysoyland@github.com>
This commit is contained in:
parent
8446079656
commit
ea1a3da1eb
6 changed files with 8 additions and 8 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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{
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue