Add unchecked Entities constructors that skip transitive closure - #2552
Draft
Harrichael wants to merge 1 commit into
Draft
Harrichael wants to merge 1 commit into
Harrichael wants to merge 1 commit into
Conversation
Signed-off-by: Michael Harrington <michaeltoddharrington@gmail.com>
1 of 2 tasks
Coverage ReportHead Commit: Base Commit: Download the full coverage report. Coverage of Added or Modified Lines of Rust CodeRequired coverage: 80.00% Actual coverage: 96.30% Status: PASSED ✅ Details
Coverage of All Lines of Rust CodeRequired coverage: 80.00% Actual coverage: 88.40% Status: PASSED ✅ Details
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
Motivation: callers that keep a large pre-loaded entity graph in memory and already maintain its closure themselves can avoid paying to recompute it on every construction or update. This follows the
Entities::decode_uncheckedprecedent from #2387. No changes tocedar-policy-core; theAssumeAlreadyComputedmode already existed there.Adds
Entities::from_entities_uncheckedandEntities::upsert_entities_uncheckedto thecedar-policycrate. They mirrorfrom_entitiesandupsert_entitiesexactly, except that they passTCComputation::AssumeAlreadyComputedto the core layer instead ofComputeNow, so the transitive closure of the entity hierarchy is neither computed nor checked. The caller must supply a hierarchy that is already acyclic and transitively closed (every ancestor listed in each entity'sparents).Everything else the checked constructors do still applies: duplicate detection, schema conformance checking, and adding
Actionentities from the schema infrom_entities_unchecked. Only transitive closure computation and cycle detection are skipped.Issue #, if available
Resolves #2378
Checklist for requesting a review
The change in this PR is:
cedar-policy(e.g., addition of a new API).I confirm that this PR:
I confirm that
cedar-spec:I confirm that
docs.cedarpolicy.com: