v4.0.0
john-h-kastner-aws
released this
16 Sep 16:19
·
1 commit
to release/4.0.x
since this release
Added
- Additional functionality to the JSON FFI including parsing utilities (#1079)
and conversion between the Cedar and JSON formats (#1087) - (*) Schema JSON syntax now accepts a type
EntityOrCommon
representing a
typename that can resolve to either an entity or common type, matching the
behavior of typenames written in the human-readable (Cedar) syntax. (#1060, as
part of resolving #579)
Changed
- (*) Implemented RFC 70.
In both the Cedar and JSON schema syntaxes, it is now illegal to define the
same entity name, common type name, or action name in both the empty namespace
and a nonempty namespace. - (*) Implemented RFC 52.
Names containing__cedar
(e.g.,__cedar
,A::__cedar
,__cedar::A
, and
A::__cedar::B
) are now invalid. (#969) - The API around
Request::new
has changed to remove theOption
s
around the entity type arguments. See RFC 55. - Replaced uses of "natural", "human", "human-readable", and "custom" with "Cedar" (#1114).
APIs with these names are changed accordingly. E.g.,Schema::from_str_natural
toSchema::from_cedarschema_str
.
Moreover, theFromStr
implementations ofSchema
andSchemaFragment
now parse strings in the Cedar schema format. UseSchema::from_json_str
andSchemaFragment::from_json_str
to parse strings in the JSON schema format. - Significantly reworked all public-facing error types to address some issues
and improve consistency. See issue #745. - Finalized the
ffi
module andcedar-wasm
crate which were preview-released
in 3.2.0. This involved API breaking changes in both. See #757 and #854. - (*) Changed policy validation to reject comparisons and conditionals between
record types that differ in whether an attribute is required or optional. (#769) - (*) Improved consistency between JSON and Cedar schema formats. Both now
forbid usingBool
,Boolean
,Entity
,Extension
,Long
,Record
,Set
,
andString
as common type names. (#1150, resolving #1139) - Changed the FFI to error on typos or unexpected fields in the input JSON (#1041)
- Changed
Policy::parse
andTemplate::parse
to accept anOption<PolicyId>
instead ofOption<String>
to set the policy id (#1055, resolving #1049) PolicySet::template_annotation
now returnsOption<&str>
as opposed to
Option<String>
in the previous version (#1131, resolving #1116)- Moved
<PolicyId as FromStr>::Err
toInfallible
(#588, resolving #551) - Removed unnecessary lifetimes from some validation related structs (#715)
- Marked errors/warnings related to parsing and validation as
non_exhaustive
,
allowing future variants to be added without a breaking change. (#1137, #1169)
Removed
- (*) Removed unspecified entity type. See RFC 55.
- Removed integration testing harness from the
cedar-policy
crate. It is now
in an internal crate, allowing us to make semver incompatible changes. (#857) - Removed the (deprecated)
frontend
module in favor of the newffi
module
introduced in 3.2.0. See #757. - Removed
ParseErrors::errors_as_strings
. Callers should consider examining
the rich data provided bymiette::Diagnostic
, for instance.help()
and
labels()
. Callers can continue using the same behavior by calling
.iter().map(ToString::to_string)
. (#882, resolving #543) - Removed
ParseError::primary_source_span
. Callers should use the location
information provided bymiette::Diagnostic
via.labels()
and
.source_code()
instead. (#908) - Removed
Display
impl forEntityId
in favor of explicit.escaped()
and
.as_ref()
for escaped and unescaped representations (respectively) of the
EntityId
; see note there (#921, resolving #884)
Fixed
- (*) JSON format Cedar schemas will now fail to parse if they reference an unknown
extension type. This was already an error for human-readable schema syntax. (#890, resolving #875) - (*) Schemas can now reference entity and common types defined in the empty namespace,
even in contexts occurring in a non-empty namespace. (#1060, resolving #579)