Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sca): Revert "feat(sca): using the new api license/get-licenses-violations … #6176

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions checkov/common/sca/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ def get_license_statuses(packages: list[dict[str, Any]]) -> list[_LicenseStatus]
try:
response = request_wrapper(
method="POST",
url=f"{bc_integration.api_url}/api/v1/vulnerabilities/license/get-licenses-violations",
url=f"{bc_integration.api_url}/api/v1/vulnerabilities/packages/get-licenses-violations",
headers=bc_integration.get_default_headers("POST"),
json={"packages": requests_input},
should_call_raise_for_status=True
Expand All @@ -694,7 +694,7 @@ async def get_license_statuses_async(
as an input, and the asyncio behavior is managed in the calling method.
"""
requests_input = _get_request_input(packages)
url = f"{bc_integration.api_url}/api/v1/vulnerabilities/license/get-licenses-violations"
url = f"{bc_integration.api_url}/api/v1/vulnerabilities/packages/get-licenses-violations"
if not requests_input:
return {'image_name': image_name, 'licenses': []}
try:
Expand Down
4 changes: 2 additions & 2 deletions tests/common/sca/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_licenses_status(mock_bc_integration):
# given
responses.add(
method=responses.POST,
url=mock_bc_integration.api_url + "/api/v1/vulnerabilities/license/get-licenses-violations",
url=mock_bc_integration.api_url + "/api/v1/vulnerabilities/packages/get-licenses-violations",
json=response_json,
status=200
)
Expand Down Expand Up @@ -91,7 +91,7 @@ def test_licenses_status_on_failure(mock_bc_integration):

responses.add(
method=responses.POST,
url=mock_bc_integration.api_url + "/api/v1/vulnerabilities/license/get-licenses-violations",
url=mock_bc_integration.api_url + "/api/v1/vulnerabilities/packages/get-licenses-violations",
status=500
)

Expand Down
2 changes: 1 addition & 1 deletion tests/sca_image/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def get_sca_image_report(mock_bc_integration: BcPlatformIntegration) -> Report:
}
responses.add(
method=responses.POST,
url=mock_bc_integration.api_url + "/api/v1/vulnerabilities/license/get-licenses-violations",
url=mock_bc_integration.api_url + "/api/v1/vulnerabilities/packages/get-licenses-violations",
json=response_json,
status=200
)
Expand Down
8 changes: 4 additions & 4 deletions tests/sca_image/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_image_referencer_trigger_image_flow_calls(mock_bc_integration, image_na
}
with aioresponses() as mock_response:
mock_response.post(
url=mock_bc_integration.api_url + "/api/v1/vulnerabilities/license/get-licenses-violations",
url=mock_bc_integration.api_url + "/api/v1/vulnerabilities/packages/get-licenses-violations",
payload=response_json,
status=200
)
Expand Down Expand Up @@ -94,7 +94,7 @@ def test_runner_honors_enforcement_rules(mock_bc_integration, image_name, cached

with aioresponses() as mock_response:
mock_response.post(
url=mock_bc_integration.api_url + "/api/v1/vulnerabilities/license/get-licenses-violations",
url=mock_bc_integration.api_url + "/api/v1/vulnerabilities/packages/get-licenses-violations",
payload=response_json,
status=200
)
Expand Down Expand Up @@ -224,7 +224,7 @@ def test_run_license_policy(mock_bc_integration, image_name, cached_scan_result)
}
with aioresponses() as mock_response:
mock_response.post(
url=mock_bc_integration.api_url + "/api/v1/vulnerabilities/license/get-licenses-violations",
url=mock_bc_integration.api_url + "/api/v1/vulnerabilities/packages/get-licenses-violations",
payload=response_json,
status=200
)
Expand Down Expand Up @@ -267,7 +267,7 @@ def test_run_with_empty_scan_result(mock_bc_integration):
}
responses.add(
method=responses.POST,
url=mock_bc_integration.api_url + "/api/v1/vulnerabilities/license/get-licenses-violations",
url=mock_bc_integration.api_url + "/api/v1/vulnerabilities/packages/get-licenses-violations",
json=response_json,
status=200
)
Expand Down