Skip to content

Commit 687f933

Browse files
authored
feat: Add new fields and options to secret scanning structs (#3548)
1 parent 4fd4ea3 commit 687f933

File tree

3 files changed

+181
-18
lines changed

3 files changed

+181
-18
lines changed

github/github-accessors.go

Lines changed: 64 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-accessors_test.go

Lines changed: 85 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/secret_scanning.go

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,32 @@ type SecretScanningService service
1616

1717
// SecretScanningAlert represents a GitHub secret scanning alert.
1818
type SecretScanningAlert struct {
19-
Number *int `json:"number,omitempty"`
20-
CreatedAt *Timestamp `json:"created_at,omitempty"`
21-
URL *string `json:"url,omitempty"`
22-
HTMLURL *string `json:"html_url,omitempty"`
23-
LocationsURL *string `json:"locations_url,omitempty"`
24-
State *string `json:"state,omitempty"`
25-
Resolution *string `json:"resolution,omitempty"`
26-
ResolvedAt *Timestamp `json:"resolved_at,omitempty"`
27-
ResolvedBy *User `json:"resolved_by,omitempty"`
28-
SecretType *string `json:"secret_type,omitempty"`
29-
SecretTypeDisplayName *string `json:"secret_type_display_name,omitempty"`
30-
Secret *string `json:"secret,omitempty"`
31-
Repository *Repository `json:"repository,omitempty"`
32-
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
33-
PushProtectionBypassed *bool `json:"push_protection_bypassed,omitempty"`
34-
PushProtectionBypassedBy *User `json:"push_protection_bypassed_by,omitempty"`
35-
PushProtectionBypassedAt *Timestamp `json:"push_protection_bypassed_at,omitempty"`
36-
ResolutionComment *string `json:"resolution_comment,omitempty"`
19+
Number *int `json:"number,omitempty"`
20+
CreatedAt *Timestamp `json:"created_at,omitempty"`
21+
URL *string `json:"url,omitempty"`
22+
HTMLURL *string `json:"html_url,omitempty"`
23+
LocationsURL *string `json:"locations_url,omitempty"`
24+
State *string `json:"state,omitempty"`
25+
Resolution *string `json:"resolution,omitempty"`
26+
ResolvedAt *Timestamp `json:"resolved_at,omitempty"`
27+
ResolvedBy *User `json:"resolved_by,omitempty"`
28+
SecretType *string `json:"secret_type,omitempty"`
29+
SecretTypeDisplayName *string `json:"secret_type_display_name,omitempty"`
30+
Secret *string `json:"secret,omitempty"`
31+
Repository *Repository `json:"repository,omitempty"`
32+
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
33+
IsBase64Encoded *bool `json:"is_base64_encoded,omitempty"`
34+
MultiRepo *bool `json:"multi_repo,omitempty"`
35+
PubliclyLeaked *bool `json:"publicly_leaked,omitempty"`
36+
PushProtectionBypassed *bool `json:"push_protection_bypassed,omitempty"`
37+
PushProtectionBypassedBy *User `json:"push_protection_bypassed_by,omitempty"`
38+
PushProtectionBypassedAt *Timestamp `json:"push_protection_bypassed_at,omitempty"`
39+
ResolutionComment *string `json:"resolution_comment,omitempty"`
40+
PushProtectionBypassRequestComment *string `json:"push_protection_bypass_request_comment,omitempty"`
41+
PushProtectionBypassRequestHTMLURL *string `json:"push_protection_bypass_request_html_url,omitempty"`
42+
PushProtectionBypassRequestReviewer *User `json:"push_protection_bypass_request_reviewer,omitempty"`
43+
PushProtectionBypassRequestReviewerComment *string `json:"push_protection_bypass_request_reviewer_comment,omitempty"`
44+
Validity *string `json:"validity,omitempty"`
3745
}
3846

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

83+
// A boolean value representing whether or not to filter alerts by the publicly-leaked tag being present. Default: false.
84+
IsPubliclyLeaked bool `url:"is_publicly_leaked,omitempty"`
85+
86+
// A boolean value representing whether or not to filter alerts by the multi-repo tag being present. Default: false.
87+
IsMultiRepo bool `url:"is_multi_repo,omitempty"`
88+
7589
// The direction to sort the results by. Possible values are: asc, desc. Default: desc.
7690
Direction string `url:"direction,omitempty"`
7791

0 commit comments

Comments
 (0)