Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Token-Permissions: use same text for read token details as write token details #4025

Merged
merged 3 commits into from
Apr 12, 2024
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
2 changes: 2 additions & 0 deletions checks/evaluation/signed_releases.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import (
var errNoReleaseFound = errors.New("no release found")

// SignedReleases applies the score policy for the Signed-Releases check.
//
//nolint:gocognit // surpressing for now
func SignedReleases(name string,
findings []finding.Finding, dl checker.DetailLogger,
) checker.CheckResult {
Expand Down
10 changes: 6 additions & 4 deletions probes/internal/utils/permissions/permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,13 @@
r checker.TokenPermission,
metadata map[string]string,
) (*finding.Finding, error) {
f, err := finding.NewWith(fs, probe,
"found token with 'read' permissions",
nil, finding.OutcomeTrue)
text, err := createText(r)
if err != nil {
return nil, fmt.Errorf("%w", err)
return nil, err
}

Check warning on line 96 in probes/internal/utils/permissions/permissions.go

View check run for this annotation

Codecov / codecov/patch

probes/internal/utils/permissions/permissions.go#L95-L96

Added lines #L95 - L96 were not covered by tests
f, err := finding.NewWith(fs, probe, text, nil, finding.OutcomeTrue)
if err != nil {
return nil, fmt.Errorf("create finding: %w", err)

Check warning on line 99 in probes/internal/utils/permissions/permissions.go

View check run for this annotation

Codecov / codecov/patch

probes/internal/utils/permissions/permissions.go#L99

Added line #L99 was not covered by tests
}
if r.File != nil {
f = f.WithLocation(r.File.Location())
Expand Down
Loading