v3.0.0
·
6 commits
to release/3.0.x
since this release
Release 3.0.0, available on crates.io
Cedar Language Version: 3.0.0
Added
- Marked the
Template::from_jsonandTemplate::to_jsonapis as public (#458) - New APIs to
Entitiesto make it easy to add a collection of entities to an
existingEntitiesstructure. (#276) - Export the
cedar_policy_core::evaluator::{EvaluationError, EvaluationErrorKind}and
cedar_policy_core::authorizer::AuthorizationErrorerror types. (#260, #271) ParseError::primary_source_spanto get the primary source span locating an
error. (#324)- Experimental API
PolicySet::unknown_entitiesto collect unknown entity UIDs
from aPartialResponse. (#353, resolving #321) PolicySet::remove_static,PolicySet::remove_templateand
PolicySet::unlinkto remove policies from the policy set. (#337, resolving #328)PolicySet::get_linked_policiesto get the policies linked to aTemplate. (#337)ValidationResult::validation_warningsto access non-fatal warnings returned
by the validator andValidationResult::validation_passed_without_warnings.
The main validation entry point now checks for warnings previously only
available throughconfusable_string_checker. (#404)- The
isoperation as described in
RFC 5.
(#396) Entity::new_no_attrs()which provides an infallible constructor forEntity
in the case that there are no attributes. (See changes toEntity::new()
below.) (#430)RestrictedExpression::new_entity_uid()(#442, resolving #350)
Changed
- Rename
cedar_policy_core::est::EstToAstErrorto
cedar_policy_core::est::FromJsonError. (#197) - Rename
cedar_policy_core::entities::JsonDeserializationError::ExtensionsError
tocedar_policy_core::entities::JsonDeserializationError::ExtensionFunctionLookup.
(#360) - Rename variants in
SchemaError. (#231) SchemaErrorhas a new variant corresponding to errors evaluating action
attributes. (#430)Diagnostics::errors()now returns an iterator overAuthorizationErrors.
(#260)Response::new()now expects aVec<AuthorizationError>as its third
argument. (#260)- Implement RFC 19,
making validation slightly more strict, but more explainable. (#282) - Implement RFC 20,
disallowing duplicate keys in record values (including record literals in
policies, requestcontext, and records in entity attributes). (#375) Entities::from_*()methods now automatically add action entities present in
theschemato the constructedEntities, if aschemais provided. (#360)Entities::from_*()methods now validate the entities against theschema,
if aschemais provided. (#360)Entities::from_entities()andEntities::add_entities()now take an
optional schema argument. (#360)Request::new()now takes an optional schema argument, and validates the request
against that schema. To signal validation errors, it now returns aResult.
(#393, resolving #191)- Change the semantics of equality for IP ranges. For example,
ip("192.168.0.1/24") == ip("192.168.0.3/24")was previouslytrueand is now
false. The behavior of equality on single IP addresses is unchanged, and so is
the behavior of.isInRange(). (#348) - Standardize on duplicates being errors instead of last-write-wins in the
JSON-based APIs in thefrontendmodule. This also means some error types
have changed. (#365, #448) Entity::new()now eagerly evaluates entity attributes, leading to
performance improvements (particularly when entity data is reused across
multipleis_authorizedcalls). As a result, it returnsResult, because
attribute evaluation can fail. (#430)Entities::from_json_*()also now eagerly evaluates entity attributes, and as
a result returns errors when attribute evaluation fails. (#430)Entity::attr()now returns errors in many fewer cases (because the attribute
is stored in already-evaluated form), and its error type has changed. (#430)Context::from_*()methods also now eagerly evaluate theContext, and as
a result return errors when evaluation fails. (#430)<EntityId as FromStr>::Erroris nowInfallibleinstead ofParseErrors.
(#372)- Improve the
Displayimpls forPolicyandPolicySet, and add aDisplay
impl forTemplate. The displayed representations now more closely match the
original input, whether the input was in string or JSON form. (#167, resolving
#125) ValidationWarning::locationandValidationWarning::to_kind_and_location
now return&SourceLocation<'a>instead of&'a PolicyID, matching
ValidationError::location. (#405)ValidationWarningKindis nownon_exhaustive, allowing future warnings to
be added without a breaking change. (#404)- Improve schema parsing error messages when a cycle exists in the action
hierarchy to includes an action which is part of the cycle (#436, resolving
#416).
Fixed
- Evaluation order of operand to
>and>=. They now evaluate left to right,
matching all other operators. This affects what error is reported when there is
an evaluation error in both operands, but does not otherwise change the result
of evaluation. (#402, resolving #112) - Updated
PolicySet::linkto not mutate internal state when failing to link a static
policy. With this fix it is possible to create a link with a policy id
after previously failing to create that link with the same id from a static
policy. (#412) - Fixed schema-based parsing of entity data that includes unknowns (for the
partial-evalexperimental feature). (#419, resolving #418)