Skip to content

Commit db52127

Browse files
committed
chore(tests): Update cassettes and tests
1 parent 5e61f66 commit db52127

File tree

76 files changed

+4057
-2701
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+4057
-2701
lines changed

tests/unit/cassettes/multiline_secret.yaml

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,45 @@ interactions:
99
Connection:
1010
- keep-alive
1111
User-Agent:
12-
- pygitguardian/1.15.2 (Linux;py3.10.12)
12+
- pygitguardian/1.17.0 (Darwin;py3.10.14)
1313
method: GET
1414
uri: https://api.gitguardian.com/v1/metadata
1515
response:
1616
body:
1717
string:
18-
'{"version":"v2.87.2","preferences":{"marketplaces__aws_product_url":"http://aws.amazon.com/marketplace/pp/prodview-mrmulzykamba6","on_premise__restrict_signup":true,"on_premise__is_email_server_configured":true,"on_premise__default_sso_config_api_id":null,"onboarding__segmentation_v1_enabled":true,"general__maximum_payload_size":26214400,"general__mutual_tls_mode":"disabled","general__signup_enabled":true},"secret_scan_preferences":{"maximum_documents_per_scan":20,"maximum_document_size":1048576},"remediation_messages":{"pre_commit":">
18+
'{"version":"v2.119.0","preferences":{"marketplaces__aws_product_url":"http://aws.amazon.com/marketplace/pp/prodview-mrmulzykamba6","on_premise__restrict_signup":true,"on_premise__is_email_server_configured":true,"on_premise__default_sso_config_api_id":null,"on_premise__default_sso_config_force_sso":null,"onboarding__segmentation_v1_enabled":true,"general__maximum_payload_size":26214400,"general__mutual_tls_mode":"disabled","general__signup_enabled":true},"secret_scan_preferences":{"maximum_documents_per_scan":20,"maximum_document_size":1048576},"remediation_messages":{"pre_commit":">
1919
How to remediate\n\n Since the secret was detected before the commit was
2020
made:\n 1. replace the secret with its reference (e.g. environment variable).\n 2.
21-
commit again.\n\n> [To apply with caution] If you want to bypass ggshield
22-
(false positive or other reason), run:\n - if you use the pre-commit framework:\n\n SKIP=ggshield
23-
git commit -m \"<your message>","pre_push":"> How to remediate\n\n Since
21+
commit again.\n\n> [Apply with caution] If you want to bypass ggshield (false
22+
positive or other reason), run:\n - if you use the pre-commit framework:\n\n SKIP=ggshield
23+
git commit -m \"<your message>\"\n ","pre_push":"> How to remediate\n\n Since
2424
the secret was detected before the push BUT after the commit, you need to:\n 1.
2525
rewrite the git history making sure to replace the secret with its reference
2626
(e.g. environment variable).\n 2. push again.\n\n To prevent having to rewrite
2727
git history in the future, setup ggshield as a pre-commit hook:\n https://docs.gitguardian.com/ggshield-docs/integrations/git-hooks/pre-commit\n\n>
28-
[To apply with caution] If you want to bypass ggshield (false positive or
29-
other reason), run:\n - if you use the pre-commit framework:\n\n SKIP=ggshield-push
28+
[Apply with caution] If you want to bypass ggshield (false positive or other
29+
reason), run:\n - if you use the pre-commit framework:\n\n SKIP=ggshield-push
3030
git push","pre_receive":"> How to remediate\n\n A pre-receive hook set server
3131
side prevented you from pushing secrets.\n\n Since the secret was detected
3232
during the push BUT after the commit, you need to:\n 1. rewrite the git history
3333
making sure to replace the secret with its reference (e.g. environment variable).\n 2.
3434
push again.\n\n To prevent having to rewrite git history in the future, setup
3535
ggshield as a pre-commit hook:\n https://docs.gitguardian.com/ggshield-docs/integrations/git-hooks/pre-commit\n\n>
36-
[To apply with caution] If you want to bypass ggshield (false positive or
37-
other reason), run:\n\n git push -o breakglass"}}'
36+
[Apply with caution] If you want to bypass ggshield (false positive or other
37+
reason), run:\n\n git push -o breakglass"}}'
3838
headers:
3939
access-control-expose-headers:
4040
- X-App-Version
4141
allow:
4242
- GET, HEAD, OPTIONS
4343
content-length:
44-
- '2150'
44+
- '2198'
4545
content-type:
4646
- application/json
4747
cross-origin-opener-policy:
4848
- same-origin
4949
date:
50-
- Mon, 12 Aug 2024 09:19:09 GMT
50+
- Wed, 20 Nov 2024 13:59:37 GMT
5151
referrer-policy:
5252
- strict-origin-when-cross-origin
5353
server:
@@ -59,29 +59,30 @@ interactions:
5959
vary:
6060
- Accept-Encoding,Cookie
6161
x-app-version:
62-
- v2.87.2
62+
- v2.119.0
6363
x-content-type-options:
6464
- nosniff
6565
- nosniff
6666
x-envoy-upstream-service-time:
67-
- '25'
67+
- '33'
6868
x-frame-options:
6969
- DENY
7070
- SAMEORIGIN
7171
x-sca-engine-version:
72-
- 1.43.0
72+
- 2.2.0
7373
x-sca-last-vuln-fetch:
74-
- '2024-08-12T09:06:35.075326+00:00'
74+
- '2024-11-20T13:07:19.777354+00:00'
7575
x-secrets-engine-version:
76-
- 2.117.0
76+
- 2.126.0
7777
x-xss-protection:
7878
- 1; mode=block
7979
status:
8080
code: 200
8181
message: OK
8282
- request:
8383
body:
84-
'[{"filename": "file", "document": "-----BEGIN RSA PRIVATE KEY-----\nMIIBOgIBAAJBAIIRkYjxjE3KIZiEc8k4sWWGNsPYRNE0u0bl5oFVApPLm+uXQ/4l\nbKO9LFtMiVPy700oMWLScwAN5OAiqVLMvHUCAwEAAQJANLr8nmEWuV6t2hAwhK5I\nNNmBkEo4M/xFxEtl9J7LKbE2gtNrlCQiJlPP1EMhwAjDOzQcJ3lgFB28dkqH5rMW\nTQIhANrCE7O+wlCKe0WJqQ3lYlHG91XWyGVgfExJwBDsAD9LAiEAmDY5OSsH0n2A\n22tthkAvcN1s66lG+0DztOVJ4QLI2z8CIBPeDGwGpx8pdIicN/5LFuLWbyAcoZaT\nbLaA/DCNPniBAiA0l//bzg+M3srIhm04xzLdR9Vb9IjPRlkvN074zdKDVwIhAKJb\nRF3C+CMFb0wXme/ovcDeM1+3W/UmSHYUW4b3WYq4\n-----END
84+
'[{"filename": "/private/var/folders/h0/kvcgt4257v5b1jtmy10v_h300000gn/T/pytest-of-sguillaume/pytest-11/test_json_output_for_patch__MU1/file",
85+
"document": "-----BEGIN RSA PRIVATE KEY-----\nMIIBOgIBAAJBAIIRkYjxjE3KIZiEc8k4sWWGNsPYRNE0u0bl5oFVApPLm+uXQ/4l\nbKO9LFtMiVPy700oMWLScwAN5OAiqVLMvHUCAwEAAQJANLr8nmEWuV6t2hAwhK5I\nNNmBkEo4M/xFxEtl9J7LKbE2gtNrlCQiJlPP1EMhwAjDOzQcJ3lgFB28dkqH5rMW\nTQIhANrCE7O+wlCKe0WJqQ3lYlHG91XWyGVgfExJwBDsAD9LAiEAmDY5OSsH0n2A\n22tthkAvcN1s66lG+0DztOVJ4QLI2z8CIBPeDGwGpx8pdIicN/5LFuLWbyAcoZaT\nbLaA/DCNPniBAiA0l//bzg+M3srIhm04xzLdR9Vb9IjPRlkvN074zdKDVwIhAKJb\nRF3C+CMFb0wXme/ovcDeM1+3W/UmSHYUW4b3WYq4\n-----END
8586
RSA PRIVATE KEY-----"}]'
8687
headers:
8788
Accept:
@@ -91,47 +92,47 @@ interactions:
9192
Connection:
9293
- keep-alive
9394
Content-Length:
94-
- '538'
95+
- '658'
9596
Content-Type:
9697
- application/json
9798
GGShield-Command-Id:
98-
- 7a6ae986-4f2d-45ff-9a71-91fdd049ef51
99+
- e145d216-937d-4e29-9b8b-4bd857a6724a
99100
GGShield-Command-Path:
100101
- external
101102
GGShield-OS-Name:
102-
- ubuntu
103+
- darwin
103104
GGShield-OS-Version:
104-
- '22.04'
105+
- 'Darwin Kernel Version 24.0.0: Tue Sep 24 23:37:13 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T8112'
105106
GGShield-Python-Version:
106-
- 3.10.12
107+
- 3.10.14
107108
GGShield-Version:
108-
- 1.29.0
109+
- 1.33.0
109110
User-Agent:
110-
- pygitguardian/1.15.2 (Linux;py3.10.12)
111+
- pygitguardian/1.17.0 (Darwin;py3.10.14)
111112
mode:
112113
- path
113114
method: POST
114115
uri: https://api.gitguardian.com/v1/multiscan?ignore_known_secrets=True
115116
response:
116117
body:
117118
string:
118-
'[{"policy_break_count":1,"policies":["File extensions","Filenames","Secrets
119-
detection"],"policy_breaks":[{"type":"RSA Private Key","policy":"Secrets detection","matches":[{"type":"apikey","match":"-----BEGIN
119+
'[{"policy_break_count":1,"policies":["Secrets detection"],"policy_breaks":[{"type":"RSA
120+
Private Key","policy":"Secrets detection","matches":[{"type":"apikey","match":"-----BEGIN
120121
RSA PRIVATE KEY-----\nMIIBOgIBAAJBAIIRkYjxjE3KIZiEc8k4sWWGNsPYRNE0u0bl5oFVApPLm+uXQ/4l\nbKO9LFtMiVPy700oMWLScwAN5OAiqVLMvHUCAwEAAQJANLr8nmEWuV6t2hAwhK5I\nNNmBkEo4M/xFxEtl9J7LKbE2gtNrlCQiJlPP1EMhwAjDOzQcJ3lgFB28dkqH5rMW\nTQIhANrCE7O+wlCKe0WJqQ3lYlHG91XWyGVgfExJwBDsAD9LAiEAmDY5OSsH0n2A\n22tthkAvcN1s66lG+0DztOVJ4QLI2z8CIBPeDGwGpx8pdIicN/5LFuLWbyAcoZaT\nbLaA/DCNPniBAiA0l//bzg+M3srIhm04xzLdR9Vb9IjPRlkvN074zdKDVwIhAKJb\nRF3C+CMFb0wXme/ovcDeM1+3W/UmSHYUW4b3WYq4\n-----END
121-
RSA PRIVATE KEY-----","index_start":0,"index_end":491,"line_start":1,"line_end":9}],"incident_url":"https://dashboard.gitguardian.com/workspace/8/incidents/8137383","known_secret":true,"validity":"no_checker"}]}]'
122+
RSA PRIVATE KEY-----","index_start":0,"index_end":491,"line_start":1,"line_end":9}],"is_excluded":false,"exclude_reason":null,"incident_url":"https://dashboard.gitguardian.com/workspace/118907/incidents/3726888","known_secret":true,"validity":"no_checker","diff_kind":null}],"is_diff":false}]'
122123
headers:
123124
access-control-expose-headers:
124125
- X-App-Version
125126
allow:
126127
- POST, OPTIONS
127128
content-length:
128-
- '889'
129+
- '939'
129130
content-type:
130131
- application/json
131132
cross-origin-opener-policy:
132133
- same-origin
133134
date:
134-
- Mon, 12 Aug 2024 09:19:10 GMT
135+
- Wed, 20 Nov 2024 13:59:37 GMT
135136
referrer-policy:
136137
- strict-origin-when-cross-origin
137138
server:
@@ -141,21 +142,21 @@ interactions:
141142
vary:
142143
- Cookie
143144
x-app-version:
144-
- v2.87.2
145+
- v2.119.0
145146
x-content-type-options:
146147
- nosniff
147148
- nosniff
148149
x-envoy-upstream-service-time:
149-
- '65'
150+
- '89'
150151
x-frame-options:
151152
- DENY
152153
- SAMEORIGIN
153154
x-sca-engine-version:
154-
- 1.43.0
155+
- 2.2.0
155156
x-sca-last-vuln-fetch:
156-
- '2024-08-12T09:06:35.075326+00:00'
157+
- '2024-11-20T13:07:19.777354+00:00'
157158
x-secrets-engine-version:
158-
- 2.117.0
159+
- 2.126.0
159160
x-xss-protection:
160161
- 1; mode=block
161162
status:

tests/unit/cassettes/multiple_secrets.yaml

Lines changed: 53 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,53 +9,79 @@ interactions:
99
Connection:
1010
- keep-alive
1111
User-Agent:
12-
- pygitguardian/1.6.0 (Linux;py3.10.6)
12+
- pygitguardian/1.17.0 (Darwin;py3.10.14)
1313
method: GET
1414
uri: https://api.gitguardian.com/v1/metadata
1515
response:
1616
body:
17-
string: '{"version":"v2.30.2","preferences":{"marketplaces__aws_product_url":"http://aws.amazon.com/marketplace/pp/prodview-mrmulzykamba6","on_premise__restrict_signup":true,"on_premise__is_email_server_configured":true,"on_premise__default_sso_config_api_id":null,"public_api__ggshield_auth_flow_enabled":true,"general__onboarding_segmentation_v1_enabled":true},"secret_scan_preferences":{"maximum_documents_per_scan":20,"maximum_document_size":1048576}}'
17+
string:
18+
'{"version":"v2.119.0","preferences":{"marketplaces__aws_product_url":"http://aws.amazon.com/marketplace/pp/prodview-mrmulzykamba6","on_premise__restrict_signup":true,"on_premise__is_email_server_configured":true,"on_premise__default_sso_config_api_id":null,"on_premise__default_sso_config_force_sso":null,"onboarding__segmentation_v1_enabled":true,"general__maximum_payload_size":26214400,"general__mutual_tls_mode":"disabled","general__signup_enabled":true},"secret_scan_preferences":{"maximum_documents_per_scan":20,"maximum_document_size":1048576},"remediation_messages":{"pre_commit":">
19+
How to remediate\n\n Since the secret was detected before the commit was
20+
made:\n 1. replace the secret with its reference (e.g. environment variable).\n 2.
21+
commit again.\n\n> [Apply with caution] If you want to bypass ggshield (false
22+
positive or other reason), run:\n - if you use the pre-commit framework:\n\n SKIP=ggshield
23+
git commit -m \"<your message>\"\n ","pre_push":"> How to remediate\n\n Since
24+
the secret was detected before the push BUT after the commit, you need to:\n 1.
25+
rewrite the git history making sure to replace the secret with its reference
26+
(e.g. environment variable).\n 2. push again.\n\n To prevent having to rewrite
27+
git history in the future, setup ggshield as a pre-commit hook:\n https://docs.gitguardian.com/ggshield-docs/integrations/git-hooks/pre-commit\n\n>
28+
[Apply with caution] If you want to bypass ggshield (false positive or other
29+
reason), run:\n - if you use the pre-commit framework:\n\n SKIP=ggshield-push
30+
git push","pre_receive":"> How to remediate\n\n A pre-receive hook set server
31+
side prevented you from pushing secrets.\n\n Since the secret was detected
32+
during the push BUT after the commit, you need to:\n 1. rewrite the git history
33+
making sure to replace the secret with its reference (e.g. environment variable).\n 2.
34+
push again.\n\n To prevent having to rewrite git history in the future, setup
35+
ggshield as a pre-commit hook:\n https://docs.gitguardian.com/ggshield-docs/integrations/git-hooks/pre-commit\n\n>
36+
[Apply with caution] If you want to bypass ggshield (false positive or other
37+
reason), run:\n\n git push -o breakglass"}}'
1838
headers:
1939
access-control-expose-headers:
2040
- X-App-Version
2141
allow:
2242
- GET, HEAD, OPTIONS
2343
content-length:
24-
- '446'
44+
- '2198'
2545
content-type:
2646
- application/json
2747
cross-origin-opener-policy:
2848
- same-origin
2949
date:
30-
- Mon, 22 May 2023 12:28:00 GMT
50+
- Wed, 20 Nov 2024 13:59:24 GMT
3151
referrer-policy:
3252
- strict-origin-when-cross-origin
3353
server:
3454
- istio-envoy
3555
strict-transport-security:
3656
- max-age=31536000; includeSubDomains
57+
transfer-encoding:
58+
- chunked
3759
vary:
38-
- Cookie
60+
- Accept-Encoding,Cookie
3961
x-app-version:
40-
- v2.30.2
62+
- v2.119.0
4163
x-content-type-options:
4264
- nosniff
4365
- nosniff
4466
x-envoy-upstream-service-time:
45-
- '27'
67+
- '37'
4668
x-frame-options:
4769
- DENY
4870
- SAMEORIGIN
71+
x-sca-engine-version:
72+
- 2.2.0
73+
x-sca-last-vuln-fetch:
74+
- '2024-11-20T13:07:19.777354+00:00'
4975
x-secrets-engine-version:
50-
- 2.89.0
76+
- 2.126.0
5177
x-xss-protection:
5278
- 1; mode=block
5379
status:
5480
code: 200
5581
message: OK
5682
- request:
5783
body:
58-
'[{"filename": "test.txt", "document": "@@ -0,0 +1,2 @@\n+FacebookAppKeys
84+
'[{"filename": "commit://patch/test.txt", "document": "@@ -0,0 +1,2 @@\n+FacebookAppKeys
5985
:\n+String docker run --name geonetwork -d -p 8080:8080 -e MYSQL_HOST=google.com -e
6086
MYSQL_PORT=5434 -e MYSQL_USERNAME=root -e MYSQL_PASSWORD=m42ploz2wd
6187
geonetwork\n"}]'
@@ -67,46 +93,45 @@ interactions:
6793
Connection:
6894
- keep-alive
6995
Content-Length:
70-
- '276'
96+
- '291'
7197
Content-Type:
7298
- application/json
7399
GGShield-Command-Id:
74-
- 6c955e95-c705-4026-89f2-b7a89be107d8
100+
- e90f3cb4-f729-43cd-81d2-3070926c3fed
75101
GGShield-Command-Path:
76102
- external
77103
GGShield-OS-Name:
78-
- ubuntu
104+
- darwin
79105
GGShield-OS-Version:
80-
- '22.04'
106+
- 'Darwin Kernel Version 24.0.0: Tue Sep 24 23:37:13 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T8112'
81107
GGShield-Python-Version:
82-
- 3.10.6
108+
- 3.10.14
83109
GGShield-Version:
84-
- 1.15.1
110+
- 1.33.0
85111
User-Agent:
86-
- pygitguardian/1.6.0 (Linux;py3.10.6)
112+
- pygitguardian/1.17.0 (Darwin;py3.10.14)
87113
mode:
88114
- path
89115
method: POST
90116
uri: https://api.gitguardian.com/v1/multiscan?ignore_known_secrets=True
91117
response:
92118
body:
93119
string:
94-
'[{"policy_break_count":1,"policies":["File extensions","Filenames","Secrets
95-
detection"],"policy_breaks":[{"type":"MySQL Credentials","policy":"Secrets
96-
detection","matches":[{"type":"host","match":"google.com","index_start":114,"index_end":123,"line_start":3,"line_end":3},{"type":"port","match":"5434","index_start":151,"index_end":154,"line_start":3,"line_end":3},{"type":"username","match":"root","index_start":174,"index_end":177,"line_start":3,"line_end":3},{"type":"password","match":"m42ploz2wd","index_start":209,"index_end":218,"line_start":3,"line_end":3}],"validity":"failed_to_check"}]}]'
120+
'[{"policy_break_count":1,"policies":["Secrets detection"],"policy_breaks":[{"type":"MySQL
121+
Credentials","policy":"Secrets detection","matches":[{"type":"host","match":"google.com","index_start":114,"index_end":123,"line_start":3,"line_end":3},{"type":"port","match":"5434","index_start":151,"index_end":154,"line_start":3,"line_end":3},{"type":"username","match":"root","index_start":174,"index_end":177,"line_start":3,"line_end":3},{"type":"password","match":"m42ploz2wd","index_start":209,"index_end":218,"line_start":3,"line_end":3}],"is_excluded":false,"exclude_reason":null,"incident_url":"https://dashboard.gitguardian.com/workspace/118907/incidents/3726884","known_secret":true,"validity":"failed_to_check","diff_kind":"addition"}],"is_diff":true}]'
97122
headers:
98123
access-control-expose-headers:
99124
- X-App-Version
100125
allow:
101126
- POST, OPTIONS
102127
content-length:
103-
- '598'
128+
- '754'
104129
content-type:
105130
- application/json
106131
cross-origin-opener-policy:
107132
- same-origin
108133
date:
109-
- Mon, 22 May 2023 12:28:03 GMT
134+
- Wed, 20 Nov 2024 13:59:27 GMT
110135
referrer-policy:
111136
- strict-origin-when-cross-origin
112137
server:
@@ -116,17 +141,21 @@ interactions:
116141
vary:
117142
- Cookie
118143
x-app-version:
119-
- v2.30.2
144+
- v2.119.0
120145
x-content-type-options:
121146
- nosniff
122147
- nosniff
123148
x-envoy-upstream-service-time:
124-
- '3101'
149+
- '3076'
125150
x-frame-options:
126151
- DENY
127152
- SAMEORIGIN
153+
x-sca-engine-version:
154+
- 2.2.0
155+
x-sca-last-vuln-fetch:
156+
- '2024-11-20T13:07:19.777354+00:00'
128157
x-secrets-engine-version:
129-
- 2.89.0
158+
- 2.126.0
130159
x-xss-protection:
131160
- 1; mode=block
132161
status:

0 commit comments

Comments
 (0)