fix(cloudflare): move changelog to unreleased section and fix logger prefix

This commit is contained in:
Andoni A. committed 2026-04-15 09:09:12 +02:00
1 parent 3cfd4b8e0c
commit ef6fd91071
3 files changed
+16 -2

No files matched your search

+1 -1
View File
@@ -17,6 +17,7 @@ All notable changes to the **Prowler SDK** are documented in this file.
- `entra_conditional_access_policy_mfa_enforced_for_guest_users` check for M365 provider [(#10616)](https://github.com/prowler-cloud/prowler/pull/10616)
- `entra_conditional_access_policy_corporate_device_sign_in_frequency_enforced` check for m365 provider [(#10618)](https://github.com/prowler-cloud/prowler/pull/10618)
- `entra_conditional_access_policy_block_unknown_device_platforms` check for m365 provider [(#10615)](https://github.com/prowler-cloud/prowler/pull/10615)
- `api_token_ip_restriction_enabled` check for cloudflare provider [(#10624)](https://github.com/prowler-cloud/prowler/pull/10624)
### 🔄 Changed
@@ -45,7 +46,6 @@ All notable changes to the **Prowler SDK** are documented in this file.
- `entra_conditional_access_policy_device_registration_mfa_required` check and `entra_intune_enrollment_sign_in_frequency_every_time` enhancement for M365 provider [(#10222)](https://github.com/prowler-cloud/prowler/pull/10222)
- `entra_conditional_access_policy_block_elevated_insider_risk` check for M365 provider [(#10234)](https://github.com/prowler-cloud/prowler/pull/10234)
- `Vercel` provider support with 30 checks [(#10189)](https://github.com/prowler-cloud/prowler/pull/10189)
- `api_token_ip_restriction_enabled` check for cloudflare provider [(#10624)](https://github.com/prowler-cloud/prowler/pull/10624)
- `internet-exposed` category for 13 AWS checks (CloudFront, CodeArtifact, EC2, EFS, RDS, SageMaker, Shield, VPC) [(#10502)](https://github.com/prowler-cloud/prowler/pull/10502)
- `stepfunctions_statemachine_no_secrets_in_definition` check for hardcoded secrets in AWS Step Functions state machine definitions [(#10570)](https://github.com/prowler-cloud/prowler/pull/10570)
- CCC improvements with the latest checks and new mappings [(#10625)](https://github.com/prowler-cloud/prowler/pull/10625)
@@ -17,7 +17,7 @@ class API(CloudflareService):
def _list_api_tokens(self) -> None:
"""List all API tokens for the authenticated user."""
logger.info("APIToken - Listing API tokens...")
logger.info("API - Listing API tokens...")
try:
seen_token_ids: set[str] = set()
for token in self.client.user.tokens.list():
@@ -235,3 +235,17 @@ class Test_API_Service:
assert len(service.tokens) == 1
assert service.tokens[0].id == "token-valid"
def test_list_api_tokens_handles_exception(self):
mock_provider = set_mocked_cloudflare_provider()
mock_provider.session.client.user.tokens.list.side_effect = Exception(
"API error"
)
with mock.patch(
"prowler.providers.common.provider.Provider.get_global_provider",
return_value=mock_provider,
):
service = API(mock_provider)
assert service.tokens == []