Skip to content

Commit

Permalink
Remove experimental from W3037
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong committed Sep 10, 2024
1 parent 6376c63 commit 6aeb2a4
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cfnlint/rules/resources/iam/Permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class Permissions(CfnLintKeyword):
description = "Check for valid IAM Permissions"
source_url = "https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_action.html"
tags = ["properties", "iam", "permissions"]
experimental = True

def __init__(self):
"""Init"""
Expand All @@ -33,6 +32,9 @@ def __init__(self):
def validate(
self, validator: Validator, _, instance: Any, schema: dict[str, Any]
) -> ValidationResult:
if validator.context.transforms.has_sam_transform():
return

actions = ensure_list(instance)

for action in actions:
Expand Down
32 changes: 32 additions & 0 deletions test/unit/rules/resources/iam/test_iam_permissions_sam.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""

import pytest

from cfnlint.rules.resources.iam.Permissions import Permissions


@pytest.fixture(scope="module")
def rule():
rule = Permissions()
yield rule


@pytest.fixture
def template():
return {
"Transform": "AWS::Serverless-2016-10-31",
}


@pytest.mark.parametrize(
"name,instance,err_count",
[
("Empty string", "", 0),
],
)
def test_permissions(name, instance, err_count, rule, validator):
errors = list(rule.validate(validator, {}, instance, {}))
assert len(errors) == err_count, f"Test {name!r} got {errors!r}"

0 comments on commit 6aeb2a4

Please sign in to comment.