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

Report source locations for undefined entity type and action errors in validation #522

Closed
2 tasks
john-h-kastner-aws opened this issue Dec 19, 2023 · 4 comments · Fixed by #802
Closed
2 tasks
Assignees
Labels
backlog We hope to work on this in the future feature-request Request for a new feature papercut

Comments

@john-h-kastner-aws
Copy link
Contributor

john-h-kastner-aws commented Dec 19, 2023

Category

Other

Describe the feature you'd like to request

The validator error messages for undefined entity types and actions don't record source locations even though they easily could.

We currently get an error like

  × policy set validation failed
  ╰─▶ validation error on policy `policy0`: unrecognized entity type `AWS`
  help: did you mean `List`?

which is good, but would be better if we pointed to the source location where the entity type is used.

We also don't track source locations for InvalidActionApplication, but fixing this requires more work in #521.

Describe alternatives you've considered

.

Additional context

.

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change
@john-h-kastner-aws john-h-kastner-aws added pending-triage Hasn't been triaged yet feature-request Request for a new feature backlog We hope to work on this in the future and removed pending-triage Hasn't been triaged yet labels Dec 19, 2023
@Swolebrain
Copy link
Contributor

I want this badly

@john-h-kastner-aws john-h-kastner-aws self-assigned this Apr 18, 2024
@shaobo-he-aws
Copy link
Contributor

Would this feature require #531? I think type reference resolution when parsing human readable schemas can report these errors but may not actually do it.

@john-h-kastner-aws
Copy link
Contributor Author

no, this issues only requires a source location in the policy

@chrnorm
Copy link

chrnorm commented Apr 18, 2024

Support for this would help make our Policy Validation GitHub Action easier to maintain - we ended up adding a second round of policy parsing in our Cedar WASM fork to get the ranges for the policy ID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We hope to work on this in the future feature-request Request for a new feature papercut
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants