Crate cedar_policy
source ·Expand description
Public Rust interface for Cedar
Modules
- This module contains all of the standard Cedar extensions.
- Frontend utilities, see comments in the module itself
Structs
- Authorizer object, which provides responses to authorization queries
- the Context object for an authorization request
- Diagnostics providing more information on how a
Decision
was reached - Represents an entity hierarchy, and allows looking up
Entity
objects by Uid. - Entity datatype
- unique identifier portion of the
EntityUid
type - Represents a namespace
- Represents a concatenation of Namespaces and
TypeName
- Unique Id for an entity, such as
User::"alice"
- Expressions to be evaluated
- if you wrap a
Vec<ParseError>
in this struct, it gains a Display impl that displays each parse error on its own line, indented. - Structure for a
Policy
. Includes both static policies and template-linked policies. - Unique Ids assigned to policies and templates
- Represents a set of
Policy
s - A record of Cedar values
- Represents the request tuple <P, A, R, C> (see the Cedar design doc).
- A residual response obtained from
is_authorized_partial
. - Authorization response returned from the
Authorizer
- “Restricted” expressions are used for attribute values and
context
. - Object containing schema information used by the validator.
- Contains all the type information used to construct a
Schema
that can be used to validate a policy. - Sets of Cedar values
- Identifier for a Template slot
- Represents a location in Cedar policy source.
- Policy template datatype
- An error generated by the validator when it finds a potential problem in a policy. The error contains a enumeration that specifies the kind of problem, and provides details specific to that kind of problem. The error also records where the problem was encountered.
- Contains the result of policy validation. The result includes the list of of issues found by the validation and whether validation succeeds or fails. Validation succeeds if there are no fatal errors. There are currently no non-fatal warnings, so any issues found will cause validation to fail.
- Warnings found in Cedar policies
- Validator object, which provides policy validation and typechecking.
Enums
- Head constraint on policy actions.
- Error type for parsing
Context
from JSON - Decision returned from the
Authorizer
- the Effect of a policy
- Result of Evaluation
- Errors encountered while evaluating policies or expressions, or making authorization decisions.
- Authorization response returned from
is_authorized_partial
It can either be a full concrete response, or a residual response. - Potential errors when adding to a
PolicySet
. - Head constraint on policy principals.
- Head constraint on policy resources.
- Errors encountered during construction of a Validation Schema
- Head constraint on policy principals for templates.
- Head constraint on policy resources for templates.
- Represents the different kinds of type errors and contains information specific to that type error kind.
- Enumeration of the possible diagnostic error that could be found by the verification steps.
- Used to select how a policy will be validated.
Functions
- Scan a set of policies for potentially confusing/obfuscating text.
- Evaluate If evaluation results in an error (e.g., attempting to access a non-existent Entity or Record, passing the wrong number of arguments to a function etc.), that error is returned as a String