Repository: google/go-github
File: github/secret_scanning.go (Go)

Code before:
// Copyright 2022 The go-github AUTHORS. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package github

import (
	"context"
	"fmt"
)

// SecretScanningService handles communication with the secret scanning related
// methods of the GitHub API.
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"`
	FirstLocation                              *SecretScanningAlertLocationDetails `json:"first_location_detected,omitempty"`
	HasMoreLocations                           *bool                               `json:"has_more_locations,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.

Review comment (security):
```suggestion
	FirstLocationDetected                              *SecretScanningAlertLocationDetails `json:"first_location_detected,omitempty"`
```

Code after:
// Copyright 2022 The go-github AUTHORS. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package github

import (
	"context"
	"fmt"
)

// SecretScanningService handles communication with the secret scanning related
// methods of the GitHub API.
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"`
	FirstLocationDetected                      *SecretScanningAlertLocationDetails `json:"first_location_detected,omitempty"`
	HasMoreLocations                           *bool                               `json:"has_more_locations,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.