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

Revisit generation of unknown extension functions #175

Open
2 tasks
khieta opened this issue Dec 12, 2023 · 1 comment
Open
2 tasks

Revisit generation of unknown extension functions #175

khieta opened this issue Dec 12, 2023 · 1 comment
Labels
internal-improvement Refactoring, performance improvement, or other non-breaking change

Comments

@khieta
Copy link
Contributor

khieta commented Dec 12, 2023

Category

DRT generator(s)

Describe the feature you'd like to request

The current generators almost always generate defined extension function names, but intentionally generate non-existing ones 10% of the time:

// 90% of the time choose an existing extension function, but sometimes don't

This is a little problematic for DRT because the Lean spec treats these unknown names as parse errors while the the Rust code treats them as evaluation/validation errors.

We should either unify the behavior here, or stop generating unknown names.

Note: the public interface checks for unknown function names at parse time and will issue appropriate errors for expressions like undefinedFunction(foo) or foo.undefinedMethod(bar). DRT currently bypasses parsing (related: #75, #76), which is why is unknown names are allowed to appear in the Expr type.

Describe alternatives you've considered

No reponse

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
@khieta khieta added feature-request Request for a new feature pending-triage Hasn't been triaged yet backlog internal-improvement Refactoring, performance improvement, or other non-breaking change and removed feature-request Request for a new feature pending-triage Hasn't been triaged yet labels Dec 12, 2023
@cdisselkoen
Copy link
Contributor

Note: unknown function names are currently denied by the parser for Cedar policies in "human" format (specifically during CST->AST), but are currently allowed by the parser for Cedar policies in JSON format (during EST->AST). If you construct a policy by Policy::from_json() in the public API, it will happily construct an AST with an unknown function name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal-improvement Refactoring, performance improvement, or other non-breaking change
Projects
None yet
Development

No branches or pull requests

3 participants