Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
565 changes: 565 additions & 0 deletions cmd/sign-cache_test.go

Large diffs are not rendered by default.

632 changes: 632 additions & 0 deletions pkg/leeway/cache/remote/s3_performance_test.go

Large diffs are not rendered by default.

636 changes: 636 additions & 0 deletions pkg/leeway/cache/remote/s3_resilience_test.go

Large diffs are not rendered by default.

22 changes: 10 additions & 12 deletions pkg/leeway/signing/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ import (

// GitHubContext contains GitHub Actions environment information
type GitHubContext struct {
RunID string // GITHUB_RUN_ID
RunNumber string // GITHUB_RUN_NUMBER
Actor string // GITHUB_ACTOR
Repository string // GITHUB_REPOSITORY
Ref string // GITHUB_REF
SHA string // GITHUB_SHA
ServerURL string // GITHUB_SERVER_URL
WorkflowRef string // GITHUB_WORKFLOW_REF
RunID string // GITHUB_RUN_ID
RunNumber string // GITHUB_RUN_NUMBER
Actor string // GITHUB_ACTOR
Repository string // GITHUB_REPOSITORY
Ref string // GITHUB_REF
SHA string // GITHUB_SHA
ServerURL string // GITHUB_SERVER_URL
WorkflowRef string // GITHUB_WORKFLOW_REF
}

// Validate ensures all required GitHub context fields are present
Expand Down Expand Up @@ -72,8 +72,6 @@ type SignedAttestationResult struct {
ArtifactName string `json:"artifact_name"` // Name of the artifact
}



// GenerateSignedSLSAAttestation generates and signs SLSA provenance in one integrated step
func GenerateSignedSLSAAttestation(ctx context.Context, artifactPath string, githubCtx *GitHubContext) (*SignedAttestationResult, error) {
// Calculate artifact checksum
Expand Down Expand Up @@ -172,7 +170,7 @@ func computeSHA256(filePath string) (string, error) {
if err != nil {
return "", fmt.Errorf("failed to open file: %w", err)
}
defer file.Close()
defer func() { _ = file.Close() }()

hash := sha256.New()
if _, err := io.Copy(hash, file); err != nil {
Expand Down Expand Up @@ -355,4 +353,4 @@ func validateSigstoreEnvironment() error {

log.Debug("Sigstore environment validation passed")
return nil
}
}
Loading
Loading