List locations of a source
List the files of a source that still hold a secret, on the default branch of the source.
One location is one file and one secret incident. It carries the position of every match of the secret in that file, so that you can point a developer at the exact lines to change. A location disappears once the secret is removed from the file. Locations are only computed for VCS sources.
Path parameters
The id of the source to list the locations of.
Query parameters
Pagination cursor.
Number of items to list per page.
When true, only return locations if GitGuardian currently monitors the source, that is if the source is not unmonitored, archived, deleted, nor installed through a revoked installation. When false, only return them otherwise.
Locations mentioning their secret at least this number of times.
Locations mentioning their secret at most this number of times.
Locations whose code fix request has the following status. Use none to filter locations without any code fix request.
Locations whose filepath contains this value.
Sort the results by their field value. The default sort is ASC, DESC if the field is preceded by a '-'.
Response
Source Location List
Example response
[
{
"id": 4421,
"incident_id": 3759,
"filepath": "config/settings.py",
"matches": [
{
"name": "apikey",
"line_start": 12,
"line_end": 12,
"index_start": 320,
"index_end": 352
}
],
"number_of_mentions": 2,
"last_updated_at": "2021-05-20T12:40:55.662949Z",
"source": {
"id": 6531,
"type": "github",
"full_name": "gitguardian/gg-shield",
"default_branch": "main",
"visibility": "private"
},
"remediation_prs": [
{
"created_at": "2021-05-20T12:40:55.662949Z",
"url": "https://github.com/GitGuardian/ggshield/pull/123",
"branch_name": "gitguardian/remove-secret",
"target_branch_name": "main",
"status": "OPEN",
"title": "Remove hardcoded GitGuardian token",
"description": "Replaces the hardcoded token with an environment variable.",
"last_actor_name": "Eric",
"external_id": "123"
}
],
"branch_name": "main",
"external_url": "https://github.com/GitGuardian/ggshield/blob/main/config/settings.py",
"external_url_matches_highlighted": "https://github.com/GitGuardian/ggshield/blob/main/config/settings.py#L12"
}
]