aws-cloudformation / cfn-lint

CloudFormation Linter
MIT No Attribution
2.43k stars 588 forks source link

Update policy principal validation logic #3400

Closed kddejong closed 3 months ago

kddejong commented 3 months ago

Issue #, if available: fix #3398

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.20%. Comparing base (ed39a19) to head (7251f4e).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3400 +/- ## ========================================== - Coverage 93.20% 93.20% -0.01% ========================================== Files 323 323 Lines 11016 11018 +2 Branches 2301 2302 +1 ========================================== + Hits 10268 10269 +1 Misses 417 417 - Partials 331 332 +1 ``` | [Flag](https://app.codecov.io/gh/aws-cloudformation/cfn-lint/pull/3400/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws-cloudformation) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/aws-cloudformation/cfn-lint/pull/3400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws-cloudformation) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aws-cloudformation#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

kddejong commented 3 months ago

Modified the policy.json to be more open about its validation. We didn't really need an anyOf which cleaned it up.

Also updated I1022 to not provide a warning in a CDK template.