ExCedar.Context (ex_cedar v0.1.2)

Copy Markdown View Source

Cedar request context.

Wraps a map of attributes that Cedar can reference in policy conditions. Attribute values are encoded as Cedar JSON record values via the same rules as ExCedar.Entity attributes.

Plain maps can be used directly in ExCedar.Request without wrapping in this struct — the authorizer handles both forms.

Summary

Functions

Wraps a plain map in a Context struct.

Encodes the context as a Cedar JSON record value.

Types

t()

@type t() :: %ExCedar.Context{attributes: map()}

Functions

from_map(map)

@spec from_map(map()) :: t()

Wraps a plain map in a Context struct.

to_json(context)

@spec to_json(t()) :: map()

Encodes the context as a Cedar JSON record value.