Expand description
FFI utilities, see comments in the module itself
Structs§
- Authorization
Call - Struct containing the input data for authorization
- Authorization
Error - Error (or warning) which occurred in a particular policy during authorization
- Context
- Wrapper around a JSON value describing a context. Expects the same format
as
crate::Context::from_json_value
. See https://docs.cedarpolicy.com/auth/entities-syntax.html - Context
Parsing Call - Struct containing the input data for
check_parse_context()
- Detailed
Error - Structure of the JSON output representing one
miette
error - Diagnostics
- Interface version of
Diagnostics
that stores error messages and warnings in theDetailedError
format - Entities
- Wrapper around a JSON value describing a set of entities. Expects the same
format as
crate::Entities::from_json_value
. See https://docs.cedarpolicy.com/auth/entities-syntax.html - Entities
Parsing Call - Struct containing the input data for
check_parse_entities()
- Entity
Uid - Wrapper around a JSON value describing an entity uid in either explicit or
implicit
__entity
form. Expects the same format ascrate::EntityUid::from_json
. - Formatting
Call - Struct containing the input data for formatting
- Json
Value With NoDuplicate Keys - Wrapper around
serde_json::Value
, with a differentDeserialize
implementation, such that duplicate keys in JSON objects (maps/records) are not allowed (result in an error). - Partial
Authorization Call partial-eval
- Struct containing the input data for partial authorization
- Policy
Set - Represents a policy set, including static policies, templates, and template links
- Residual
Response partial-eval
- FFI version of a
crate::PartialResponse
- Response
- Interface version of a
Response
that uses the interface version ofDiagnostics
- Source
Label - Structure of the JSON output representing a
miette
source label (range) - Source
Location - A range of source code representing the location of an error or warning.
- Template
Link - Represents a template-linked policy
- Validation
Call - Struct containing the input data for validation
- Validation
Error - Error (or warning) for a specified policy after validation
- Validation
Settings - Configuration for the validation call
Enums§
- Authorization
Answer - Answer struct from authorization call
- Check
Parse Answer - Result struct for syntax validation
- Formatting
Answer - Result struct for formatting
- Partial
Authorization Answer partial-eval
- Answer struct from partial-authorization call
- Policy
- Represents a static policy in either the Cedar or JSON policy format
- Policy
ToJson Answer - Result of converting a policy or template to JSON
- Policy
ToText Answer - Result of converting a policy or template to the Cedar format
- Schema
- Represents a schema in either the Cedar or JSON schema format
- Schema
ToJson Answer - Result of converting a schema to JSON
- Schema
ToText Answer - Result of converting a schema to the Cedar format
- Severity
- Exactly like
miette::Severity
but implementsHash
- Static
Policy Set - Represents a set of static policies
- Template
- Represents a policy template in either the Cedar or JSON policy format.
- Validation
Answer - Result struct for validation
Functions§
- check_
parse_ context - Check whether a context successfully parses.
- check_
parse_ context_ json - Check whether a context successfully parses. Input is a JSON encoding of
ContextParsingCall
and output is a JSON encoding ofCheckParseAnswer
. - check_
parse_ context_ json_ str - Check whether a context successfully parses. Input and output are
strings containing serialized JSON, in the shapes expected by
check_parse_context_json()
. - check_
parse_ entities - Check whether a set of entities successfully parses.
- check_
parse_ entities_ json - Check whether a set of entities successfully parses. Input is a JSON
encoding of
EntitiesParsingCall
and output is a JSON encoding ofCheckParseAnswer
. - check_
parse_ entities_ json_ str - Check whether a set of entities successfully parses. Input and output are
strings containing serialized JSON, in the shapes expected by
check_parse_entities_json()
. - check_
parse_ policy_ set - Check whether a policy set successfully parses.
- check_
parse_ policy_ set_ json - Check whether a policy set successfully parses. Input is a JSON encoding of
PolicySet
and output is a JSON encoding ofCheckParseAnswer
. - check_
parse_ policy_ set_ json_ str - Check whether a policy set successfully parses. Input and output are
strings containing serialized JSON, in the shapes expected by
check_parse_policy_set_json()
. - check_
parse_ schema - Check whether a schema successfully parses.
- check_
parse_ schema_ json - Check whether a schema successfully parses. Input is a JSON encoding of
Schema
and output is a JSON encoding ofCheckParseAnswer
. - check_
parse_ schema_ json_ str - Check whether a schema successfully parses. Input and output are strings
containing serialized JSON, in the shapes expected by
check_parse_schema_json()
. - format
- Apply the Cedar policy formatter to a policy set in the Cedar policy format
- format_
json - Apply the Cedar policy formatter. Input is a JSON encoding of
FormattingCall
and output is a JSON encoding ofFormattingAnswer
. - format_
json_ str - Apply the Cedar policy formatter. Input and output are strings containing
serialized JSON, in the shapes expected by
format_json()
. - get_
lang_ version - Get language version of Cedar
- get_
sdk_ version - Get SDK version of Cedar
- is_
authorized - Basic interface, using
AuthorizationCall
andAuthorizationAnswer
types - is_
authorized_ json - Input is a JSON encoding of
AuthorizationCall
and output is a JSON encoding ofAuthorizationAnswer
- is_
authorized_ json_ str - Input and output are strings containing serialized JSON, in the shapes
expected by
is_authorized_json()
- is_
authorized_ partial partial-eval
- Basic interface for partial evaluation, using
AuthorizationCall
andPartialAuthorizationAnswer
types - is_
authorized_ partial_ json partial-eval
- Input is a JSON encoding of
AuthorizationCall
and output is a JSON encoding ofPartialAuthorizationAnswer
- is_
authorized_ partial_ json_ str partial-eval
- Input and output are strings containing serialized JSON, in the shapes
expected by
is_authorized_partial_json()
- policy_
to_ json - Return the JSON representation of a policy.
- policy_
to_ text - Return the Cedar (textual) representation of a policy.
- schema_
to_ json - Return the JSON representation of a schema.
- schema_
to_ text - Return the Cedar (textual) representation of a schema.
- template_
to_ json - Return the JSON representation of a template.
- template_
to_ text - Return the Cedar (textual) representation of a template.
- validate
- Parse a policy set and optionally validate it against a provided schema
- validate_
json - Input is a JSON encoding of
ValidationCall
and output is a JSON encoding ofValidationAnswer
- validate_
json_ str - Input and output are strings containing serialized JSON, in the shapes
expected by
validate_json()