Skip to content

Commit

Permalink
rename RekorBundle to RekorResponse
Browse files Browse the repository at this point in the history
Signed-off-by: Vivek Kumar Sahu <vivekkumarsahu650@gmail.com>
  • Loading branch information
viveksahu26 committed Jan 3, 2024
1 parent 3af691f commit 432f9a7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/cosign/cli/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func attachSignature() *cobra.Command {
PersistentPreRun: options.BindViper,
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return attach.SignatureCmd(cmd.Context(), o.Registry, o.Signature, o.Payload, o.Cert, o.CertChain, o.TimeStampedSig, o.RekorBundle, args[0])
return attach.SignatureCmd(cmd.Context(), o.Registry, o.Signature, o.Payload, o.Cert, o.CertChain, o.TimeStampedSig, o.RekorResponse, args[0])
},
}

Expand Down
10 changes: 5 additions & 5 deletions cmd/cosign/cli/attach/sig.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"github.com/sigstore/cosign/v2/pkg/oci/static"
)

func SignatureCmd(ctx context.Context, regOpts options.RegistryOptions, sigRef, payloadRef, certRef, certChainRef, timeStampedSigRef, rekorBundleRef, imageRef string) error {
func SignatureCmd(ctx context.Context, regOpts options.RegistryOptions, sigRef, payloadRef, certRef, certChainRef, timeStampedSigRef, rekorResponseRef, imageRef string) error {
b64SigBytes, err := signatureBytes(sigRef)
if err != nil {
return err
Expand Down Expand Up @@ -98,19 +98,19 @@ func SignatureCmd(ctx context.Context, regOpts options.RegistryOptions, sigRef,
}
}
tsBundle := bundle.TimestampToRFC3161Timestamp(timeStampedSig)
if rekorBundleRef != "" {
rekorBundleByte, err := os.ReadFile(filepath.Clean(rekorBundleRef))
if rekorResponseRef != "" {
rekorResponseByte, err := os.ReadFile(filepath.Clean(rekorResponseRef))
if err != nil {
return err
}

var localCosignPayload cosign.LocalSignedPayload
err = json.Unmarshal(rekorBundleByte, &localCosignPayload)
err = json.Unmarshal(rekorResponseByte, &localCosignPayload)
if err != nil {
return err
}
var duplicateLocalCosignPayload cosign.LocalSignedPayload
err = json.Unmarshal(rekorBundleByte, &duplicateLocalCosignPayload.Bundle)
err = json.Unmarshal(rekorResponseByte, &duplicateLocalCosignPayload.Bundle)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/cosign/cli/options/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type AttachSignatureOptions struct {
Cert string
CertChain string
TimeStampedSig string
RekorBundle string
RekorResponse string
Registry RegistryOptions
}

Expand All @@ -58,7 +58,7 @@ func (o *AttachSignatureOptions) AddFlags(cmd *cobra.Command) {
"signing certificate and end with the root certificate. Included in the OCI Signature")
cmd.Flags().StringVar(&o.TimeStampedSig, "tsr", "",
"path to the Time Stamped Signature Response from RFC3161 compliant TSA")
cmd.Flags().StringVar(&o.RekorBundle, "rekor-response", "",
cmd.Flags().StringVar(&o.RekorResponse, "rekor-response", "",
"path to the rekor bundle")
}

Expand Down

0 comments on commit 432f9a7

Please sign in to comment.