Crate cedar_policy_core

Source
Expand description

Implementation of the Cedar parser and evaluation engine in Rust.

Modules§

ast
This module contains the AST datatypes.
authorizer
This module contains the Cedar “authorizer”, which implements the actual authorization logic.
entities
This module contains the Entities type and related functionality.
est
This module contains the External Syntax Tree (EST)
evaluator
This module contains the Cedar evaluator.
expr_builder
Contains the trait ExprBuilder, defining a generic interface for building different expression data structures (e.g., AST and EST).
extensions
This module contains all of the standard Cedar extensions.
fuzzy_match
This module provides the fuzzy matching utility used to make suggestions when encountering unknown values in entities, functions, etc.
jsonvalue
This module provides general-purpose JSON utilities not specific to Cedar.
parser
This module contains the parser for the Cedar language.
transitive_closure
Module containing code to compute the transitive closure of a graph. This is a generic utility, and not specific to Cedar.

Macros§

impl_diagnostic_from_method_on_field
Macro which implements the .labels() and .source_code() methods of miette::Diagnostic by using the parameter $i which must be a field of some type for which the method $m() returns Option<&Loc>. E.g., a field of type Expr or Box<Expr>, where $m is source_loc.
impl_diagnostic_from_method_on_nonempty_field
Macro which implements the .labels() and .source_code() methods of miette::Diagnostic by using the parameter $i which must be a field of type NonEmpty<T> where T has a method $m() which returns Option<&Loc>. E.g., a field of type NonEmpty<EntityUID>, where $m is loc. Only the first item in the NonEmpty will be underlined.
impl_diagnostic_from_source_loc_field
Macro which implements the .labels() and .source_code() methods of miette::Diagnostic by using the parameter $i which must be the name of a field of type Loc
impl_diagnostic_from_source_loc_opt_field
Macro which implements the .labels() and .source_code() methods of miette::Diagnostic by using the parameter $i which must be the name of a field of type Option<Loc>
impl_diagnostic_from_two_source_loc_fields
Macro which implements the .labels() and .source_code() methods of miette::Diagnostic by using the parameters $i and $j which must be names of fields of type Loc. Both locations will be underlined. It is assumed they have the same src.
impl_diagnostic_from_two_source_loc_opt_fields
Macro which implements the .labels() and .source_code() methods of miette::Diagnostic by using the parameters $i and $j which must be the names of fields of type Option<Loc>. Both locations will be underlined, if both locs are present. It is assumed that both locs have the same src, if both locs are present.

Traits§

FromNormalizedStr
Trait for parsing “normalized” strings only, throwing an error if a non-normalized string is encountered. See docs on the FromNormalizedStr::from_normalized_str trait function.