Documentation
¶
Index ¶
- func AttestationKey(artifactKey string) string
- func SimulateContextCancellation() func(ctx context.Context, artifactPath, attestationPath string) error
- func SimulateVerificationFailure(failingArtifacts ...string) func(ctx context.Context, artifactPath, attestationPath string) error
- type MockVerifier
- func (m *MockVerifier) GetCallCount() int
- func (m *MockVerifier) GetLastCall() *VerifyCall
- func (m *MockVerifier) Reset()
- func (m *MockVerifier) SetVerifyFunc(fn func(ctx context.Context, artifactPath, attestationPath string) error)
- func (m *MockVerifier) SetVerifyResult(err error)
- func (m *MockVerifier) VerifyArtifact(ctx context.Context, artifactPath, attestationPath string) error
- func (m *MockVerifier) WasCalledWith(artifactPath, attestationPath string) bool
- type Verifier
- type VerifierInterface
- type VerifyCall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttestationKey ¶
AttestationKey returns the attestation key for an artifact key
Types ¶
type MockVerifier ¶
type MockVerifier struct {
// VerifyFunc allows customizing verification behavior in tests
VerifyFunc func(ctx context.Context, artifactPath, attestationPath string) error
// CallLog tracks verification calls for test assertions
CallLog []VerifyCall
// DefaultResult controls the default verification result when VerifyFunc is nil
DefaultResult error
}
MockVerifier implements VerifierInterface for testing
func NewMockVerifier ¶
func NewMockVerifier() *MockVerifier
NewMockVerifier creates a new mock verifier for testing
func (*MockVerifier) GetCallCount ¶
func (m *MockVerifier) GetCallCount() int
GetCallCount returns the number of verification calls made
func (*MockVerifier) GetLastCall ¶
func (m *MockVerifier) GetLastCall() *VerifyCall
GetLastCall returns the most recent verification call, or nil if no calls were made
func (*MockVerifier) Reset ¶
func (m *MockVerifier) Reset()
Reset clears the call log and resets the mock state
func (*MockVerifier) SetVerifyFunc ¶
func (m *MockVerifier) SetVerifyFunc(fn func(ctx context.Context, artifactPath, attestationPath string) error)
SetVerifyFunc sets a custom verification function
func (*MockVerifier) SetVerifyResult ¶
func (m *MockVerifier) SetVerifyResult(err error)
SetVerifyResult sets a simple success/failure result for all verifications
func (*MockVerifier) VerifyArtifact ¶
func (m *MockVerifier) VerifyArtifact(ctx context.Context, artifactPath, attestationPath string) error
VerifyArtifact implements the VerifierInterface
func (*MockVerifier) WasCalledWith ¶
func (m *MockVerifier) WasCalledWith(artifactPath, attestationPath string) bool
WasCalledWith checks if the verifier was called with specific paths
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier handles SLSA attestation verification using Go API
func NewVerifier ¶
NewVerifier creates a new SLSA verifier instance