Skip to content

Commit

Permalink
Drop strfmt.Base64 from pkg/oci.
Browse files Browse the repository at this point in the history
I noticed that vendoring `pkg/oci` was pulling in stuff from `mongodb`, and pulling the thread it seems to come from this line.

`Base64` is an alias of `[]byte`, so this should have a relatively low migration cost.

Signed-off-by: Matt Moore <mattmoor@chainguard.dev>
  • Loading branch information
mattmoor committed Nov 19, 2021
1 parent f8f0f6d commit 6089e42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions pkg/oci/signatures.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package oci
import (
"crypto/x509"

"github.com/go-openapi/strfmt"
v1 "github.com/google/go-containerregistry/pkg/v1"
)

Expand Down Expand Up @@ -64,7 +63,7 @@ type Signature interface {
// Bundle holds metadata about recording a Signature's ephemeral key to
// a Rekor transparency log.
type Bundle struct {
SignedEntryTimestamp strfmt.Base64
SignedEntryTimestamp []byte
Payload BundlePayload
}

Expand Down
5 changes: 3 additions & 2 deletions pkg/oci/static/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"reflect"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-containerregistry/pkg/v1/types"
"github.com/sigstore/cosign/pkg/oci"
ctypes "github.com/sigstore/cosign/pkg/types"
Expand Down Expand Up @@ -86,7 +87,7 @@ func TestOptions(t *testing.T) {
LayerMediaType: ctypes.SimpleSigningMediaType,
ConfigMediaType: types.OCIConfigJSON,
Annotations: map[string]string{
BundleAnnotationKey: "{\"SignedEntryTimestamp\":\"\",\"Payload\":{\"body\":null,\"integratedTime\":0,\"logIndex\":0,\"logID\":\"\"}}",
BundleAnnotationKey: "{\"SignedEntryTimestamp\":null,\"Payload\":{\"body\":null,\"integratedTime\":0,\"logIndex\":0,\"logID\":\"\"}}",
},
Bundle: bundle,
},
Expand All @@ -100,7 +101,7 @@ func TestOptions(t *testing.T) {
}

if !reflect.DeepEqual(got, test.want) {
t.Errorf("makeOptions() = %#v, wanted %#v", got, test.want)
t.Errorf("makeOptions() = %s", cmp.Diff(got, test.want))
}
})
}
Expand Down

0 comments on commit 6089e42

Please sign in to comment.