Skip to content

feat: Add new fields and options to secret scanning structs #3548

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

Merged
merged 10 commits into from
Apr 15, 2025
64 changes: 64 additions & 0 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 85 additions & 0 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 32 additions & 18 deletions github/secret_scanning.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,32 @@ type SecretScanningService service

// SecretScanningAlert represents a GitHub secret scanning alert.
type SecretScanningAlert struct {
Number *int `json:"number,omitempty"`
CreatedAt *Timestamp `json:"created_at,omitempty"`
URL *string `json:"url,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
LocationsURL *string `json:"locations_url,omitempty"`
State *string `json:"state,omitempty"`
Resolution *string `json:"resolution,omitempty"`
ResolvedAt *Timestamp `json:"resolved_at,omitempty"`
ResolvedBy *User `json:"resolved_by,omitempty"`
SecretType *string `json:"secret_type,omitempty"`
SecretTypeDisplayName *string `json:"secret_type_display_name,omitempty"`
Secret *string `json:"secret,omitempty"`
Repository *Repository `json:"repository,omitempty"`
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
PushProtectionBypassed *bool `json:"push_protection_bypassed,omitempty"`
PushProtectionBypassedBy *User `json:"push_protection_bypassed_by,omitempty"`
PushProtectionBypassedAt *Timestamp `json:"push_protection_bypassed_at,omitempty"`
ResolutionComment *string `json:"resolution_comment,omitempty"`
Number *int `json:"number,omitempty"`
CreatedAt *Timestamp `json:"created_at,omitempty"`
URL *string `json:"url,omitempty"`
HTMLURL *string `json:"html_url,omitempty"`
LocationsURL *string `json:"locations_url,omitempty"`
State *string `json:"state,omitempty"`
Resolution *string `json:"resolution,omitempty"`
ResolvedAt *Timestamp `json:"resolved_at,omitempty"`
ResolvedBy *User `json:"resolved_by,omitempty"`
SecretType *string `json:"secret_type,omitempty"`
SecretTypeDisplayName *string `json:"secret_type_display_name,omitempty"`
Secret *string `json:"secret,omitempty"`
Repository *Repository `json:"repository,omitempty"`
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
IsBase64Encoded *bool `json:"is_base64_encoded,omitempty"`
MultiRepo *bool `json:"multi_repo,omitempty"`
PubliclyLeaked *bool `json:"publicly_leaked,omitempty"`
PushProtectionBypassed *bool `json:"push_protection_bypassed,omitempty"`
PushProtectionBypassedBy *User `json:"push_protection_bypassed_by,omitempty"`
PushProtectionBypassedAt *Timestamp `json:"push_protection_bypassed_at,omitempty"`
ResolutionComment *string `json:"resolution_comment,omitempty"`
PushProtectionBypassRequestComment *string `json:"push_protection_bypass_request_comment,omitempty"`
PushProtectionBypassRequestHTMLURL *string `json:"push_protection_bypass_request_html_url,omitempty"`
PushProtectionBypassRequestReviewer *User `json:"push_protection_bypass_request_reviewer,omitempty"`
PushProtectionBypassRequestReviewerComment *string `json:"push_protection_bypass_request_reviewer_comment,omitempty"`
Validity *string `json:"validity,omitempty"`
}

// SecretScanningAlertLocation represents the location for a secret scanning alert.
Expand Down Expand Up @@ -72,6 +80,12 @@ type SecretScanningAlertListOptions struct {
// Valid options are active, inactive, and unknown.
Validity string `url:"validity,omitempty"`

// A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. Default: false.
IsPubliclyLeaked bool `url:"is_publicly_leaked,omitempty"`

// A boolean value representing whether or not to filter alerts by the multi-repo tag being present. Default: false.
IsMultiRepo bool `url:"is_multi_repo,omitempty"`

// The direction to sort the results by. Possible values are: asc, desc. Default: desc.
Direction string `url:"direction,omitempty"`

Expand Down
Loading