cycode 3.17.1.dev5__py3-none-any.whl → 3.17.1.dev7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
cycode/__init__.py CHANGED
@@ -5,4 +5,4 @@ import time as _time
5
5
  # end-to-end scan duration from the moment the user actually triggered it.
6
6
  _BOOT_WALL: float = _time.time()
7
7
 
8
- __version__ = '3.17.1.dev5' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
8
+ __version__ = '3.17.1.dev7' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
@@ -279,7 +279,10 @@ def scan_documents(
279
279
 
280
280
  scan_batch_thread_func = _get_scan_documents_thread_func(ctx, is_git_diff, is_commit_range, scan_parameters)
281
281
 
282
- if should_use_presigned_upload(scan_type):
282
+ # Presigned single-file upload is async-only; a --sync scan must stay on the batched inline path
283
+ # so it never builds one oversized zip to POST synchronously.
284
+ should_use_sync_flow = _should_use_sync_flow(ctx.info_name, scan_type, ctx.obj['sync'])
285
+ if should_use_presigned_upload(scan_type) and not should_use_sync_flow:
283
286
  errors, local_scan_results = _run_presigned_upload_scan(
284
287
  scan_batch_thread_func, scan_type, documents_to_scan, progress_bar, printer
285
288
  )
@@ -388,7 +391,11 @@ def _perform_scan(
388
391
  is_commit_range,
389
392
  on_upload_progress,
390
393
  )
391
- except requests.exceptions.RequestException:
394
+ except (
395
+ requests.exceptions.RequestException,
396
+ custom_exceptions.RequestError,
397
+ custom_exceptions.SlowUploadConnectionError,
398
+ ):
392
399
  logger.warning('Direct upload to object storage failed. Falling back to upload via Cycode API. ')
393
400
 
394
401
  return _perform_scan_async(
@@ -19,6 +19,7 @@ from cycode.cli.apps.scan.scan_result import (
19
19
  print_local_scan_results,
20
20
  )
21
21
  from cycode.cli.config import configuration_manager
22
+ from cycode.cli.exceptions import custom_exceptions
22
23
  from cycode.cli.exceptions.handle_scan_errors import handle_scan_exception
23
24
  from cycode.cli.files_collector.commit_range_documents import (
24
25
  collect_commit_range_diff_documents,
@@ -162,7 +163,11 @@ def _scan_commit_range_documents(
162
163
  scan_parameters,
163
164
  timeout,
164
165
  )
165
- except requests.exceptions.RequestException:
166
+ except (
167
+ requests.exceptions.RequestException,
168
+ custom_exceptions.RequestError,
169
+ custom_exceptions.SlowUploadConnectionError,
170
+ ):
166
171
  logger.warning('Direct upload to object storage failed. Falling back to upload via Cycode API. ')
167
172
  scan_result = _perform_commit_range_scan_async(
168
173
  cycode_client,
cycode/cli/consts.py CHANGED
@@ -222,12 +222,13 @@ EXCLUSIONS_BY_CVE_SECTION_NAME = 'cves'
222
222
  FILE_MAX_SIZE_LIMIT_IN_BYTES = 5000000
223
223
 
224
224
  PRESIGNED_LINK_UPLOADED_ZIP_MAX_SIZE_LIMIT_IN_BYTES = 5 * 1024 * 1024 * 1024 # 5 GB (S3 presigned POST limit)
225
- PRESIGNED_UPLOAD_SCAN_TYPES = {SAST_SCAN_TYPE}
225
+ PRESIGNED_UPLOAD_SCAN_TYPES = {SAST_SCAN_TYPE, SECRET_SCAN_TYPE}
226
226
 
227
227
  DEFAULT_ZIP_MAX_SIZE_LIMIT_IN_BYTES = 20 * 1024 * 1024
228
228
  ZIP_MAX_SIZE_LIMIT_IN_BYTES = {
229
229
  SCA_SCAN_TYPE: 200 * 1024 * 1024,
230
230
  SAST_SCAN_TYPE: PRESIGNED_LINK_UPLOADED_ZIP_MAX_SIZE_LIMIT_IN_BYTES,
231
+ SECRET_SCAN_TYPE: PRESIGNED_LINK_UPLOADED_ZIP_MAX_SIZE_LIMIT_IN_BYTES,
231
232
  }
232
233
 
233
234
  # scan in batches
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cycode
3
- Version: 3.17.1.dev5
3
+ Version: 3.17.1.dev7
4
4
  Summary: Boost security in your dev lifecycle via SAST, SCA, Secrets & IaC scanning.
5
5
  License-Expression: MIT
6
6
  License-File: LICENCE
@@ -1,4 +1,4 @@
1
- cycode/__init__.py,sha256=E9GO08_Ufb4NXMhi6TgfZDyEzOpeeFS40kiBYSn9iaQ,396
1
+ cycode/__init__.py,sha256=X_9J5Y-8AaEYDIWByi5x4t0fQJqyuEGehwbatEaJnOI,396
2
2
  cycode/__main__.py,sha256=Z3bD5yrA7yPvAChcADQrqCaZd0ChGI1gdiwALwbWJ6U,104
3
3
  cycode/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  cycode/cli/app.py,sha256=AlR2durAEbsa47PDfIj7JtMvJDWA_Dq6wPtVuMJYSCs,10250
@@ -64,10 +64,10 @@ cycode/cli/apps/report_import/sbom/sbom_command.py,sha256=uWvBhVdROHcHsjoR3l44h3
64
64
  cycode/cli/apps/sca_options.py,sha256=-3iXoJV5qOkfjr-WGIWuAgaeNYeItJIbm2n6O2Kg5D8,1666
65
65
  cycode/cli/apps/scan/__init__.py,sha256=-q1AIBnrQ4GP0CVKFLr_2CdWf9TBQC90ejSL4I7rxuA,2444
66
66
  cycode/cli/apps/scan/aggregation_report.py,sha256=8f9kPfO7biNf5OsDZG6UhMPqG6ymoFrX5GBtlEIfFAg,1540
67
- cycode/cli/apps/scan/code_scanner.py,sha256=jjUzi2yueS0TrW4lo_vkkz1KMoBJfwjCCsKeSmoPW2A,17099
67
+ cycode/cli/apps/scan/code_scanner.py,sha256=e5jAsDp99VyeSoiLLIkm7P3HOYOInaTq8qZ-OytsO3w,17513
68
68
  cycode/cli/apps/scan/commit_history/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
69
69
  cycode/cli/apps/scan/commit_history/commit_history_command.py,sha256=zTVmN8yeLXGAiCbyDL-EyEzSPNLzcRpP2q6Qq7p4uZA,1011
70
- cycode/cli/apps/scan/commit_range_scanner.py,sha256=axFs--Xcb3I7D_SJHtBNE810qyCsSzLqPn_rD_8Peb8,17172
70
+ cycode/cli/apps/scan/commit_range_scanner.py,sha256=beEEwi6f9W_jULGuTsYzpDGmnzCXfcrFxUUmfEmrVhU,17382
71
71
  cycode/cli/apps/scan/detection_excluder.py,sha256=0zaNa1PxVshATHv8axp4e-xWvmuNQdg_r5DYsdQ9EVo,6432
72
72
  cycode/cli/apps/scan/path/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
73
73
  cycode/cli/apps/scan/path/path_command.py,sha256=x4HXqq1Wy6onziKMc6ELQxqeI5k-m3t_T3RG9kQxrq0,591
@@ -94,7 +94,7 @@ cycode/cli/apps/status/version_command.py,sha256=c6Iko_rmZo9T_kQSd3HUloBi40Qv7cj
94
94
  cycode/cli/cli_types.py,sha256=QbFWJLtlsEnHGdqdHbLolJqT57RfhocvsPAhlcNcCRE,3354
95
95
  cycode/cli/config.py,sha256=Op-lX_neanJtvPvoOEx4ByBdveh5ygElIga1FdSHhOI,299
96
96
  cycode/cli/console.py,sha256=vp-DHwlkwpwdsPyfwGdjsPF-6-Bi3f8W7G-W_YXCMH8,1914
97
- cycode/cli/consts.py,sha256=L900JVQyOILWFg6D6miNQHv0h2Wr6PYA4FuiDSymzaw,9687
97
+ cycode/cli/consts.py,sha256=LX9YW0JlD4jQSDzui0IA6KONMQ-POBHx7sX8X57XpGE,9780
98
98
  cycode/cli/exceptions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
99
99
  cycode/cli/exceptions/custom_exceptions.py,sha256=mTPLPI6V5JrEM6IQ8f7An9P207oYWEgJr-l9UpieSWk,4232
100
100
  cycode/cli/exceptions/handle_ai_remediation_errors.py,sha256=mA70upSYXK3rL_fmanzKYeUzLENhpXdkW8k3aIHrKzU,785
@@ -209,8 +209,8 @@ cycode/cyclient/report_client.py,sha256=Scq30NeJPzgXv0hPLO1U05AdE9i_2iu6cIrSKpEJ
209
209
  cycode/cyclient/scan_client.py,sha256=6TK5FQkfrvV7PHqRnUzEn1PBNd2oPYVamvIixcUfe3c,16755
210
210
  cycode/cyclient/scan_config_base.py,sha256=mXsPZGYCtp85rv5GIige40yQZXuRcEKUW-VQJ0vgFzk,1201
211
211
  cycode/logger.py,sha256=EfZGRK6VC5rE_LAjIcRrHFiQCueylCDXoG6bvGkrIME,2111
212
- cycode-3.17.1.dev5.dist-info/METADATA,sha256=NjwUucICourheYThcqR25dyHmm8NAshRcKGN8ciCRfI,89246
213
- cycode-3.17.1.dev5.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
214
- cycode-3.17.1.dev5.dist-info/entry_points.txt,sha256=iDcVJM8ByLElVgvBgtYxDjw1kT7O8Mo0LcWZIT5L3Ig,45
215
- cycode-3.17.1.dev5.dist-info/licenses/LICENCE,sha256=2Wx4N6mD_4xB7-E3hPkZ3MPhpJy__k_I8MaCSO-PDRo,1068
216
- cycode-3.17.1.dev5.dist-info/RECORD,,
212
+ cycode-3.17.1.dev7.dist-info/METADATA,sha256=SFL4azW4g6gWF8vY6kmw2q8XiOu31K3MzHFIzvrmQEU,89246
213
+ cycode-3.17.1.dev7.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
214
+ cycode-3.17.1.dev7.dist-info/entry_points.txt,sha256=iDcVJM8ByLElVgvBgtYxDjw1kT7O8Mo0LcWZIT5L3Ig,45
215
+ cycode-3.17.1.dev7.dist-info/licenses/LICENCE,sha256=2Wx4N6mD_4xB7-E3hPkZ3MPhpJy__k_I8MaCSO-PDRo,1068
216
+ cycode-3.17.1.dev7.dist-info/RECORD,,