Skip to content

v4.12.0

Latest

Choose a tag to compare

@victornicolet victornicolet released this 28 Jul 20:16
· 1 commit to release/4.12.x since this release
fdcbaed

Release 4.12.0, available on crates.io

Fixed

  • Fixed schema_to_json_with_resolved_types to support converting schemas that use the Action entity 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_pst now 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 tpe feature, fixed PartialEntities::from_json_value to return an error given two entities with duplicate ids.
  • Fixed issue where the derived implementations of Ord and PartialOrd for EntityUids did not order instances lexicographically by type, then by entity id (#2463, #2483).

Added

  • Public syntax tree (pst) support for variadic-is-in-range feature: a variadic isInRange is modelled by a pst::Expr::VariadicOp{...} in the PST (#2380).
  • For the experimental tpe feature, added functions for inspecting partial evaluation results. Adds TpeResponse::reason to get the ids for policies
    contributing to the authorization decision, and specific iterators to list true/false/error/residual permit/forbid policy IDs. Also adds TpeResponse::get_policy
    to lookup a partially evaluated policy by id, and TpeResponse::policy_set to retrieve all partial evaluated policies as a PolicySet.

Changed

  • The experimental protobuf encode method now returns Result<Vec<u8>, EncodeError> instead of Vec<u8>. Encoding rejects expressions and schema types whose nesting depth would exceed prost's decode recursion limit, returning EncodeError::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::decode now 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 new decode_unchecked methods (e.g., Entities::decode_unchecked) for trusted encoded data.
  • For the experimental tpe feature, TpeResponse::residual_policies is updated to return only non-trivial residuals and
    TpeResponse::nontrivial_residual_policies is deprecated. The previous behavior (iterating all residuals including trivial ones)
    is available via TpeResponse::policies.
  • Validating policies with Validator against a Schema with a large action set now uses substantially less peak memory and avoids redundant per-request work, especially under concurrent load. (#2439)