Skip to content
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

(Fix): Update gitleaks test data #900

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion linters/gitleaks/test_data/basic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
aws_access_key_id = "AKIAIO5FODNN7EXAMPLE"

aws_token = "AKIALALEMEL33243OLIA"

aws_access_key_id = "AKIAIO5FODNN7EXAMPLE"
private_key = """-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACA8YWKYztuuvxUIMomc3zv0OdXCT57Cc2cRYu3TMbX9XAAAAJDiKO3C4ijt
wgAAAAtzc2gtZWQyNTUxOQAAACA8YWKYztuuvxUIMomc3zv0OdXCT57Cc2cRYu3TMbX9XA
AAAECzmj8DGxg5YHtBK4AmBttMXDQHsPAaCyYHQjJ4YujRBTxhYpjO266/FQgyiZzfO/Q5
1cJPnsJzZxFi7dMxtf1cAAAADHJvb3RAZGV2aG9zdAE=
-----END OPENSSH PRIVATE KEY-----"""
24 changes: 21 additions & 3 deletions linters/gitleaks/test_data/gitleaks_v8.1.3_basic.check.shot
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,36 @@ exports[`Testing linter gitleaks test basic 1`] = `
},
{
"code": "aws-access-token",
"column": "23",
"column": "15",
"file": "test_data/basic.py",
"issueClass": "ISSUE_CLASS_EXISTING",
"level": "LEVEL_HIGH",
"line": "4",
"line": "3",
"linter": "gitleaks",
"message": "aws-access-token has detected secret for file test_data/basic.py.",
"ranges": [
{
"filePath": "test_data/basic.py",
"length": "19",
"offset": "67",
"offset": "58",
},
],
"targetType": "ALL",
},
{
"code": "OPENSSH-PK",
"column": "19",
"file": "test_data/basic.py",
"issueClass": "ISSUE_CLASS_EXISTING",
"level": "LEVEL_HIGH",
"line": "5",
"linter": "gitleaks",
"message": "OPENSSH-PK has detected secret for file test_data/basic.py.",
"ranges": [
{
"filePath": "test_data/basic.py",
"length": "34",
"offset": "98",
},
],
"targetType": "ALL",
Expand Down
68 changes: 68 additions & 0 deletions linters/gitleaks/test_data/gitleaks_v8.21.2_basic.check.shot
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
// trunk-upgrade-validation:RELEASE

exports[`Testing linter gitleaks test basic 1`] = `
{
"issues": [
{
"code": "aws-access-token",
"column": "15",
"file": "test_data/basic.py",
"issueClass": "ISSUE_CLASS_EXISTING",
"level": "LEVEL_HIGH",
"line": "3",
"linter": "gitleaks",
"message": "aws-access-token has detected secret for file test_data/basic.py.",
"ranges": [
{
"filePath": "test_data/basic.py",
"length": "20",
"offset": "58",
},
],
"targetType": "ALL",
},
{
"code": "private-key",
"column": "19",
"file": "test_data/basic.py",
"issueClass": "ISSUE_CLASS_EXISTING",
"level": "LEVEL_HIGH",
"line": "5",
"linter": "gitleaks",
"message": "private-key has detected secret for file test_data/basic.py.",
"ranges": [
{
"filePath": "test_data/basic.py",
"length": "397",
"offset": "98",
},
],
"targetType": "ALL",
},
],
"lintActions": [
{
"command": "lint",
"fileGroupName": "ALL",
"linter": "gitleaks",
"paths": [
"test_data/basic.py",
],
"verb": "TRUNK_VERB_CHECK",
},
{
"command": "lint",
"fileGroupName": "ALL",
"linter": "gitleaks",
"paths": [
"test_data/basic.py",
],
"upstream": true,
"verb": "TRUNK_VERB_CHECK",
},
],
"taskFailures": [],
"unformattedFiles": [],
}
`;
24 changes: 21 additions & 3 deletions linters/gitleaks/test_data/gitleaks_v8.8.7_basic.check.shot
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,36 @@ exports[`Testing linter gitleaks test basic 1`] = `
},
{
"code": "aws-access-token",
"column": "23",
"column": "15",
"file": "test_data/basic.py",
"issueClass": "ISSUE_CLASS_EXISTING",
"level": "LEVEL_HIGH",
"line": "4",
"line": "3",
"linter": "gitleaks",
"message": "aws-access-token has detected secret for file test_data/basic.py.",
"ranges": [
{
"filePath": "test_data/basic.py",
"length": "19",
"offset": "67",
"offset": "58",
},
],
"targetType": "ALL",
},
{
"code": "private-key",
"column": "19",
"file": "test_data/basic.py",
"issueClass": "ISSUE_CLASS_EXISTING",
"level": "LEVEL_HIGH",
"line": "5",
"linter": "gitleaks",
"message": "private-key has detected secret for file test_data/basic.py.",
"ranges": [
{
"filePath": "test_data/basic.py",
"length": "396",
"offset": "98",
},
],
"targetType": "ALL",
Expand Down
Loading