regscale-cli 6.20.7.0__py3-none-any.whl → 6.20.8.0__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.

Potentially problematic release.


This version of regscale-cli might be problematic. Click here for more details.

Files changed (40) hide show
  1. regscale/_version.py +1 -1
  2. regscale/core/app/api.py +8 -1
  3. regscale/core/app/application.py +49 -3
  4. regscale/core/utils/date.py +16 -16
  5. regscale/integrations/commercial/aqua/aqua.py +1 -1
  6. regscale/integrations/commercial/aws/cli.py +1 -1
  7. regscale/integrations/commercial/defender.py +1 -1
  8. regscale/integrations/commercial/ecr.py +1 -1
  9. regscale/integrations/commercial/ibm.py +1 -1
  10. regscale/integrations/commercial/nexpose.py +1 -1
  11. regscale/integrations/commercial/prisma.py +1 -1
  12. regscale/integrations/commercial/qualys/__init__.py +150 -77
  13. regscale/integrations/commercial/qualys/containers.py +2 -1
  14. regscale/integrations/commercial/qualys/scanner.py +5 -3
  15. regscale/integrations/commercial/snyk.py +14 -4
  16. regscale/integrations/commercial/synqly/ticketing.py +23 -11
  17. regscale/integrations/commercial/veracode.py +15 -4
  18. regscale/integrations/commercial/xray.py +1 -1
  19. regscale/integrations/public/cisa.py +7 -1
  20. regscale/integrations/public/nist_catalog.py +8 -2
  21. regscale/integrations/scanner_integration.py +18 -36
  22. regscale/models/integration_models/cisa_kev_data.json +51 -6
  23. regscale/models/integration_models/flat_file_importer/__init__.py +34 -19
  24. regscale/models/integration_models/send_reminders.py +8 -2
  25. regscale/models/integration_models/synqly_models/capabilities.json +1 -1
  26. regscale/models/regscale_models/control_implementation.py +40 -0
  27. regscale/models/regscale_models/issue.py +7 -4
  28. regscale/models/regscale_models/parameter.py +3 -2
  29. regscale/models/regscale_models/ports_protocol.py +15 -5
  30. regscale/models/regscale_models/vulnerability.py +1 -1
  31. regscale/utils/graphql_client.py +3 -6
  32. regscale/utils/threading/threadhandler.py +12 -2
  33. {regscale_cli-6.20.7.0.dist-info → regscale_cli-6.20.8.0.dist-info}/METADATA +13 -13
  34. {regscale_cli-6.20.7.0.dist-info → regscale_cli-6.20.8.0.dist-info}/RECORD +40 -39
  35. tests/regscale/core/test_version_regscale.py +62 -0
  36. tests/regscale/test_init.py +2 -0
  37. {regscale_cli-6.20.7.0.dist-info → regscale_cli-6.20.8.0.dist-info}/LICENSE +0 -0
  38. {regscale_cli-6.20.7.0.dist-info → regscale_cli-6.20.8.0.dist-info}/WHEEL +0 -0
  39. {regscale_cli-6.20.7.0.dist-info → regscale_cli-6.20.8.0.dist-info}/entry_points.txt +0 -0
  40. {regscale_cli-6.20.7.0.dist-info → regscale_cli-6.20.8.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,62 @@
1
+ import os
2
+ import pytest
3
+ from click.testing import CliRunner
4
+ from unittest import mock
5
+ import warnings
6
+ import regscale.regscale as regscale
7
+
8
+
9
+ class TestRegscaleCLIVersion:
10
+
11
+ @pytest.fixture(autouse=True)
12
+ def patch_env(self, tmp_path):
13
+ """
14
+ Fixture to patch environment variables for CLI tests to avoid side effects.
15
+ """
16
+ with mock.patch.dict(
17
+ os.environ,
18
+ {
19
+ "REGSCALE_WORKDIR": str(tmp_path),
20
+ "REGSCALE_USER": "testuser",
21
+ "REGSCALE_PASSWORD": "testpass",
22
+ "REGSCALE_DOMAIN": "https://testdomain.com",
23
+ "REGSCALE_USER_ID": "1",
24
+ "REGSCALE_TOKEN": "token",
25
+ },
26
+ clear=True,
27
+ ):
28
+ yield
29
+
30
+ def test_cli_version_command(self):
31
+ """
32
+ Test that the CLI 'version' command prints the local RegScale version and exits successfully.
33
+ """
34
+ runner = CliRunner()
35
+ result = runner.invoke(regscale.cli, ["version"])
36
+ assert result.exit_code == 0
37
+ assert regscale.__version__ in result.output
38
+
39
+ def test_cli_version_server(self):
40
+ """
41
+ Test that the CLI 'version --server' command prints the server version if available.
42
+ Mocks the API call to return a dummy version.
43
+ """
44
+
45
+ class DummyApi:
46
+ def __init__(self):
47
+ self.app = type("App", (), {"config": {"domain": "https://test.com"}})()
48
+
49
+ def get(self, url):
50
+ class DummyRes:
51
+ ok = True
52
+
53
+ def json(self):
54
+ return {"version": "1.2.3"}
55
+
56
+ return DummyRes()
57
+
58
+ with mock.patch("regscale.core.app.api.Api", DummyApi):
59
+ runner = CliRunner()
60
+ result = runner.invoke(regscale.cli, ["version", "--server"])
61
+ assert result.exit_code == 0
62
+ assert "1.2.3" in result.output or "Unable to get version from server." not in result.output
@@ -20,6 +20,8 @@ airflow_operators_python = types.ModuleType("airflow.operators.python")
20
20
 
21
21
  class DummyPythonOperator:
22
22
  def __init__(self, *args, **kwargs):
23
+ # This dummy operator is intentionally left empty because it is only used
24
+ # to mock Airflow's PythonOperator for testing purposes. No initialization logic is needed.
23
25
  pass
24
26
 
25
27