chore: rename SignIndexAttestations to just Sign

This commit is contained in:
mrjoelkamp
2024-04-30 15:55:21 -05:00
parent 6b8c5b56bc
commit 34fcb0ca6d
3 changed files with 4 additions and 4 deletions

View File

@@ -42,9 +42,9 @@ library to create, verify, and evaluate policy for attestations on container ima
1. sign attestations
```go
signedImageIndex, err := attest.SignIndexAttestations(ctx, att, signer, opts)
signedImageIndex, err := attest.Sign(ctx, att, signer, opts)
```
`attest.SignedIndexAttestations()` iterates over all attestation manifests in the image index and signs all intoto statements (optionally generates a VSA), returning a mutated ImageIndex with all intoto statements signed as attestations.
`attest.Sign()` iterates over attestation manifests in the image index and signs all intoto statements (optionally generates a VSA), returning a mutated ImageIndex with all intoto statements signed as attestations.
1. save output (optional)
* push to oci registry

View File

@@ -17,7 +17,7 @@ import (
"github.com/secure-systems-lab/go-securesystemslib/dsse"
)
func SignIndexAttestations(ctx context.Context, idx v1.ImageIndex, signer dsse.SignerVerifier, opts *SigningOptions) (v1.ImageIndex, error) {
func Sign(ctx context.Context, idx v1.ImageIndex, signer dsse.SignerVerifier, opts *SigningOptions) (v1.ImageIndex, error) {
// extract attestation manifests from index
attestationManifests, err := attestation.GetAttestationManifestsFromIndex(idx)
if err != nil {

View File

@@ -61,7 +61,7 @@ func TestSignVerifyOCILayout(t *testing.T) {
}
attIdx, err := oci.AttestationIndexFromPath(tc.TestImage)
assert.NoError(t, err)
signedIndex, err := SignIndexAttestations(ctx, attIdx.Index, signer, opts)
signedIndex, err := Sign(ctx, attIdx.Index, signer, opts)
assert.NoError(t, err)
// output signed attestations