feat(tpe): add type-aware partial authorization request and response - #371
Merged
muditchaudhary merged 1 commit intoSep 25, 2026
Merged
Conversation
muditchaudhary
force-pushed
the
tpe-request-response
branch
2 times, most recently
from
September 23, 2026 18:40
ddaddab to
d03cdd7
Compare
muditchaudhary
marked this pull request as ready for review
September 23, 2026 19:21
| use serde_json::json; | ||
|
|
||
| const SCHEMA: &str = r#" | ||
| pub(crate) const CEDAR_SRC: &str = r#" |
Contributor
There was a problem hiding this comment.
Nit: Better, but I think my vote would be CEDAR_SCHEMA_SRC going in this direction
| } | ||
|
|
||
| /// The same schema in Cedar's JSON schema format, as a JSON object. | ||
| pub(crate) fn schema_json() -> String { |
Contributor
There was a problem hiding this comment.
Nit: Nice, but I guess then if we ever update it, we'd have to update it in two places. Wonder if we should use a Cedar Rust Schema helper here to convert CEDAR_SRC directly instead.
mark-creamer-amazon
approved these changes
Sep 24, 2026
…types Completes the type-aware partial evaluation (TPE) surface on the Java side. Step 1 added the entity model; this adds the request and response types plus the FFI request validator. All new API is @experimental and purely additive. Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
muditchaudhary
force-pushed
the
tpe-request-response
branch
from
September 25, 2026 19:05
d03cdd7 to
f69c4b1
Compare
victornicolet
approved these changes
Sep 25, 2026
mark-creamer-amazon
approved these changes
Sep 25, 2026
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.
Summary
Adds the request and response types for Cedar's type-aware partial evaluation (TPE), plus the FFI validator behind them. This is the other half of the foundation — #370 added the entity model. Everything is
@Experimentaland purely additive; no existing API changes.The authorization call itself still doesn't exist. That's the next PR, which adds the Rust handler and the
AuthorizationEnginemethods.What
CedarJava
TypeAwarePartialAuthorizationRequest— the principal and resource may have an unknown id, their types are always known, and the action must be concrete. Its builder type checks against the schema at build time, so a request in hand has been checked. Overloads accept a concreteEntityUID, aPartialEntityUID, or just anEntityTypeNamefor the unknown-id case.TypeAwarePartialAuthorizationResponse— the success/failure envelope, mirroring Partial Evaluation's shape.TypeAwarePartialAuthorizationSuccessResponse— the decision, every residual, the trivial and non-trivial partitions as JSON, andgetPolicySet()for reauthorization.CedarJavaFFI
validate_type_aware_partial_request, which builds aPartialRequestand discards it — the same validate-and-discard pattern as the entity validators.Notable decisions
Residual accessors are deliberately not named after Cedar's. . Instead
getPolicySet()is every residual, and the trivial/non-trivial split is computed here from thenontrivialResidualsid set.Issue: #364