Skip to content

Conversation

@khieta
Copy link
Contributor

@khieta khieta commented Nov 7, 2023

Updates to RFC #19

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

Copy link
Contributor

@cdisselkoen cdisselkoen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this PR, the RFC gets the same date for FCP and for Accepted. Is that correct?

Co-authored-by: Craig Disselkoen <cdiss@amazon.com>
@khieta
Copy link
Contributor Author

khieta commented Nov 7, 2023

In this PR, the RFC gets the same date for FCP and for Accepted. Is that correct?

Good point -- accepted date was wrong. Will fix in next commit.


## Updates

* 2023-11-07: The original text said that `AnyEntity` was used to type unspecified entities. This is not the case in any released version of Cedar -- instead unspecified entities are given a special `Unspecified` type. Updated text to reflect this.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even for validation in permissive mode ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, both modes. The type of an unspecified entity (i.e., a principal/resource in an environment where the action was missing appliesTo field(s) in the schema) is Entity({Unspecified}) rather than AnyEntity. AnyEntity is only used for template slots and the UB of actions.

In typechecking, <Unspecified> == <Specified Entity> is typed as False.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just double checked the code, and I was too hasty 😬 Here is the revised answer:

"Unspecified" entities are given type AnyEntity by the type checker, but in the rules for typing == and in are special-cased to return False when one element is unspecified.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been true since the initial release, see type_of_equality and typecheck_in.

Will update the note to accurately reflect this. Sorry for the bugs... I have a lot of balls in the air this week.

Copy link
Contributor Author

@khieta khieta Nov 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@khieta khieta merged commit 70ed3d4 into main Nov 8, 2023
@khieta khieta deleted the khieta/pr-19-edit branch November 8, 2023 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants