mirror of
https://github.com/slsa-framework/slsa-verifier.git
synced 2026-08-19 03:26:20 +00:00
* feat: support oci image verification Signed-off-by: Asra Ali <asraa@google.com> * add testing folder Signed-off-by: Asra Ali <asraa@google.com> * update name and make fix Signed-off-by: Asra Ali <asraa@google.com> * add tests Signed-off-by: Asra Ali <asraa@google.com> * Add initial testing Signed-off-by: Asra Ali <asraa@google.com> * updated comments Signed-off-by: Asra Ali <asraa@google.com> * update Signed-off-by: Asra Ali <asraa@google.com> * fix digest calculation Signed-off-by: Asra Ali <asraa@google.com> Signed-off-by: Asra Ali <asraa@google.com> Co-authored-by: laurentsimon <64505099+laurentsimon@users.noreply.github.com>
35 lines
923 B
Go
35 lines
923 B
Go
package register
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/slsa-framework/slsa-verifier/options"
|
|
)
|
|
|
|
var SLSAVerifiers = make(map[string]SLSAVerifier)
|
|
|
|
type SLSAVerifier interface {
|
|
// IsAuthoritativeFor checks whether a verifier can
|
|
// verify provenance for a given builder identified by its
|
|
// `BuilderID`.
|
|
IsAuthoritativeFor(builderID string) bool
|
|
|
|
// VerifyArtifact verifies a provenance for a supplied artifact.
|
|
VerifyArtifact(ctx context.Context,
|
|
provenance []byte, artifactHash string,
|
|
provenanceOpts *options.ProvenanceOpts,
|
|
builderOpts *options.BuilderOpts,
|
|
) ([]byte, string, error)
|
|
|
|
// VerifyImage verifies a provenance for a supplied OCI image.
|
|
VerifyImage(ctx context.Context,
|
|
artifactImage string,
|
|
provenanceOpts *options.ProvenanceOpts,
|
|
builderOpts *options.BuilderOpts,
|
|
) ([]byte, string, error)
|
|
}
|
|
|
|
func RegisterVerifier(name string, verifier SLSAVerifier) {
|
|
SLSAVerifiers[name] = verifier
|
|
}
|