Module cedar_policy_core::entities
source · Expand description
This module contains the Entities
type and related functionality.
Structs§
- Simple type that implements
Schema
by allowing entities of all types to exist, and allowing all actions to exist, but expecting no attributes or parents on any entity (action or otherwise). - Attribute type structure used in
SchemaType
- Struct used to parse context from JSON.
- Represents an entity hierarchy, and allows looking up
Entity
objects by UID. Note thatEntities
isSerialize
, but currently this is only used for the FFI layer in DRT. All others use (and should use) thefrom_json_*()
andwrite_to_json()
methods as necessary. - Serde JSON format for a single entity
- Struct used to parse entities from JSON.
- Struct used to check whether entities conform to a schema
- Structure expected by the
__extn
escape - Found a set whose elements don’t all have the same type. This doesn’t match any possible schema.
- Structure representing a Cedar record in JSON
- Simple type that implements
Schema
by expecting no entities to exist at all - Simple type that implements
ContextSchema
by expecting an empty context - Simple type that implements
EntityTypeDescription
by expecting no attributes to exist - Structure expected by the
__entity
escape - Type mismatch error (in terms of
SchemaType
) - Encountered an entity of a type which is not declared in the schema. Note that this error is only used for non-Action entity types.
- Struct used to parse Cedar values from JSON.
Enums§
- The canonical JSON representation of a Cedar value. Many Cedar values have a natural one-to-one mapping to and from JSON values. Cedar values of some types, like entity references or extension values, cannot easily be represented in JSON and thus are represented using the
__entity
, or__extn
escapes. - Errors possible when deserializing request context from JSON
- Results from dereferencing values from the Entity Store
- Error type for errors raised in entities.rs.
- Errors raised when entities do not conform to the schema
- Serde JSON format for Cedar values where we know we’re expecting an entity reference
- Escape kind
- Serde JSON format for Cedar values where we know we’re expecting an extension value
- Errors encountered when trying to compute the
SchemaType
of something - Errors thrown during deserialization from JSON
- Gives information about the context of a JSON deserialization error (e.g., where we were in the JSON document).
- Errors thrown during serialization to JSON
- Possible types that schema-based parsing can expect for Cedar values.
- Describes the option for how the TC (transitive closure) of the entity hierarchy is computed
- Errors returned by
typecheck_value_against_schematype()
andtypecheck_restricted_expr_against_schematype()
Traits§
- Trait for schemas that can inform the parsing of Context data
- Trait for a schema’s description of an individual entity type
- Trait for
Schema
s that can inform the parsing of Entity JSON data
Functions§
- Get the
SchemaType
of aLiteral
. - Get the
SchemaType
of aPartialValue
. - Get the
SchemaType
of a restricted expression. - Get the
SchemaType
of aValue
. - Get the
SchemaType
of aValueKind
. - Check whether the given
RestrictedExpr
typechecks with the givenSchemaType
. If the typecheck passes, returnOk(())
. If the typecheck fails, return an appropriateErr
. - Check whether the given
PartialValue
typechecks with the givenSchemaType
. If the typecheck passes, returnOk(())
. If the typecheck fails, return an appropriateErr
.
Type Aliases§
- Type alias for convenience