From 1ae7b9c3bbdf776065893737a9d77843f7de4564 Mon Sep 17 00:00:00 2001 From: Henri Hubert Date: Thu, 7 Aug 2025 20:03:43 +0200 Subject: [PATCH 1/2] chore: replace snapshottest with syrupy and support py3.12 --- .gitguardian.yaml | 1 + .github/workflows/ci.yml | 2 +- .pre-commit-config.yaml | 2 +- pdm.lock | 95 +-- pyproject.toml | 3 +- tests/unit/cmd/snapshots/__init__.py | 0 tests/unit/core/scan/snapshots/__init__.py | 0 .../scan/snapshots/snap_test_scannable.py | 19 - tests/unit/core/test_filter.py | 3 +- .../__snapshots__/test_secret_scanner.ambr | 44 ++ .../__snapshots__/test_text_output.ambr | 689 ++++++++++++++++++ .../secret/output/snapshots/__init__.py | 0 .../output/snapshots/snap_test_text_output.py | 624 ---------------- .../secret/output/test_text_output.py | 2 +- .../verticals/secret/snapshots/__init__.py | 0 .../snapshots/snap_test_secret_scanner.py | 42 -- .../verticals/secret/test_secret_scanner.py | 2 +- 17 files changed, 754 insertions(+), 774 deletions(-) delete mode 100644 tests/unit/cmd/snapshots/__init__.py delete mode 100644 tests/unit/core/scan/snapshots/__init__.py delete mode 100644 tests/unit/core/scan/snapshots/snap_test_scannable.py create mode 100644 tests/unit/verticals/secret/__snapshots__/test_secret_scanner.ambr create mode 100644 tests/unit/verticals/secret/output/__snapshots__/test_text_output.ambr delete mode 100644 tests/unit/verticals/secret/output/snapshots/__init__.py delete mode 100644 tests/unit/verticals/secret/output/snapshots/snap_test_text_output.py delete mode 100644 tests/unit/verticals/secret/snapshots/__init__.py delete mode 100644 tests/unit/verticals/secret/snapshots/snap_test_secret_scanner.py diff --git a/.gitguardian.yaml b/.gitguardian.yaml index bf3979bf38..349cdbff26 100644 --- a/.gitguardian.yaml +++ b/.gitguardian.yaml @@ -34,3 +34,4 @@ secret: - .env - 'tests/unit/cassettes/*' - 'tests/unit/**/snapshots/*' + - 'tests/unit/verticals/secret/output/__snapshots__/*' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f900a747d..7ea7e9c1b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-22.04, macos-13, windows-2022] - python-version: ['3.9', '3.10', '3.11'] + python-version: ['3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 with: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7a206639b6..45fd17cb70 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: rev: v5.0.0 hooks: - id: trailing-whitespace - exclude: \.importlinter|tests/unit/verticals/secret/output/snapshots/.*|tests/unit/core/scan/test_commit_utils.py + exclude: \.importlinter|tests/unit/verticals/secret(/output)?/__snapshots__/.*|tests/unit/core/scan/test_commit_utils.py - id: check-json - id: check-added-large-files - id: check-yaml diff --git a/pdm.lock b/pdm.lock index cf0250f2dd..1c69e9b676 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "dev", "standalone", "tests"] strategy = ["inherit_metadata"] lock_version = "4.5.0" -content_hash = "sha256:e47b3e2d34121bf947129d8a64b4b5a06c8dbbceb0129f6b41a454f3b0b4d274" +content_hash = "sha256:ddac5a0aa4f7ec15e54d2843eb580a5fef756d7fe538636477ebbb8ab991a329" [[metadata.targets]] requires_python = ">=3.9" @@ -557,7 +557,7 @@ files = [ [[package]] name = "faker" -version = "37.5.3" +version = "37.6.0" requires_python = ">=3.9" summary = "Faker is a Python package that generates fake data for you." groups = ["tests"] @@ -565,22 +565,8 @@ dependencies = [ "tzdata", ] files = [ - {file = "faker-37.5.3-py3-none-any.whl", hash = "sha256:386fe9d5e6132a915984bf887fcebcc72d6366a25dd5952905b31b141a17016d"}, - {file = "faker-37.5.3.tar.gz", hash = "sha256:8315d8ff4d6f4f588bd42ffe63abd599886c785073e26a44707e10eeba5713dc"}, -] - -[[package]] -name = "fastdiff" -version = "0.3.0" -summary = "A fast native implementation of diff algorithm with a pure python fallback" -groups = ["tests"] -dependencies = [ - "wasmer-compiler-cranelift>=1.0.0", - "wasmer>=1.0.0", -] -files = [ - {file = "fastdiff-0.3.0-py2.py3-none-any.whl", hash = "sha256:ca5f61f6ddf5a1564ddfd98132ad28e7abe4a88a638a8b014a2214f71e5918ec"}, - {file = "fastdiff-0.3.0.tar.gz", hash = "sha256:4dfa09c47832a8c040acda3f1f55fc0ab4d666f0e14e6951e6da78d59acd945a"}, + {file = "faker-37.6.0-py3-none-any.whl", hash = "sha256:3c5209b23d7049d596a51db5d76403a0ccfea6fc294ffa2ecfef6a8843b1e6a7"}, + {file = "faker-37.6.0.tar.gz", hash = "sha256:0f8cc34f30095184adf87c3c24c45b38b33ad81c35ef6eb0a3118f301143012c"}, ] [[package]] @@ -2241,32 +2227,6 @@ files = [ {file = "setuptools-80.9.0.tar.gz", hash = "sha256:f36b47402ecde768dbfafc46e8e4207b4360c654f1f3bb84475f0a28628fb19c"}, ] -[[package]] -name = "six" -version = "1.17.0" -requires_python = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" -summary = "Python 2 and 3 compatibility utilities" -groups = ["tests"] -files = [ - {file = "six-1.17.0-py2.py3-none-any.whl", hash = "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274"}, - {file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"}, -] - -[[package]] -name = "snapshottest" -version = "0.6.0" -summary = "Snapshot testing for pytest, unittest, Django, and Nose" -groups = ["tests"] -dependencies = [ - "fastdiff<1,>=0.1.4", - "six>=1.10.0", - "termcolor", -] -files = [ - {file = "snapshottest-0.6.0-py2.py3-none-any.whl", hash = "sha256:9b177cffe0870c589df8ddbee0a770149c5474b251955bdbde58b7f32a4ec429"}, - {file = "snapshottest-0.6.0.tar.gz", hash = "sha256:bbcaf81d92d8e330042e5c928e13d9f035e99e91b314fe55fda949c2f17b653c"}, -] - [[package]] name = "stack-data" version = "0.6.3" @@ -2283,14 +2243,17 @@ files = [ ] [[package]] -name = "termcolor" -version = "3.1.0" -requires_python = ">=3.9" -summary = "ANSI color formatting for output in terminal" +name = "syrupy" +version = "4.9.1" +requires_python = ">=3.8.1" +summary = "Pytest Snapshot Test Utility" groups = ["tests"] +dependencies = [ + "pytest<9.0.0,>=7.0.0", +] files = [ - {file = "termcolor-3.1.0-py3-none-any.whl", hash = "sha256:591dd26b5c2ce03b9e43f391264626557873ce1d379019786f99b0c2bee140aa"}, - {file = "termcolor-3.1.0.tar.gz", hash = "sha256:6a6dd7fbee581909eeec6a756cff1d7f7c376063b14e4a298dc4980309e55970"}, + {file = "syrupy-4.9.1-py3-none-any.whl", hash = "sha256:b94cc12ed0e5e75b448255430af642516842a2374a46936dd2650cfb6dd20eda"}, + {file = "syrupy-4.9.1.tar.gz", hash = "sha256:b7d0fcadad80a7d2f6c4c71917918e8ebe2483e8c703dfc8d49cdbb01081f9a4"}, ] [[package]] @@ -2467,38 +2430,6 @@ files = [ {file = "voluptuous-0.14.2.tar.gz", hash = "sha256:533e36175967a310f1b73170d091232bf881403e4ebe52a9b4ade8404d151f5d"}, ] -[[package]] -name = "wasmer" -version = "1.1.0" -summary = "Python extension to run WebAssembly binaries" -groups = ["tests"] -files = [ - {file = "wasmer-1.1.0-cp310-cp310-macosx_10_7_x86_64.whl", hash = "sha256:c2af4b907ae2dabcac41e316e811d5937c93adf1f8b05c5d49427f8ce0f37630"}, - {file = "wasmer-1.1.0-cp310-cp310-manylinux_2_24_x86_64.whl", hash = "sha256:ab1ae980021e5ec0bf0c6cdd3b979b1d15a5f3eb2b8a32da8dcb1156e4a1e484"}, - {file = "wasmer-1.1.0-cp310-none-win_amd64.whl", hash = "sha256:d0d93aec6215893d33e803ef0a8d37bf948c585dd80ba0e23a83fafee820bc03"}, - {file = "wasmer-1.1.0-cp39-cp39-macosx_10_7_x86_64.whl", hash = "sha256:ee442f0970f40ec5e32011c92fd753fb2061da0faa13de13fafc730c31be34e3"}, - {file = "wasmer-1.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:aa112198b743cff2e391230436813fb4b244a24443e37866522b7197e3a034da"}, - {file = "wasmer-1.1.0-cp39-cp39-manylinux_2_24_x86_64.whl", hash = "sha256:c0b37117f6d3ff51ee96431c7d224d99799b08d174e30fcd0fcd7e2e3cb8140c"}, - {file = "wasmer-1.1.0-cp39-none-win_amd64.whl", hash = "sha256:a0a4730ec4907a4cb0d9d4a77ea2608c2c814f22a22b73fc80be0f110e014836"}, - {file = "wasmer-1.1.0-py3-none-any.whl", hash = "sha256:2caf8c67feae9cd4246421551036917811c446da4f27ad4c989521ef42751931"}, -] - -[[package]] -name = "wasmer-compiler-cranelift" -version = "1.1.0" -summary = "The Cranelift compiler for the `wasmer` package (to compile WebAssembly module)" -groups = ["tests"] -files = [ - {file = "wasmer_compiler_cranelift-1.1.0-cp310-cp310-macosx_10_7_x86_64.whl", hash = "sha256:9869910179f39696a020edc5689f7759257ac1cce569a7a0fcf340c59788baad"}, - {file = "wasmer_compiler_cranelift-1.1.0-cp310-cp310-manylinux_2_24_x86_64.whl", hash = "sha256:405546ee864ac158a4107f374dfbb1c8d6cfb189829bdcd13050143a4bd98f28"}, - {file = "wasmer_compiler_cranelift-1.1.0-cp310-none-win_amd64.whl", hash = "sha256:bdf75af9ef082e6aeb752550f694273340ece970b65099e0746db0f972760d11"}, - {file = "wasmer_compiler_cranelift-1.1.0-cp39-cp39-macosx_10_7_x86_64.whl", hash = "sha256:ff25fc99ebafa04a6c271d08a90d17b927930e3019a2b333c7cfb48ba32c6f71"}, - {file = "wasmer_compiler_cranelift-1.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9697ae082317a56776df8ff7df8c922eac38488ef38d3478fe5f0ca144c185ab"}, - {file = "wasmer_compiler_cranelift-1.1.0-cp39-cp39-manylinux_2_24_x86_64.whl", hash = "sha256:2a4349b1ddd727bd46bc5ede741839dcfc5153c52f064a83998c4150d5d4a85c"}, - {file = "wasmer_compiler_cranelift-1.1.0-cp39-none-win_amd64.whl", hash = "sha256:32fe38614fccc933da77ee4372904a5fa9c12b859209a2e4048a8284c4c371f2"}, - {file = "wasmer_compiler_cranelift-1.1.0-py3-none-any.whl", hash = "sha256:200fea80609cfb088457327acf66d5aa61f4c4f66b5a71133ada960b534c7355"}, -] - [[package]] name = "wcwidth" version = "0.2.13" diff --git a/pyproject.toml b/pyproject.toml index bc001e9554..3d63cfff95 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,6 +27,7 @@ classifiers = [ "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.9", "Operating System :: OS Independent", "Topic :: Security", @@ -123,7 +124,7 @@ tests = [ "pytest-xdist", "pytest-voluptuous", "seed-isort-config", - "snapshottest", + "syrupy", "import-linter", "jsonschema", "vcrpy>=5.1.0", diff --git a/tests/unit/cmd/snapshots/__init__.py b/tests/unit/cmd/snapshots/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/core/scan/snapshots/__init__.py b/tests/unit/core/scan/snapshots/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/core/scan/snapshots/snap_test_scannable.py b/tests/unit/core/scan/snapshots/snap_test_scannable.py deleted file mode 100644 index ce3db042c8..0000000000 --- a/tests/unit/core/scan/snapshots/snap_test_scannable.py +++ /dev/null @@ -1,19 +0,0 @@ -# snapshottest: v1 - https://goo.gl/zC4yUc - -from snapshottest import Snapshot - - -snapshots = Snapshot() - -snapshots['test_handle_scan_error[single file exception] 1'] = ''' -Error scanning. Results may be incomplete. -Add the following files to your paths-ignore: -- /home/user/too/long/file/name: filename:: [ErrorDetail(string='Ensure this field has no more than 256 characters.', code='max_length')] -''' - -snapshots['test_handle_scan_error[too many documents] 1'] = ''' -Error scanning. Results may be incomplete. -The following chunk is affected: -/example, /example, /example, /example, /example, /example, /example, /example, /example, /example, /example, /example, /example, /example, /example, /example, /example, /example, /example, /example, /example -400:Too many documents to scan -''' diff --git a/tests/unit/core/test_filter.py b/tests/unit/core/test_filter.py index 8b4b2f89a4..6e0230e6c0 100644 --- a/tests/unit/core/test_filter.py +++ b/tests/unit/core/test_filter.py @@ -4,7 +4,6 @@ import pytest from pygitguardian.models import Match, PolicyBreak -from snapshottest import Snapshot from ggshield.core.filter import censor_match, censor_string, get_ignore_sha from tests.unit.conftest import ( @@ -69,7 +68,7 @@ def test_get_ignore_sha( policy_breaks: List[PolicyBreak], duplicates: bool, expected_shas: Set[str], - snapshot: Snapshot, + snapshot, ) -> None: copy_policy_breaks = copy.deepcopy(policy_breaks) if duplicates: diff --git a/tests/unit/verticals/secret/__snapshots__/test_secret_scanner.ambr b/tests/unit/verticals/secret/__snapshots__/test_secret_scanner.ambr new file mode 100644 index 0000000000..48517b1ba9 --- /dev/null +++ b/tests/unit/verticals/secret/__snapshots__/test_secret_scanner.ambr @@ -0,0 +1,44 @@ +# serializer version: 1 +# name: test_handle_scan_error[single file exception] + ''' + Error: Scanning failed. Results may be incomplete. + Error: Add the following files to your ignored_paths: + Error: - /home/user/too/long/file/name: filename:: [ErrorDetail(string='Ensure this field has no more than 256 characters.', code='max_length')] + + ''' +# --- +# name: test_handle_scan_error[source not found] + ''' + Error: The provided source was not found in GitGuardian. + + ''' +# --- +# name: test_handle_scan_error[too many documents] + ''' + Error: Scanning failed. Results may be incomplete. + Error: The following chunk is affected: + - /example + - /example + - /example + - /example + - /example + - /example + - /example + - /example + - /example + - /example + - /example + - /example + - /example + - /example + - /example + - /example + - /example + - /example + - /example + - /example + - /example + Error: 400:Too many documents to scan + + ''' +# --- diff --git a/tests/unit/verticals/secret/output/__snapshots__/test_text_output.ambr b/tests/unit/verticals/secret/output/__snapshots__/test_text_output.ambr new file mode 100644 index 0000000000..9eaec27ffa --- /dev/null +++ b/tests/unit/verticals/secret/output/__snapshots__/test_text_output.ambr @@ -0,0 +1,689 @@ +# serializer version: 1 +# name: test_leak_message[_MULTI_SECRET_ONE_LINE_PATCH_OVERLAY_SCAN_RESULT-clip_long_lines-hide_secrets] + ''' + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: Facebook Access Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token + + | @@ -0,0 +1 @@ + 1 | +Facebook = 294*********575 | ce3f9f********************5e4372; + |__client_id__| + 1 | +Facebook = 294*********575 | ce3f9f********************5e4372; + |_________client_secret________| + + ''' +# --- +# name: test_leak_message[_MULTI_SECRET_ONE_LINE_PATCH_OVERLAY_SCAN_RESULT-clip_long_lines-show_secrets] + ''' + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: Facebook Access Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token + + | @@ -0,0 +1 @@ + 1 | +Facebook = 294790898041575 | ce3f9f0362bbe5ab01dfc8ee565e4372; + |__client_id__| + 1 | +Facebook = 294790898041575 | ce3f9f0362bbe5ab01dfc8ee565e4372; + |_________client_secret________| + + ''' +# --- +# name: test_leak_message[_MULTI_SECRET_ONE_LINE_PATCH_OVERLAY_SCAN_RESULT-verbose-hide_secrets] + ''' + + secrets-engine-version: 3.14.159 + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: Facebook Access Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token + + | @@ -0,0 +1 @@ + 1 | +Facebook = 294*********575 | ce3f9f********************5e4372; + |__client_id__| + 1 | +Facebook = 294*********575 | ce3f9f********************5e4372; + |_________client_secret________| + + ''' +# --- +# name: test_leak_message[_MULTI_SECRET_ONE_LINE_PATCH_OVERLAY_SCAN_RESULT-verbose-show_secrets] + ''' + + secrets-engine-version: 3.14.159 + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: Facebook Access Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token + + | @@ -0,0 +1 @@ + 1 | +Facebook = 294790898041575 | ce3f9f0362bbe5ab01dfc8ee565e4372; + |__client_id__| + 1 | +Facebook = 294790898041575 | ce3f9f0362bbe5ab01dfc8ee565e4372; + |_________client_secret________| + + ''' +# --- +# name: test_leak_message[_MULTI_SECRET_ONE_LINE_PATCH_SCAN_RESULT-clip_long_lines-hide_secrets] + ''' + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: Facebook Access Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token + + | @@ -0,0 +1 @@ + 1 | +FacebookAppId = 294*********575; FacebookAppSecret = ce3f9f*************… + |__client_id__| + 1 | +…= 294*********575; FacebookAppSecret = ce3f9f********************5e4372; + |_________client_secret________| + + ''' +# --- +# name: test_leak_message[_MULTI_SECRET_ONE_LINE_PATCH_SCAN_RESULT-clip_long_lines-show_secrets] + ''' + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: Facebook Access Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token + + | @@ -0,0 +1 @@ + 1 | +FacebookAppId = 294790898041575; FacebookAppSecret = ce3f9f0362bbe5ab01d… + |__client_id__| + 1 | +…= 294790898041575; FacebookAppSecret = ce3f9f0362bbe5ab01dfc8ee565e4372; + |_________client_secret________| + + ''' +# --- +# name: test_leak_message[_MULTI_SECRET_ONE_LINE_PATCH_SCAN_RESULT-verbose-hide_secrets] + ''' + + secrets-engine-version: 3.14.159 + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: Facebook Access Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token + + | @@ -0,0 +1 @@ + 1 | +FacebookAppId = 294*********575; FacebookAppSecret = ce3f9f********************5e4372; + |__client_id__| + 1 | +FacebookAppId = 294*********575; FacebookAppSecret = ce3f9f********************5e4372; + |_________client_secret________| + + ''' +# --- +# name: test_leak_message[_MULTI_SECRET_ONE_LINE_PATCH_SCAN_RESULT-verbose-show_secrets] + ''' + + secrets-engine-version: 3.14.159 + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: Facebook Access Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token + + | @@ -0,0 +1 @@ + 1 | +FacebookAppId = 294790898041575; FacebookAppSecret = ce3f9f0362bbe5ab01dfc8ee565e4372; + |__client_id__| + 1 | +FacebookAppId = 294790898041575; FacebookAppSecret = ce3f9f0362bbe5ab01dfc8ee565e4372; + |_________client_secret________| + + ''' +# --- +# name: test_leak_message[_MULTI_SECRET_TWO_LINES_PATCH_SCAN_RESULT-clip_long_lines-hide_secrets] + ''' + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: Facebook Access Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token + + | @@ -0,0 +2 @@ + 1 | +FacebookAppId = 294*********575; + |__client_id__| + 2 | +FacebookAppSecret = ce3f9f********************5e4372; + |_________client_secret________| + + ''' +# --- +# name: test_leak_message[_MULTI_SECRET_TWO_LINES_PATCH_SCAN_RESULT-clip_long_lines-show_secrets] + ''' + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: Facebook Access Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token + + | @@ -0,0 +2 @@ + 1 | +FacebookAppId = 294790898041575; + |__client_id__| + 2 | +FacebookAppSecret = ce3f9f0362bbe5ab01dfc8ee565e4372; + |_________client_secret________| + + ''' +# --- +# name: test_leak_message[_MULTI_SECRET_TWO_LINES_PATCH_SCAN_RESULT-verbose-hide_secrets] + ''' + + secrets-engine-version: 3.14.159 + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: Facebook Access Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token + + | @@ -0,0 +2 @@ + 1 | +FacebookAppId = 294*********575; + |__client_id__| + 2 | +FacebookAppSecret = ce3f9f********************5e4372; + |_________client_secret________| + + ''' +# --- +# name: test_leak_message[_MULTI_SECRET_TWO_LINES_PATCH_SCAN_RESULT-verbose-show_secrets] + ''' + + secrets-engine-version: 3.14.159 + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: Facebook Access Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token + + | @@ -0,0 +2 @@ + 1 | +FacebookAppId = 294790898041575; + |__client_id__| + 2 | +FacebookAppSecret = ce3f9f0362bbe5ab01dfc8ee565e4372; + |_________client_secret________| + + ''' +# --- +# name: test_leak_message[_ONE_LINE_AND_MULTILINE_PATCH_CONTENT-clip_long_lines-hide_secrets] + ''' + > This is an example header + > leak.txt: 3 secrets detected + + >> Secret detected: Facebook Access Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 1945f4a0c42abb19c1a420ddd09b4b4681249a3057c427b95f794b18595e7ffa + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token + + | @@ -0,0 +1,29 @@ + 1 | +FacebookAppKeys: 294*********573 / ce3f9f********************5e4371 ----… + |__client_id__| + 1 | +… 294*********573 / ce3f9f********************5e4371 -----BEGIN RSA PRIV… + |_________client_secret________| + 2 | +MIIBOgIBAAJBAIIRkYjxjE3KIZi******************************+****** + 3 | +**************************************************************** + + >> Secret detected: RSA Private Key + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 060bf63de122848f5efa122fe6cea504aae3b24cea393d887fdefa1529c6a02e + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/private_key_rsa + + | @@ -0,0 +1,29 @@ + 1 | +…**573 / ce3f9f********************5e4371 -----BEGIN RSA PRIVATE KEY----- + 2 | +MIIBOgIBAAJBAIIRkYjxjE3KIZi******************************+****** + 3 | +**************************************************************** + 4 | +**************************************************************** + 5 | +***********+**************************************************** + 6 | +****************+*********************************************** + 7 | +**********************+***************************************** + 8 | +****+******Xme/ovcDeM1+3W/UmSHYUW4b3WYq4 + 9 | +-----END RSA PRIVATE KEY----- token: SG._Yytrtvlj***********************… + |_________________________________apikey_________________________________| + + >> Secret detected: SendGrid Key + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 530e5a4a7ea00814db8845dd0cae5efaa4b974a3ce1c76d0384ba715248a5dc1 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/sendgrid_key + + 7 | +**********************+***************************************** + 8 | +****+******Xme/ovcDeM1+3W/UmSHYUW4b3WYq4 + 9 | +…-- token: SG._Yytrtvlj******************************************-**rRJLGFLBLf0M + |_______________________________apikey______________________________| + + ''' +# --- +# name: test_leak_message[_ONE_LINE_AND_MULTILINE_PATCH_CONTENT-clip_long_lines-show_secrets] + ''' + > This is an example header + > leak.txt: 3 secrets detected + + >> Secret detected: Facebook Access Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 1945f4a0c42abb19c1a420ddd09b4b4681249a3057c427b95f794b18595e7ffa + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token + + | @@ -0,0 +1,29 @@ + 1 | +FacebookAppKeys: 294790898041573 / ce3f9f0362bbe5ab01dfc8ee565e4371 ----… + |__client_id__| + 1 | +… 294790898041573 / ce3f9f0362bbe5ab01dfc8ee565e4371 -----BEGIN RSA PRIV… + |_________client_secret________| + 2 | +MIIBOgIBAAJBAIIRkYjxjE3KIZiEc8k4sWWGNsPYRNE0u0bl5oFVApPLm+uXQ/4l + 3 | +bKO9LFtMiVPy700oMWLScwAN5OAiqVLMvHUCAwEAAQJANLr8nmEWuV6t2hAwhK5I + + >> Secret detected: RSA Private Key + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 060bf63de122848f5efa122fe6cea504aae3b24cea393d887fdefa1529c6a02e + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/private_key_rsa + + | @@ -0,0 +1,29 @@ + 1 | +…41573 / ce3f9f0362bbe5ab01dfc8ee565e4371 -----BEGIN RSA PRIVATE KEY----- + 2 | +MIIBOgIBAAJBAIIRkYjxjE3KIZiEc8k4sWWGNsPYRNE0u0bl5oFVApPLm+uXQ/4l + 3 | +bKO9LFtMiVPy700oMWLScwAN5OAiqVLMvHUCAwEAAQJANLr8nmEWuV6t2hAwhK5I + 4 | +NNmBkEo4M/xFxEtl9J7LKbE2gtNrlCQiJlPP1EMhwAjDOzQcJ3lgFB28dkqH5rMW + 5 | +TQIhANrCE7O+wlCKe0WJqQ3lYlHG91XWyGVgfExJwBDsAD9LAiEAmDY5OSsH0n2A + 6 | +22tthkAvcN1s66lG+0DztOVJ4QLI2z8CIBPeDGwGpx8pdIicN/5LFuLWbyAcoZaT + 7 | +bLaA/DCNPniBAiA0l//bzg+M3srIhm04xzLdR9Vb9IjPRlkvN074zdKDVwIhAKJb + 8 | +RF3C+CMFb0wXme/ovcDeM1+3W/UmSHYUW4b3WYq4 + 9 | +-----END RSA PRIVATE KEY----- token: SG._YytrtvljkWqCrkMa3r5hw.yijiPf2qx… + |_________________________________apikey_________________________________| + + >> Secret detected: SendGrid Key + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 530e5a4a7ea00814db8845dd0cae5efaa4b974a3ce1c76d0384ba715248a5dc1 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/sendgrid_key + + 7 | +bLaA/DCNPniBAiA0l//bzg+M3srIhm04xzLdR9Vb9IjPRlkvN074zdKDVwIhAKJb + 8 | +RF3C+CMFb0wXme/ovcDeM1+3W/UmSHYUW4b3WYq4 + 9 | +…-- token: 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 + |_______________________________apikey______________________________| + + ''' +# --- +# name: test_leak_message[_ONE_LINE_AND_MULTILINE_PATCH_CONTENT-verbose-hide_secrets] + ''' + + secrets-engine-version: 3.14.159 + > This is an example header + > leak.txt: 3 secrets detected + + >> Secret detected: Facebook Access Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 1945f4a0c42abb19c1a420ddd09b4b4681249a3057c427b95f794b18595e7ffa + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token + + | @@ -0,0 +1,29 @@ + 1 | +FacebookAppKeys: 294*********573 / ce3f9f********************5e4371 -----BEGIN RSA PRIVATE KEY----- + |__client_id__| + 1 | +FacebookAppKeys: 294*********573 / ce3f9f********************5e4371 -----BEGIN RSA PRIVATE KEY----- + |_________client_secret________| + 2 | +MIIBOgIBAAJBAIIRkYjxjE3KIZi******************************+****** + 3 | +**************************************************************** + + >> Secret detected: RSA Private Key + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 060bf63de122848f5efa122fe6cea504aae3b24cea393d887fdefa1529c6a02e + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/private_key_rsa + + | @@ -0,0 +1,29 @@ + 1 | +FacebookAppKeys: 294*********573 / ce3f9f********************5e4371 -----BEGIN RSA PRIVATE KEY----- + 2 | +MIIBOgIBAAJBAIIRkYjxjE3KIZi******************************+****** + 3 | +**************************************************************** + 4 | +**************************************************************** + 5 | +***********+**************************************************** + 6 | +****************+*********************************************** + 7 | +**********************+***************************************** + 8 | +****+******Xme/ovcDeM1+3W/UmSHYUW4b3WYq4 + 9 | +-----END RSA PRIVATE KEY----- token: SG._Yytrtvlj******************************************-**rRJLGFLBLf0M + + + >> Secret detected: SendGrid Key + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 530e5a4a7ea00814db8845dd0cae5efaa4b974a3ce1c76d0384ba715248a5dc1 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/sendgrid_key + + 7 | +**********************+***************************************** + 8 | +****+******Xme/ovcDeM1+3W/UmSHYUW4b3WYq4 + 9 | +-----END RSA PRIVATE KEY----- token: SG._Yytrtvlj******************************************-**rRJLGFLBLf0M + |_______________________________apikey______________________________| + + ''' +# --- +# name: test_leak_message[_ONE_LINE_AND_MULTILINE_PATCH_CONTENT-verbose-show_secrets] + ''' + + secrets-engine-version: 3.14.159 + > This is an example header + > leak.txt: 3 secrets detected + + >> Secret detected: Facebook Access Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 1945f4a0c42abb19c1a420ddd09b4b4681249a3057c427b95f794b18595e7ffa + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token + + | @@ -0,0 +1,29 @@ + 1 | +FacebookAppKeys: 294790898041573 / ce3f9f0362bbe5ab01dfc8ee565e4371 -----BEGIN RSA PRIVATE KEY----- + |__client_id__| + 1 | +FacebookAppKeys: 294790898041573 / ce3f9f0362bbe5ab01dfc8ee565e4371 -----BEGIN RSA PRIVATE KEY----- + |_________client_secret________| + 2 | +MIIBOgIBAAJBAIIRkYjxjE3KIZiEc8k4sWWGNsPYRNE0u0bl5oFVApPLm+uXQ/4l + 3 | +bKO9LFtMiVPy700oMWLScwAN5OAiqVLMvHUCAwEAAQJANLr8nmEWuV6t2hAwhK5I + + >> Secret detected: RSA Private Key + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 060bf63de122848f5efa122fe6cea504aae3b24cea393d887fdefa1529c6a02e + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/private_key_rsa + + | @@ -0,0 +1,29 @@ + 1 | +FacebookAppKeys: 294790898041573 / ce3f9f0362bbe5ab01dfc8ee565e4371 -----BEGIN RSA PRIVATE KEY----- + 2 | +MIIBOgIBAAJBAIIRkYjxjE3KIZiEc8k4sWWGNsPYRNE0u0bl5oFVApPLm+uXQ/4l + 3 | +bKO9LFtMiVPy700oMWLScwAN5OAiqVLMvHUCAwEAAQJANLr8nmEWuV6t2hAwhK5I + 4 | +NNmBkEo4M/xFxEtl9J7LKbE2gtNrlCQiJlPP1EMhwAjDOzQcJ3lgFB28dkqH5rMW + 5 | +TQIhANrCE7O+wlCKe0WJqQ3lYlHG91XWyGVgfExJwBDsAD9LAiEAmDY5OSsH0n2A + 6 | +22tthkAvcN1s66lG+0DztOVJ4QLI2z8CIBPeDGwGpx8pdIicN/5LFuLWbyAcoZaT + 7 | +bLaA/DCNPniBAiA0l//bzg+M3srIhm04xzLdR9Vb9IjPRlkvN074zdKDVwIhAKJb + 8 | +RF3C+CMFb0wXme/ovcDeM1+3W/UmSHYUW4b3WYq4 + 9 | +-----END RSA PRIVATE KEY----- token: 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 + + + >> Secret detected: SendGrid Key + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 530e5a4a7ea00814db8845dd0cae5efaa4b974a3ce1c76d0384ba715248a5dc1 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/sendgrid_key + + 7 | +bLaA/DCNPniBAiA0l//bzg+M3srIhm04xzLdR9Vb9IjPRlkvN074zdKDVwIhAKJb + 8 | +RF3C+CMFb0wXme/ovcDeM1+3W/UmSHYUW4b3WYq4 + 9 | +-----END RSA PRIVATE KEY----- token: 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 + |_______________________________apikey______________________________| + + ''' +# --- +# name: test_leak_message[_SIMPLE_SECRET_MULTILINE_PATCH_SCAN_RESULT-clip_long_lines-hide_secrets] + ''' + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: RSA Private Key + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 060bf63de122848f5efa122fe6cea504aae3b24cea393d887fdefa1529c6a02e + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/private_key_rsa + + | @@ -0,0 +1,29 @@ + 1 | +PrivateKeyRsa: + 2 | +- text: -----BEGIN RSA PRIVATE KEY----- + 3 | +MIIBOgIBAAJBAIIRkYjxjE3KIZi******************************+****** + 4 | +**************************************************************** + 5 | +**************************************************************** + 6 | +***********+**************************************************** + 7 | +****************+*********************************************** + 8 | +**********************+***************************************** + 9 | +****+******Xme/ovcDeM1+3W/UmSHYUW4b3WYq4 + 10 | +-----END RSA PRIVATE KEY----- + |_____________________________apikey____________________________| + + ''' +# --- +# name: test_leak_message[_SIMPLE_SECRET_MULTILINE_PATCH_SCAN_RESULT-clip_long_lines-show_secrets] + ''' + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: RSA Private Key + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 060bf63de122848f5efa122fe6cea504aae3b24cea393d887fdefa1529c6a02e + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/private_key_rsa + + | @@ -0,0 +1,29 @@ + 1 | +PrivateKeyRsa: + 2 | +- text: -----BEGIN RSA PRIVATE KEY----- + 3 | +MIIBOgIBAAJBAIIRkYjxjE3KIZiEc8k4sWWGNsPYRNE0u0bl5oFVApPLm+uXQ/4l + 4 | +bKO9LFtMiVPy700oMWLScwAN5OAiqVLMvHUCAwEAAQJANLr8nmEWuV6t2hAwhK5I + 5 | +NNmBkEo4M/xFxEtl9J7LKbE2gtNrlCQiJlPP1EMhwAjDOzQcJ3lgFB28dkqH5rMW + 6 | +TQIhANrCE7O+wlCKe0WJqQ3lYlHG91XWyGVgfExJwBDsAD9LAiEAmDY5OSsH0n2A + 7 | +22tthkAvcN1s66lG+0DztOVJ4QLI2z8CIBPeDGwGpx8pdIicN/5LFuLWbyAcoZaT + 8 | +bLaA/DCNPniBAiA0l//bzg+M3srIhm04xzLdR9Vb9IjPRlkvN074zdKDVwIhAKJb + 9 | +RF3C+CMFb0wXme/ovcDeM1+3W/UmSHYUW4b3WYq4 + 10 | +-----END RSA PRIVATE KEY----- + |_____________________________apikey____________________________| + + ''' +# --- +# name: test_leak_message[_SIMPLE_SECRET_MULTILINE_PATCH_SCAN_RESULT-verbose-hide_secrets] + ''' + + secrets-engine-version: 3.14.159 + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: RSA Private Key + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 060bf63de122848f5efa122fe6cea504aae3b24cea393d887fdefa1529c6a02e + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/private_key_rsa + + | @@ -0,0 +1,29 @@ + 1 | +PrivateKeyRsa: + 2 | +- text: -----BEGIN RSA PRIVATE KEY----- + 3 | +MIIBOgIBAAJBAIIRkYjxjE3KIZi******************************+****** + 4 | +**************************************************************** + 5 | +**************************************************************** + 6 | +***********+**************************************************** + 7 | +****************+*********************************************** + 8 | +**********************+***************************************** + 9 | +****+******Xme/ovcDeM1+3W/UmSHYUW4b3WYq4 + 10 | +-----END RSA PRIVATE KEY----- + |_____________________________apikey____________________________| + + ''' +# --- +# name: test_leak_message[_SIMPLE_SECRET_MULTILINE_PATCH_SCAN_RESULT-verbose-show_secrets] + ''' + + secrets-engine-version: 3.14.159 + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: RSA Private Key + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 060bf63de122848f5efa122fe6cea504aae3b24cea393d887fdefa1529c6a02e + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/private_key_rsa + + | @@ -0,0 +1,29 @@ + 1 | +PrivateKeyRsa: + 2 | +- text: -----BEGIN RSA PRIVATE KEY----- + 3 | +MIIBOgIBAAJBAIIRkYjxjE3KIZiEc8k4sWWGNsPYRNE0u0bl5oFVApPLm+uXQ/4l + 4 | +bKO9LFtMiVPy700oMWLScwAN5OAiqVLMvHUCAwEAAQJANLr8nmEWuV6t2hAwhK5I + 5 | +NNmBkEo4M/xFxEtl9J7LKbE2gtNrlCQiJlPP1EMhwAjDOzQcJ3lgFB28dkqH5rMW + 6 | +TQIhANrCE7O+wlCKe0WJqQ3lYlHG91XWyGVgfExJwBDsAD9LAiEAmDY5OSsH0n2A + 7 | +22tthkAvcN1s66lG+0DztOVJ4QLI2z8CIBPeDGwGpx8pdIicN/5LFuLWbyAcoZaT + 8 | +bLaA/DCNPniBAiA0l//bzg+M3srIhm04xzLdR9Vb9IjPRlkvN074zdKDVwIhAKJb + 9 | +RF3C+CMFb0wXme/ovcDeM1+3W/UmSHYUW4b3WYq4 + 10 | +-----END RSA PRIVATE KEY----- + |_____________________________apikey____________________________| + + ''' +# --- +# name: test_leak_message[_SIMPLE_SECRET_PATCH_SCAN_RESULT-clip_long_lines-hide_secrets] + ''' + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: GitHub Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 2b5840babacb6f089ddcce1fe5a56b803f8b1f636c6f44cdbf14b0c77a194c93 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/github_access_token + + | @@ -0,0 +1 @@ + 1 | +github_token: 368ac3e**************************37ddf91 + |________________apikey________________| + + ''' +# --- +# name: test_leak_message[_SIMPLE_SECRET_PATCH_SCAN_RESULT-clip_long_lines-show_secrets] + ''' + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: GitHub Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 2b5840babacb6f089ddcce1fe5a56b803f8b1f636c6f44cdbf14b0c77a194c93 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/github_access_token + + | @@ -0,0 +1 @@ + 1 | +github_token: 368ac3edf9e850d1c0ff9d6c526496f8237ddf91 + |________________apikey________________| + + ''' +# --- +# name: test_leak_message[_SIMPLE_SECRET_PATCH_SCAN_RESULT-verbose-hide_secrets] + ''' + + secrets-engine-version: 3.14.159 + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: GitHub Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 2b5840babacb6f089ddcce1fe5a56b803f8b1f636c6f44cdbf14b0c77a194c93 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/github_access_token + + | @@ -0,0 +1 @@ + 1 | +github_token: 368ac3e**************************37ddf91 + |________________apikey________________| + + ''' +# --- +# name: test_leak_message[_SIMPLE_SECRET_PATCH_SCAN_RESULT-verbose-show_secrets] + ''' + + secrets-engine-version: 3.14.159 + > This is an example header + > leak.txt: 1 secret detected + + >> Secret detected: GitHub Token + Occurrences: 1 + Known by GitGuardian dashboard: NO + Incident URL: N/A + Secret SHA: 2b5840babacb6f089ddcce1fe5a56b803f8b1f636c6f44cdbf14b0c77a194c93 + Secret found in vault: No + Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/github_access_token + + | @@ -0,0 +1 @@ + 1 | +github_token: 368ac3edf9e850d1c0ff9d6c526496f8237ddf91 + |________________apikey________________| + + ''' +# --- diff --git a/tests/unit/verticals/secret/output/snapshots/__init__.py b/tests/unit/verticals/secret/output/snapshots/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/verticals/secret/output/snapshots/snap_test_text_output.py b/tests/unit/verticals/secret/output/snapshots/snap_test_text_output.py deleted file mode 100644 index 419d029ee3..0000000000 --- a/tests/unit/verticals/secret/output/snapshots/snap_test_text_output.py +++ /dev/null @@ -1,624 +0,0 @@ -# -*- coding: utf-8 -*- -# snapshottest: v1 - https://goo.gl/zC4yUc -from __future__ import unicode_literals - -from snapshottest import Snapshot - - -snapshots = Snapshot() - -snapshots['test_leak_message[_MULTI_SECRET_ONE_LINE_PATCH_OVERLAY_SCAN_RESULT-clip_long_lines-hide_secrets] 1'] = '''> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: Facebook Access Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token - - | @@ -0,0 +1 @@ - 1 | +Facebook = 294*********575 | ce3f9f********************5e4372; - |__client_id__| - 1 | +Facebook = 294*********575 | ce3f9f********************5e4372; - |_________client_secret________| -''' - -snapshots['test_leak_message[_MULTI_SECRET_ONE_LINE_PATCH_OVERLAY_SCAN_RESULT-clip_long_lines-show_secrets] 1'] = '''> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: Facebook Access Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token - - | @@ -0,0 +1 @@ - 1 | +Facebook = 294790898041575 | ce3f9f0362bbe5ab01dfc8ee565e4372; - |__client_id__| - 1 | +Facebook = 294790898041575 | ce3f9f0362bbe5ab01dfc8ee565e4372; - |_________client_secret________| -''' - -snapshots['test_leak_message[_MULTI_SECRET_ONE_LINE_PATCH_OVERLAY_SCAN_RESULT-verbose-hide_secrets] 1'] = ''' -secrets-engine-version: 3.14.159 -> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: Facebook Access Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token - - | @@ -0,0 +1 @@ - 1 | +Facebook = 294*********575 | ce3f9f********************5e4372; - |__client_id__| - 1 | +Facebook = 294*********575 | ce3f9f********************5e4372; - |_________client_secret________| -''' - -snapshots['test_leak_message[_MULTI_SECRET_ONE_LINE_PATCH_OVERLAY_SCAN_RESULT-verbose-show_secrets] 1'] = ''' -secrets-engine-version: 3.14.159 -> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: Facebook Access Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token - - | @@ -0,0 +1 @@ - 1 | +Facebook = 294790898041575 | ce3f9f0362bbe5ab01dfc8ee565e4372; - |__client_id__| - 1 | +Facebook = 294790898041575 | ce3f9f0362bbe5ab01dfc8ee565e4372; - |_________client_secret________| -''' - -snapshots['test_leak_message[_MULTI_SECRET_ONE_LINE_PATCH_SCAN_RESULT-clip_long_lines-hide_secrets] 1'] = '''> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: Facebook Access Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token - - | @@ -0,0 +1 @@ - 1 | +FacebookAppId = 294*********575; FacebookAppSecret = ce3f9f*************… - |__client_id__| - 1 | +…= 294*********575; FacebookAppSecret = ce3f9f********************5e4372; - |_________client_secret________| -''' - -snapshots['test_leak_message[_MULTI_SECRET_ONE_LINE_PATCH_SCAN_RESULT-clip_long_lines-show_secrets] 1'] = '''> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: Facebook Access Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token - - | @@ -0,0 +1 @@ - 1 | +FacebookAppId = 294790898041575; FacebookAppSecret = ce3f9f0362bbe5ab01d… - |__client_id__| - 1 | +…= 294790898041575; FacebookAppSecret = ce3f9f0362bbe5ab01dfc8ee565e4372; - |_________client_secret________| -''' - -snapshots['test_leak_message[_MULTI_SECRET_ONE_LINE_PATCH_SCAN_RESULT-verbose-hide_secrets] 1'] = ''' -secrets-engine-version: 3.14.159 -> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: Facebook Access Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token - - | @@ -0,0 +1 @@ - 1 | +FacebookAppId = 294*********575; FacebookAppSecret = ce3f9f********************5e4372; - |__client_id__| - 1 | +FacebookAppId = 294*********575; FacebookAppSecret = ce3f9f********************5e4372; - |_________client_secret________| -''' - -snapshots['test_leak_message[_MULTI_SECRET_ONE_LINE_PATCH_SCAN_RESULT-verbose-show_secrets] 1'] = ''' -secrets-engine-version: 3.14.159 -> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: Facebook Access Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token - - | @@ -0,0 +1 @@ - 1 | +FacebookAppId = 294790898041575; FacebookAppSecret = ce3f9f0362bbe5ab01dfc8ee565e4372; - |__client_id__| - 1 | +FacebookAppId = 294790898041575; FacebookAppSecret = ce3f9f0362bbe5ab01dfc8ee565e4372; - |_________client_secret________| -''' - -snapshots['test_leak_message[_MULTI_SECRET_TWO_LINES_PATCH_SCAN_RESULT-clip_long_lines-hide_secrets] 1'] = '''> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: Facebook Access Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token - - | @@ -0,0 +2 @@ - 1 | +FacebookAppId = 294*********575; - |__client_id__| - 2 | +FacebookAppSecret = ce3f9f********************5e4372; - |_________client_secret________| -''' - -snapshots['test_leak_message[_MULTI_SECRET_TWO_LINES_PATCH_SCAN_RESULT-clip_long_lines-show_secrets] 1'] = '''> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: Facebook Access Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token - - | @@ -0,0 +2 @@ - 1 | +FacebookAppId = 294790898041575; - |__client_id__| - 2 | +FacebookAppSecret = ce3f9f0362bbe5ab01dfc8ee565e4372; - |_________client_secret________| -''' - -snapshots['test_leak_message[_MULTI_SECRET_TWO_LINES_PATCH_SCAN_RESULT-verbose-hide_secrets] 1'] = ''' -secrets-engine-version: 3.14.159 -> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: Facebook Access Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token - - | @@ -0,0 +2 @@ - 1 | +FacebookAppId = 294*********575; - |__client_id__| - 2 | +FacebookAppSecret = ce3f9f********************5e4372; - |_________client_secret________| -''' - -snapshots['test_leak_message[_MULTI_SECRET_TWO_LINES_PATCH_SCAN_RESULT-verbose-show_secrets] 1'] = ''' -secrets-engine-version: 3.14.159 -> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: Facebook Access Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 38d9d3464520ed68f18d16e640a4a8b37ef5b17608b455267d100aa487ead314 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token - - | @@ -0,0 +2 @@ - 1 | +FacebookAppId = 294790898041575; - |__client_id__| - 2 | +FacebookAppSecret = ce3f9f0362bbe5ab01dfc8ee565e4372; - |_________client_secret________| -''' - -snapshots['test_leak_message[_ONE_LINE_AND_MULTILINE_PATCH_CONTENT-clip_long_lines-hide_secrets] 1'] = '''> This is an example header -> leak.txt: 3 secrets detected - ->> Secret detected: Facebook Access Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 1945f4a0c42abb19c1a420ddd09b4b4681249a3057c427b95f794b18595e7ffa - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token - - | @@ -0,0 +1,29 @@ - 1 | +FacebookAppKeys: 294*********573 / ce3f9f********************5e4371 ----… - |__client_id__| - 1 | +… 294*********573 / ce3f9f********************5e4371 -----BEGIN RSA PRIV… - |_________client_secret________| - 2 | +MIIBOgIBAAJBAIIRkYjxjE3KIZi******************************+****** - 3 | +**************************************************************** - ->> Secret detected: RSA Private Key - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 060bf63de122848f5efa122fe6cea504aae3b24cea393d887fdefa1529c6a02e - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/private_key_rsa - - | @@ -0,0 +1,29 @@ - 1 | +…**573 / ce3f9f********************5e4371 -----BEGIN RSA PRIVATE KEY----- - 2 | +MIIBOgIBAAJBAIIRkYjxjE3KIZi******************************+****** - 3 | +**************************************************************** - 4 | +**************************************************************** - 5 | +***********+**************************************************** - 6 | +****************+*********************************************** - 7 | +**********************+***************************************** - 8 | +****+******Xme/ovcDeM1+3W/UmSHYUW4b3WYq4 - 9 | +-----END RSA PRIVATE KEY----- token: SG._Yytrtvlj***********************… - |_________________________________apikey_________________________________| - ->> Secret detected: SendGrid Key - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 530e5a4a7ea00814db8845dd0cae5efaa4b974a3ce1c76d0384ba715248a5dc1 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/sendgrid_key - - 7 | +**********************+***************************************** - 8 | +****+******Xme/ovcDeM1+3W/UmSHYUW4b3WYq4 - 9 | +…-- token: SG._Yytrtvlj******************************************-**rRJLGFLBLf0M - |_______________________________apikey______________________________| -''' - -snapshots['test_leak_message[_ONE_LINE_AND_MULTILINE_PATCH_CONTENT-clip_long_lines-show_secrets] 1'] = '''> This is an example header -> leak.txt: 3 secrets detected - ->> Secret detected: Facebook Access Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 1945f4a0c42abb19c1a420ddd09b4b4681249a3057c427b95f794b18595e7ffa - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token - - | @@ -0,0 +1,29 @@ - 1 | +FacebookAppKeys: 294790898041573 / ce3f9f0362bbe5ab01dfc8ee565e4371 ----… - |__client_id__| - 1 | +… 294790898041573 / ce3f9f0362bbe5ab01dfc8ee565e4371 -----BEGIN RSA PRIV… - |_________client_secret________| - 2 | +MIIBOgIBAAJBAIIRkYjxjE3KIZiEc8k4sWWGNsPYRNE0u0bl5oFVApPLm+uXQ/4l - 3 | +bKO9LFtMiVPy700oMWLScwAN5OAiqVLMvHUCAwEAAQJANLr8nmEWuV6t2hAwhK5I - ->> Secret detected: RSA Private Key - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 060bf63de122848f5efa122fe6cea504aae3b24cea393d887fdefa1529c6a02e - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/private_key_rsa - - | @@ -0,0 +1,29 @@ - 1 | +…41573 / ce3f9f0362bbe5ab01dfc8ee565e4371 -----BEGIN RSA PRIVATE KEY----- - 2 | +MIIBOgIBAAJBAIIRkYjxjE3KIZiEc8k4sWWGNsPYRNE0u0bl5oFVApPLm+uXQ/4l - 3 | +bKO9LFtMiVPy700oMWLScwAN5OAiqVLMvHUCAwEAAQJANLr8nmEWuV6t2hAwhK5I - 4 | +NNmBkEo4M/xFxEtl9J7LKbE2gtNrlCQiJlPP1EMhwAjDOzQcJ3lgFB28dkqH5rMW - 5 | +TQIhANrCE7O+wlCKe0WJqQ3lYlHG91XWyGVgfExJwBDsAD9LAiEAmDY5OSsH0n2A - 6 | +22tthkAvcN1s66lG+0DztOVJ4QLI2z8CIBPeDGwGpx8pdIicN/5LFuLWbyAcoZaT - 7 | +bLaA/DCNPniBAiA0l//bzg+M3srIhm04xzLdR9Vb9IjPRlkvN074zdKDVwIhAKJb - 8 | +RF3C+CMFb0wXme/ovcDeM1+3W/UmSHYUW4b3WYq4 - 9 | +-----END RSA PRIVATE KEY----- token: SG._YytrtvljkWqCrkMa3r5hw.yijiPf2qx… - |_________________________________apikey_________________________________| - ->> Secret detected: SendGrid Key - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 530e5a4a7ea00814db8845dd0cae5efaa4b974a3ce1c76d0384ba715248a5dc1 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/sendgrid_key - - 7 | +bLaA/DCNPniBAiA0l//bzg+M3srIhm04xzLdR9Vb9IjPRlkvN074zdKDVwIhAKJb - 8 | +RF3C+CMFb0wXme/ovcDeM1+3W/UmSHYUW4b3WYq4 - 9 | +…-- token: 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 - |_______________________________apikey______________________________| -''' - -snapshots['test_leak_message[_ONE_LINE_AND_MULTILINE_PATCH_CONTENT-verbose-hide_secrets] 1'] = ''' -secrets-engine-version: 3.14.159 -> This is an example header -> leak.txt: 3 secrets detected - ->> Secret detected: Facebook Access Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 1945f4a0c42abb19c1a420ddd09b4b4681249a3057c427b95f794b18595e7ffa - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token - - | @@ -0,0 +1,29 @@ - 1 | +FacebookAppKeys: 294*********573 / ce3f9f********************5e4371 -----BEGIN RSA PRIVATE KEY----- - |__client_id__| - 1 | +FacebookAppKeys: 294*********573 / ce3f9f********************5e4371 -----BEGIN RSA PRIVATE KEY----- - |_________client_secret________| - 2 | +MIIBOgIBAAJBAIIRkYjxjE3KIZi******************************+****** - 3 | +**************************************************************** - ->> Secret detected: RSA Private Key - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 060bf63de122848f5efa122fe6cea504aae3b24cea393d887fdefa1529c6a02e - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/private_key_rsa - - | @@ -0,0 +1,29 @@ - 1 | +FacebookAppKeys: 294*********573 / ce3f9f********************5e4371 -----BEGIN RSA PRIVATE KEY----- - 2 | +MIIBOgIBAAJBAIIRkYjxjE3KIZi******************************+****** - 3 | +**************************************************************** - 4 | +**************************************************************** - 5 | +***********+**************************************************** - 6 | +****************+*********************************************** - 7 | +**********************+***************************************** - 8 | +****+******Xme/ovcDeM1+3W/UmSHYUW4b3WYq4 - 9 | +-----END RSA PRIVATE KEY----- token: SG._Yytrtvlj******************************************-**rRJLGFLBLf0M - - ->> Secret detected: SendGrid Key - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 530e5a4a7ea00814db8845dd0cae5efaa4b974a3ce1c76d0384ba715248a5dc1 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/sendgrid_key - - 7 | +**********************+***************************************** - 8 | +****+******Xme/ovcDeM1+3W/UmSHYUW4b3WYq4 - 9 | +-----END RSA PRIVATE KEY----- token: SG._Yytrtvlj******************************************-**rRJLGFLBLf0M - |_______________________________apikey______________________________| -''' - -snapshots['test_leak_message[_ONE_LINE_AND_MULTILINE_PATCH_CONTENT-verbose-show_secrets] 1'] = ''' -secrets-engine-version: 3.14.159 -> This is an example header -> leak.txt: 3 secrets detected - ->> Secret detected: Facebook Access Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 1945f4a0c42abb19c1a420ddd09b4b4681249a3057c427b95f794b18595e7ffa - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/facebook_access_token - - | @@ -0,0 +1,29 @@ - 1 | +FacebookAppKeys: 294790898041573 / ce3f9f0362bbe5ab01dfc8ee565e4371 -----BEGIN RSA PRIVATE KEY----- - |__client_id__| - 1 | +FacebookAppKeys: 294790898041573 / ce3f9f0362bbe5ab01dfc8ee565e4371 -----BEGIN RSA PRIVATE KEY----- - |_________client_secret________| - 2 | +MIIBOgIBAAJBAIIRkYjxjE3KIZiEc8k4sWWGNsPYRNE0u0bl5oFVApPLm+uXQ/4l - 3 | +bKO9LFtMiVPy700oMWLScwAN5OAiqVLMvHUCAwEAAQJANLr8nmEWuV6t2hAwhK5I - ->> Secret detected: RSA Private Key - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 060bf63de122848f5efa122fe6cea504aae3b24cea393d887fdefa1529c6a02e - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/private_key_rsa - - | @@ -0,0 +1,29 @@ - 1 | +FacebookAppKeys: 294790898041573 / ce3f9f0362bbe5ab01dfc8ee565e4371 -----BEGIN RSA PRIVATE KEY----- - 2 | +MIIBOgIBAAJBAIIRkYjxjE3KIZiEc8k4sWWGNsPYRNE0u0bl5oFVApPLm+uXQ/4l - 3 | +bKO9LFtMiVPy700oMWLScwAN5OAiqVLMvHUCAwEAAQJANLr8nmEWuV6t2hAwhK5I - 4 | +NNmBkEo4M/xFxEtl9J7LKbE2gtNrlCQiJlPP1EMhwAjDOzQcJ3lgFB28dkqH5rMW - 5 | +TQIhANrCE7O+wlCKe0WJqQ3lYlHG91XWyGVgfExJwBDsAD9LAiEAmDY5OSsH0n2A - 6 | +22tthkAvcN1s66lG+0DztOVJ4QLI2z8CIBPeDGwGpx8pdIicN/5LFuLWbyAcoZaT - 7 | +bLaA/DCNPniBAiA0l//bzg+M3srIhm04xzLdR9Vb9IjPRlkvN074zdKDVwIhAKJb - 8 | +RF3C+CMFb0wXme/ovcDeM1+3W/UmSHYUW4b3WYq4 - 9 | +-----END RSA PRIVATE KEY----- token: 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 - - ->> Secret detected: SendGrid Key - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 530e5a4a7ea00814db8845dd0cae5efaa4b974a3ce1c76d0384ba715248a5dc1 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/sendgrid_key - - 7 | +bLaA/DCNPniBAiA0l//bzg+M3srIhm04xzLdR9Vb9IjPRlkvN074zdKDVwIhAKJb - 8 | +RF3C+CMFb0wXme/ovcDeM1+3W/UmSHYUW4b3WYq4 - 9 | +-----END RSA PRIVATE KEY----- token: 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 - |_______________________________apikey______________________________| -''' - -snapshots['test_leak_message[_SIMPLE_SECRET_MULTILINE_PATCH_SCAN_RESULT-clip_long_lines-hide_secrets] 1'] = '''> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: RSA Private Key - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 060bf63de122848f5efa122fe6cea504aae3b24cea393d887fdefa1529c6a02e - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/private_key_rsa - - | @@ -0,0 +1,29 @@ - 1 | +PrivateKeyRsa: - 2 | +- text: -----BEGIN RSA PRIVATE KEY----- - 3 | +MIIBOgIBAAJBAIIRkYjxjE3KIZi******************************+****** - 4 | +**************************************************************** - 5 | +**************************************************************** - 6 | +***********+**************************************************** - 7 | +****************+*********************************************** - 8 | +**********************+***************************************** - 9 | +****+******Xme/ovcDeM1+3W/UmSHYUW4b3WYq4 - 10 | +-----END RSA PRIVATE KEY----- - |_____________________________apikey____________________________| -''' - -snapshots['test_leak_message[_SIMPLE_SECRET_MULTILINE_PATCH_SCAN_RESULT-clip_long_lines-show_secrets] 1'] = '''> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: RSA Private Key - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 060bf63de122848f5efa122fe6cea504aae3b24cea393d887fdefa1529c6a02e - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/private_key_rsa - - | @@ -0,0 +1,29 @@ - 1 | +PrivateKeyRsa: - 2 | +- text: -----BEGIN RSA PRIVATE KEY----- - 3 | +MIIBOgIBAAJBAIIRkYjxjE3KIZiEc8k4sWWGNsPYRNE0u0bl5oFVApPLm+uXQ/4l - 4 | +bKO9LFtMiVPy700oMWLScwAN5OAiqVLMvHUCAwEAAQJANLr8nmEWuV6t2hAwhK5I - 5 | +NNmBkEo4M/xFxEtl9J7LKbE2gtNrlCQiJlPP1EMhwAjDOzQcJ3lgFB28dkqH5rMW - 6 | +TQIhANrCE7O+wlCKe0WJqQ3lYlHG91XWyGVgfExJwBDsAD9LAiEAmDY5OSsH0n2A - 7 | +22tthkAvcN1s66lG+0DztOVJ4QLI2z8CIBPeDGwGpx8pdIicN/5LFuLWbyAcoZaT - 8 | +bLaA/DCNPniBAiA0l//bzg+M3srIhm04xzLdR9Vb9IjPRlkvN074zdKDVwIhAKJb - 9 | +RF3C+CMFb0wXme/ovcDeM1+3W/UmSHYUW4b3WYq4 - 10 | +-----END RSA PRIVATE KEY----- - |_____________________________apikey____________________________| -''' - -snapshots['test_leak_message[_SIMPLE_SECRET_MULTILINE_PATCH_SCAN_RESULT-verbose-hide_secrets] 1'] = ''' -secrets-engine-version: 3.14.159 -> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: RSA Private Key - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 060bf63de122848f5efa122fe6cea504aae3b24cea393d887fdefa1529c6a02e - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/private_key_rsa - - | @@ -0,0 +1,29 @@ - 1 | +PrivateKeyRsa: - 2 | +- text: -----BEGIN RSA PRIVATE KEY----- - 3 | +MIIBOgIBAAJBAIIRkYjxjE3KIZi******************************+****** - 4 | +**************************************************************** - 5 | +**************************************************************** - 6 | +***********+**************************************************** - 7 | +****************+*********************************************** - 8 | +**********************+***************************************** - 9 | +****+******Xme/ovcDeM1+3W/UmSHYUW4b3WYq4 - 10 | +-----END RSA PRIVATE KEY----- - |_____________________________apikey____________________________| -''' - -snapshots['test_leak_message[_SIMPLE_SECRET_MULTILINE_PATCH_SCAN_RESULT-verbose-show_secrets] 1'] = ''' -secrets-engine-version: 3.14.159 -> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: RSA Private Key - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 060bf63de122848f5efa122fe6cea504aae3b24cea393d887fdefa1529c6a02e - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/private_key_rsa - - | @@ -0,0 +1,29 @@ - 1 | +PrivateKeyRsa: - 2 | +- text: -----BEGIN RSA PRIVATE KEY----- - 3 | +MIIBOgIBAAJBAIIRkYjxjE3KIZiEc8k4sWWGNsPYRNE0u0bl5oFVApPLm+uXQ/4l - 4 | +bKO9LFtMiVPy700oMWLScwAN5OAiqVLMvHUCAwEAAQJANLr8nmEWuV6t2hAwhK5I - 5 | +NNmBkEo4M/xFxEtl9J7LKbE2gtNrlCQiJlPP1EMhwAjDOzQcJ3lgFB28dkqH5rMW - 6 | +TQIhANrCE7O+wlCKe0WJqQ3lYlHG91XWyGVgfExJwBDsAD9LAiEAmDY5OSsH0n2A - 7 | +22tthkAvcN1s66lG+0DztOVJ4QLI2z8CIBPeDGwGpx8pdIicN/5LFuLWbyAcoZaT - 8 | +bLaA/DCNPniBAiA0l//bzg+M3srIhm04xzLdR9Vb9IjPRlkvN074zdKDVwIhAKJb - 9 | +RF3C+CMFb0wXme/ovcDeM1+3W/UmSHYUW4b3WYq4 - 10 | +-----END RSA PRIVATE KEY----- - |_____________________________apikey____________________________| -''' - -snapshots['test_leak_message[_SIMPLE_SECRET_PATCH_SCAN_RESULT-clip_long_lines-hide_secrets] 1'] = '''> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: GitHub Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 2b5840babacb6f089ddcce1fe5a56b803f8b1f636c6f44cdbf14b0c77a194c93 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/github_access_token - - | @@ -0,0 +1 @@ - 1 | +github_token: 368ac3e**************************37ddf91 - |________________apikey________________| -''' - -snapshots['test_leak_message[_SIMPLE_SECRET_PATCH_SCAN_RESULT-clip_long_lines-show_secrets] 1'] = '''> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: GitHub Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 2b5840babacb6f089ddcce1fe5a56b803f8b1f636c6f44cdbf14b0c77a194c93 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/github_access_token - - | @@ -0,0 +1 @@ - 1 | +github_token: 368ac3edf9e850d1c0ff9d6c526496f8237ddf91 - |________________apikey________________| -''' - -snapshots['test_leak_message[_SIMPLE_SECRET_PATCH_SCAN_RESULT-verbose-hide_secrets] 1'] = ''' -secrets-engine-version: 3.14.159 -> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: GitHub Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 2b5840babacb6f089ddcce1fe5a56b803f8b1f636c6f44cdbf14b0c77a194c93 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/github_access_token - - | @@ -0,0 +1 @@ - 1 | +github_token: 368ac3e**************************37ddf91 - |________________apikey________________| -''' - -snapshots['test_leak_message[_SIMPLE_SECRET_PATCH_SCAN_RESULT-verbose-show_secrets] 1'] = ''' -secrets-engine-version: 3.14.159 -> This is an example header -> leak.txt: 1 secret detected - ->> Secret detected: GitHub Token - Occurrences: 1 - Known by GitGuardian dashboard: NO - Incident URL: N/A - Secret SHA: 2b5840babacb6f089ddcce1fe5a56b803f8b1f636c6f44cdbf14b0c77a194c93 - Secret found in vault: No - Detector documentation: https://docs.gitguardian.com/secrets-detection/secrets-detection-engine/detectors/specifics/github_access_token - - | @@ -0,0 +1 @@ - 1 | +github_token: 368ac3edf9e850d1c0ff9d6c526496f8237ddf91 - |________________apikey________________| -''' diff --git a/tests/unit/verticals/secret/output/test_text_output.py b/tests/unit/verticals/secret/output/test_text_output.py index a971462e06..f493658b43 100644 --- a/tests/unit/verticals/secret/output/test_text_output.py +++ b/tests/unit/verticals/secret/output/test_text_output.py @@ -148,7 +148,7 @@ def test_leak_message(result_input, snapshot, show_secrets, verbose): # to compare the output with snapshots. output = click.unstyle(output) - snapshot.assert_match(output) + assert output == snapshot # all ignore sha should be in the output assert all( diff --git a/tests/unit/verticals/secret/snapshots/__init__.py b/tests/unit/verticals/secret/snapshots/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/unit/verticals/secret/snapshots/snap_test_secret_scanner.py b/tests/unit/verticals/secret/snapshots/snap_test_secret_scanner.py deleted file mode 100644 index 8d3ea13625..0000000000 --- a/tests/unit/verticals/secret/snapshots/snap_test_secret_scanner.py +++ /dev/null @@ -1,42 +0,0 @@ -# -*- coding: utf-8 -*- -# snapshottest: v1 - https://goo.gl/zC4yUc -from __future__ import unicode_literals - -from snapshottest import Snapshot - - -snapshots = Snapshot() - -snapshots['test_handle_scan_error[single file exception] 1'] = '''Error: Scanning failed. Results may be incomplete. -Error: Add the following files to your ignored_paths: -Error: - /home/user/too/long/file/name: filename:: [ErrorDetail(string='Ensure this field has no more than 256 characters.', code='max_length')] -''' - -snapshots['test_handle_scan_error[source not found] 1'] = '''Error: The provided source was not found in GitGuardian. -''' - -snapshots['test_handle_scan_error[too many documents] 1'] = '''Error: Scanning failed. Results may be incomplete. -Error: The following chunk is affected: -- /example -- /example -- /example -- /example -- /example -- /example -- /example -- /example -- /example -- /example -- /example -- /example -- /example -- /example -- /example -- /example -- /example -- /example -- /example -- /example -- /example -Error: 400:Too many documents to scan -''' diff --git a/tests/unit/verticals/secret/test_secret_scanner.py b/tests/unit/verticals/secret/test_secret_scanner.py index b6efd352e7..077975987b 100644 --- a/tests/unit/verticals/secret/test_secret_scanner.py +++ b/tests/unit/verticals/secret/test_secret_scanner.py @@ -212,7 +212,7 @@ def test_handle_scan_error(detail, status_code, chunk, capsys, snapshot): detail.status_code = 400 handle_scan_chunk_error(detail, chunk) captured = capsys.readouterr() - snapshot.assert_match(captured.err) + assert captured.err == snapshot def test_handle_scan_quota_limit_reached(): From 13cf4bf00cfac400a53b4f3ef75cd9a2fb7f7648 Mon Sep 17 00:00:00 2001 From: Henri Hubert Date: Mon, 25 Aug 2025 15:08:13 +0200 Subject: [PATCH 2/2] chore: remove unused fixture in tests --- tests/unit/core/test_filter.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/unit/core/test_filter.py b/tests/unit/core/test_filter.py index 6e0230e6c0..51a01929fd 100644 --- a/tests/unit/core/test_filter.py +++ b/tests/unit/core/test_filter.py @@ -68,7 +68,6 @@ def test_get_ignore_sha( policy_breaks: List[PolicyBreak], duplicates: bool, expected_shas: Set[str], - snapshot, ) -> None: copy_policy_breaks = copy.deepcopy(policy_breaks) if duplicates: