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

Improve precision when typechecking in #105

Open
2 tasks
john-h-kastner-aws opened this issue May 31, 2023 · 3 comments
Open
2 tasks

Improve precision when typechecking in #105

john-h-kastner-aws opened this issue May 31, 2023 · 3 comments
Labels
feature-request This issue requets a substantial new feature

Comments

@john-h-kastner-aws
Copy link
Contributor

Category

Cedar validation features

Describe the feature you'd like to request

The validator sometimes gives imprecise types to expressions using in.

  • principal in [] will type as Bool when principal is Unspecified, although we could give the more precise type of False.
  • Expressions like action in action or principal in principal will type as Bool, even though we could give them type True.
  • If the action hierarchy says that Action::"read" is a descendant of Action::"read_or_write", then Action::"read" in Action::"read_or_write" will type as Bool, even though we could type it as True.

Describe the solution you'd like

n/a

Describe alternatives you've considered

n/a

Additional context

No response

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
@anwarmamat anwarmamat added feature-request This issue requets a substantial new feature help-wanted Community help desired. We have not scheduled time to fix this, but think it important. backlog and removed enhancement labels Jun 6, 2023
@john-h-kastner-aws john-h-kastner-aws removed the help-wanted Community help desired. We have not scheduled time to fix this, but think it important. label Jun 6, 2023
@khieta khieta added pending-review A Cedar maintainer has looked at this, but believes it needs review by more of the core team and removed backlog labels Jun 6, 2023
@cdisselkoen cdisselkoen added backlog and removed pending-review A Cedar maintainer has looked at this, but believes it needs review by more of the core team labels Jun 8, 2023
@john-h-kastner-aws
Copy link
Contributor Author

From #310, a substantial improvement can be had by implementing singleton action types. This would make giving precise types to in expression involving actions trivial, even simplifying some of the existing code. This will also support precise types for in expression in policy bodies that aren't directly applied to action literals.

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

Implementing this in a backwards compatible manner requires #539

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

Related to #638

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request This issue requets a substantial new feature
Projects
None yet
Development

No branches or pull requests

4 participants