cycode 3.15.4.dev2__py3-none-any.whl → 3.15.4.dev4__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
@@ -1 +1 @@
1
- __version__ = '3.15.4.dev2' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
1
+ __version__ = '3.15.4.dev4' # DON'T TOUCH. Placeholder. Will be filled automatically on poetry build from Git Tag
@@ -28,17 +28,32 @@ _SCA_RICH_HELP_PANEL = 'SCA options'
28
28
  _SECRET_RICH_HELP_PANEL = 'Secret options'
29
29
 
30
30
 
31
+ def _single_value_callback(ctx: typer.Context, param: typer.CallbackParam, value: list) -> list:
32
+ if len(value) > 1:
33
+ values_str = ', '.join(str(v) for v in value)
34
+ param_hint = '/'.join(sorted(param.opts, key=len))
35
+ err = typer.BadParameter(
36
+ f'Only one value can be specified per command. Got: {values_str}. Run a separate command for each value.',
37
+ ctx=ctx,
38
+ param_hint=param_hint,
39
+ )
40
+ err.exit_code = 1
41
+ raise err
42
+ return value
43
+
44
+
31
45
  def scan_command(
32
46
  ctx: typer.Context,
33
47
  scan_type: Annotated[
34
- ScanTypeOption,
48
+ list[ScanTypeOption],
35
49
  typer.Option(
36
50
  '--scan-type',
37
51
  '-t',
38
52
  help='Specify the type of scan you wish to execute.',
39
53
  case_sensitive=False,
54
+ callback=_single_value_callback,
40
55
  ),
41
- ] = ScanTypeOption.SECRET,
56
+ ] = (ScanTypeOption.SECRET,),
42
57
  soft_fail: Annotated[
43
58
  bool, typer.Option('--soft-fail', help='Run the scan without failing; always return a non-error status code.')
44
59
  ] = False,
@@ -137,6 +152,9 @@ def scan_command(
137
152
  param_hint='--export-file',
138
153
  )
139
154
 
155
+ # _single_value_callback validated exactly one value was provided; unwrap from list
156
+ scan_type = scan_type[0]
157
+
140
158
  ctx.obj['show_secret'] = show_secret
141
159
  ctx.obj['soft_fail'] = soft_fail
142
160
  ctx.obj['stop_on_error'] = stop_on_error
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cycode
3
- Version: 3.15.4.dev2
3
+ Version: 3.15.4.dev4
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=QDmVY8Xl94_IN6IhGe3VfDW0t23u1d5S_iQ9f1k08Ww,115
1
+ cycode/__init__.py,sha256=xuzlVjeQf1gLEhNfqT1QmzPhFjXpRBfWdOojU_RkVUg,115
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=7ReEcVkRX9IaQ2I7jAj7Sl9smbtvxiuK8-9bitMEQik,7491
@@ -83,7 +83,7 @@ cycode/cli/apps/scan/repository/repository_command.py,sha256=03C93JYvyN_W-vstsl5
83
83
  cycode/cli/apps/scan/scan_ci/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
84
84
  cycode/cli/apps/scan/scan_ci/ci_integrations.py,sha256=3ZUv1uLsHC13KTNQ4erQKKDXAkmaSm5jow2Utwr4mCw,1634
85
85
  cycode/cli/apps/scan/scan_ci/scan_ci_command.py,sha256=37I6YTs5UWYtbnDe1EeYZnhV1twFTDUrniZ4Sf2_6Kk,562
86
- cycode/cli/apps/scan/scan_command.py,sha256=rcd0RYJvfCQA6Z53u8BJfVjM5S5PqbKSzFPlMtyv-ZQ,7229
86
+ cycode/cli/apps/scan/scan_command.py,sha256=n3bzGjB5CSmLRfFn6-pLBhrlOCDTRz2Kfn2L_J1l0io,7916
87
87
  cycode/cli/apps/scan/scan_parameters.py,sha256=66Ft8c_L6_BxDvRgJoXP5ItUQfzSHGF_XJWBdQismrg,1341
88
88
  cycode/cli/apps/scan/scan_result.py,sha256=mIxALi_qUfXHoauSU7SknX0xLp8P9WdhV3oFc8jp_SA,8497
89
89
  cycode/cli/apps/status/__init__.py,sha256=uxfkEBafO7Da0mPc1fZhwoO0RTtyXp2a5T3LJTZxubU,371
@@ -207,8 +207,8 @@ cycode/cyclient/report_client.py,sha256=Scq30NeJPzgXv0hPLO1U05AdE9i_2iu6cIrSKpEJ
207
207
  cycode/cyclient/scan_client.py,sha256=6TK5FQkfrvV7PHqRnUzEn1PBNd2oPYVamvIixcUfe3c,16755
208
208
  cycode/cyclient/scan_config_base.py,sha256=mXsPZGYCtp85rv5GIige40yQZXuRcEKUW-VQJ0vgFzk,1201
209
209
  cycode/logger.py,sha256=EfZGRK6VC5rE_LAjIcRrHFiQCueylCDXoG6bvGkrIME,2111
210
- cycode-3.15.4.dev2.dist-info/METADATA,sha256=xiTfy56jgKUKJCRHNswSmoi0vEizW1tCcM1FUQazfp0,89206
211
- cycode-3.15.4.dev2.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
212
- cycode-3.15.4.dev2.dist-info/entry_points.txt,sha256=iDcVJM8ByLElVgvBgtYxDjw1kT7O8Mo0LcWZIT5L3Ig,45
213
- cycode-3.15.4.dev2.dist-info/licenses/LICENCE,sha256=2Wx4N6mD_4xB7-E3hPkZ3MPhpJy__k_I8MaCSO-PDRo,1068
214
- cycode-3.15.4.dev2.dist-info/RECORD,,
210
+ cycode-3.15.4.dev4.dist-info/METADATA,sha256=JqFSQoDRPOuqZ38sdHZDvEEtAphurJVTxrUYlq5nkSE,89206
211
+ cycode-3.15.4.dev4.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
212
+ cycode-3.15.4.dev4.dist-info/entry_points.txt,sha256=iDcVJM8ByLElVgvBgtYxDjw1kT7O8Mo0LcWZIT5L3Ig,45
213
+ cycode-3.15.4.dev4.dist-info/licenses/LICENCE,sha256=2Wx4N6mD_4xB7-E3hPkZ3MPhpJy__k_I8MaCSO-PDRo,1068
214
+ cycode-3.15.4.dev4.dist-info/RECORD,,