Enum cedar_policy_core::est::FromJsonError
source · pub enum FromJsonError {
JsonDeserializationError(JsonDeserializationError),
TemplateToPolicy(UnexpectedSlotError),
InvalidSlotName,
ActionSlot,
SlotsInConditionClause {
slot: SlotId,
clausetype: &'static str,
},
MissingOperator,
MultipleOperators {
ops: Vec<SmolStr>,
},
MultiplicationByNonConstant {
arg1: Expr,
arg2: Expr,
},
UnescapeError(Vec<UnescapeError>),
InvalidEntityType(ParseErrors),
}
Expand description
Errors arising while converting a policy from its JSON representation (aka EST) into an AST
Variants§
JsonDeserializationError(JsonDeserializationError)
Error while deserializing JSON
TemplateToPolicy(UnexpectedSlotError)
Tried to convert an EST representing a template to an AST representing a static policy
InvalidSlotName
Slot name was not valid for the position it was used in. (Currently, principal slots must
be named ?principal
, and resource slots must be named ?resource
.)
ActionSlot
EST contained a template slot for action
. This is not currently allowed
SlotsInConditionClause
Fields
EST contained a template slot in policy condition
MissingOperator
EST contained the empty JSON object {}
where a key (operator) was expected
MultipleOperators
EST contained an object with multiple keys (operators) where a single operator was expected
MultiplicationByNonConstant
At most one of the operands in a * b * c * d * ...
can be a non-{constant int}
UnescapeError(Vec<UnescapeError>)
Error thrown while processing string escapes
InvalidEntityType(ParseErrors)
Error reported when the entity type tested by an is
expression cannot be parsed.
Trait Implementations§
source§impl Debug for FromJsonError
impl Debug for FromJsonError
source§impl Diagnostic for FromJsonError
impl Diagnostic for FromJsonError
source§fn code(&self) -> Option<Box<dyn Display + '_>>
fn code(&self) -> Option<Box<dyn Display + '_>>
Diagnostic
. Ideally also globally unique, and documented
in the toplevel crate’s documentation for easy searching. Rust path
format (foo::bar::baz
) is recommended, but more classic codes like
E0123
or enums will work just fine.source§fn help(&self) -> Option<Box<dyn Display + '_>>
fn help(&self) -> Option<Box<dyn Display + '_>>
Diagnostic
. Do you have any
advice for the poor soul who’s just run into this issue?source§fn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
ReportHandler
s to change the display format
of this diagnostic. Read moresource§fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
Diagnostic
’s Diagnostic::source_code
source§fn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Diagnostic
’s Diagnostic::labels
to.Diagnostic
s.source§fn url(&self) -> Option<Box<dyn Display + '_>>
fn url(&self) -> Option<Box<dyn Display + '_>>
Diagnostic
.