cedar-policy / cedar

Implementation of the Cedar Policy Language
https://www.cedarpolicy.com
Apache License 2.0
889 stars 80 forks source link

Suggest obvious fix when action id includes type #1258

Closed adpaco-aws closed 1 month ago

adpaco-aws commented 1 month ago

Description of changes

This PR extends the validation of action IDs so that we detect cases in which the user may have mistakenly included the entity type (i.e., "Action::") in the action ID. In that case, we don't suggest another action ID like we used to, but instead draw attention to the fact that the action ID was defined with the entity type in its name. This avoids misleading the user when the fix is much simpler.

Resolves #166

Checklist for requesting a review

The change in this PR is (choose one, and delete the other options):

I confirm that this PR (choose one, and delete the other options):

I confirm that cedar-spec (choose one, and delete the other options):

I confirm that docs.cedarpolicy.com (choose one, and delete the other options):