chore: rename SignIndexAttestations to just Sign
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user