·
1 commit
to release/4.12.x
since this release
Release 4.12.0, available on crates.io
Fixed
- Fixed
schema_to_json_with_resolved_typesto support converting schemas that use theActionentity type as an attribute type.
Previously this was reported as an error; it now converts to a correct JSON schema. (#2400) - Added missing validation check when decoding a protobuf policy set that template-linked policy IDs do not collide with template IDs. (#2441)
PolicySet::from_pstnow returns an error if a map key doesn't match the id of its corresponding template or policy, instead of silently accepting the malformed input (#2444).- For the experimental
tpefeature, fixedPartialEntities::from_json_valueto return an error given two entities with duplicate ids. - Fixed issue where the derived implementations of
OrdandPartialOrdforEntityUids did not order instances lexicographically by type, then by entity id (#2463, #2483).
Added
- Public syntax tree (
pst) support forvariadic-is-in-rangefeature: a variadicisInRangeis modelled by apst::Expr::VariadicOp{...}in the PST (#2380). - For the experimental
tpefeature, added functions for inspecting partial evaluation results. AddsTpeResponse::reasonto get the ids for policies
contributing to the authorization decision, and specific iterators to list true/false/error/residual permit/forbid policy IDs. Also addsTpeResponse::get_policy
to lookup a partially evaluated policy by id, andTpeResponse::policy_setto retrieve all partial evaluated policies as aPolicySet.
Changed
- The experimental protobuf
encodemethod now returnsResult<Vec<u8>, EncodeError>instead ofVec<u8>. Encoding rejects expressions and schema types whose nesting depth would exceed prost's decode recursion limit, returningEncodeError::MaxDepthExceeded. This prevents a class of bugs where successfully encoded data could not be decoded. - The experimental protobuf decoding API now validates its inputs, checking structural invariants on entities, expressions, templates, policy sets, and schemas. Additionally,
Entities::decodenow computes the transitive closure instead of assuming it is already computed. These changes may result in lower performance for protobuf decoding. The previous, unvalidated behavior is available via the newdecode_uncheckedmethods (e.g.,Entities::decode_unchecked) for trusted encoded data. - For the experimental
tpefeature,TpeResponse::residual_policiesis updated to return only non-trivial residuals and
TpeResponse::nontrivial_residual_policiesis deprecated. The previous behavior (iterating all residuals including trivial ones)
is available viaTpeResponse::policies. - Validating policies with
Validatoragainst aSchemawith a large action set now uses substantially less peak memory and avoids redundant per-request work, especially under concurrent load. (#2439)