View Source GitHub.SecretScanning (GitHub REST API Client v0.2.2)
Provides API endpoints related to secret scanning
Link to this section Summary
Functions
Get a secret scanning alert
List secret scanning alerts for an enterprise
List secret scanning alerts for an organization
List secret scanning alerts for a repository
List locations for a secret scanning alert
Update a secret scanning alert
Link to this section Functions
@spec get_alert(String.t(), String.t(), integer(), keyword()) :: {:ok, GitHub.SecretScanning.Alert.t()} | {:error, GitHub.Error.t()}
Get a secret scanning alert
Gets a single secret scanning alert detected in an eligible repository.
To use this endpoint, you must be an administrator for the repository or for the organization that owns the repository, and you must use a personal access token with the repo
scope or security_events
scope.
For public repositories, you may instead use the public_repo
scope.
GitHub Apps must have the secret_scanning_alerts
read permission to use this endpoint.
resources
Resources
@spec list_alerts_for_enterprise( String.t(), keyword() ) :: {:ok, [GitHub.Organization.SecretScanningAlert.t()]} | {:error, GitHub.Error.t()}
List secret scanning alerts for an enterprise
Lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest.
To use this endpoint, you must be a member of the enterprise, and you must use an access token with the repo
scope or security_events
scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager.
options
Options
state
: Set toopen
orresolved
to only list secret scanning alerts in a specific state.secret_type
: A comma-separated list of secret types to return. By default all secret types are returned. See "Secret scanning patterns" for a complete list of secret types.resolution
: A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions arefalse_positive
,wont_fix
,revoked
,pattern_edited
,pattern_deleted
orused_in_tests
.sort
: The property to sort the results by.created
means when the alert was created.updated
means when the alert was updated or resolved.direction
: The direction to sort the results by.per_page
: The number of results per page (max 100).before
: A cursor, as given in the Link header. If specified, the query only searches for results before this cursor.after
: A cursor, as given in the Link header. If specified, the query only searches for results after this cursor.
resources
Resources
@spec list_alerts_for_org( String.t(), keyword() ) :: {:ok, [GitHub.Organization.SecretScanningAlert.t()]} | {:error, GitHub.Error.t()}
List secret scanning alerts for an organization
Lists secret scanning alerts for eligible repositories in an organization, from newest to oldest.
To use this endpoint, you must be an administrator or security manager for the organization, and you must use an access token with the repo
scope or security_events
scope.
For public repositories, you may instead use the public_repo
scope.
GitHub Apps must have the secret_scanning_alerts
read permission to use this endpoint.
options
Options
state
: Set toopen
orresolved
to only list secret scanning alerts in a specific state.secret_type
: A comma-separated list of secret types to return. By default all secret types are returned. See "Secret scanning patterns" for a complete list of secret types.resolution
: A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions arefalse_positive
,wont_fix
,revoked
,pattern_edited
,pattern_deleted
orused_in_tests
.sort
: The property to sort the results by.created
means when the alert was created.updated
means when the alert was updated or resolved.direction
: The direction to sort the results by.page
: Page number of the results to fetch.per_page
: The number of results per page (max 100).before
: A cursor, as given in the Link header. If specified, the query only searches for events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string.after
: A cursor, as given in the Link header. If specified, the query only searches for events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string.
resources
Resources
@spec list_alerts_for_repo(String.t(), String.t(), keyword()) :: {:ok, [GitHub.SecretScanning.Alert.t()]} | {:error, GitHub.Error.t()}
List secret scanning alerts for a repository
Lists secret scanning alerts for an eligible repository, from newest to oldest.
To use this endpoint, you must be an administrator for the repository or for the organization that owns the repository, and you must use a personal access token with the repo
scope or security_events
scope.
For public repositories, you may instead use the public_repo
scope.
GitHub Apps must have the secret_scanning_alerts
read permission to use this endpoint.
options
Options
state
: Set toopen
orresolved
to only list secret scanning alerts in a specific state.secret_type
: A comma-separated list of secret types to return. By default all secret types are returned. See "Secret scanning patterns" for a complete list of secret types.resolution
: A comma-separated list of resolutions. Only secret scanning alerts with one of these resolutions are listed. Valid resolutions arefalse_positive
,wont_fix
,revoked
,pattern_edited
,pattern_deleted
orused_in_tests
.sort
: The property to sort the results by.created
means when the alert was created.updated
means when the alert was updated or resolved.direction
: The direction to sort the results by.page
: Page number of the results to fetch.per_page
: The number of results per page (max 100).before
: A cursor, as given in the Link header. If specified, the query only searches for events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string.after
: A cursor, as given in the Link header. If specified, the query only searches for events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string.
resources
Resources
@spec list_locations_for_alert(String.t(), String.t(), integer(), keyword()) :: {:ok, [GitHub.SecretScanning.Location.t()]} | {:error, GitHub.Error.t()}
List locations for a secret scanning alert
Lists all locations for a given secret scanning alert for an eligible repository.
To use this endpoint, you must be an administrator for the repository or for the organization that owns the repository, and you must use a personal access token with the repo
scope or security_events
scope.
For public repositories, you may instead use the public_repo
scope.
GitHub Apps must have the secret_scanning_alerts
read permission to use this endpoint.
options
Options
page
: Page number of the results to fetch.per_page
: The number of results per page (max 100).
resources
Resources
@spec update_alert(String.t(), String.t(), integer(), map(), keyword()) :: {:ok, GitHub.SecretScanning.Alert.t()} | {:error, GitHub.Error.t()}
Update a secret scanning alert
Updates the status of a secret scanning alert in an eligible repository.
To use this endpoint, you must be an administrator for the repository or for the organization that owns the repository, and you must use a personal access token with the repo
scope or security_events
scope.
For public repositories, you may instead use the public_repo
scope.
GitHub Apps must have the secret_scanning_alerts
write permission to use this endpoint.