Cedar entity UID — a {type, id} pair that uniquely identifies an entity.
The type field may be namespaced (e.g. "App::User"). The id is the
bare string value (unescaped). Use to_string/1 to render the Cedar syntax
Type::"id" and parse/1 to parse it back.
Summary
Functions
Builds an EntityUid from type and id strings.
Parses a Cedar-syntax entity UID string into an EntityUid.
Returns the Cedar JSON entity-reference shape: %{"type" => type, "id" => id}.
Renders the EntityUid as a Cedar-syntax string (Type::"id").
Types
Functions
Builds an EntityUid from type and id strings.
Parses a Cedar-syntax entity UID string into an EntityUid.
iex> ExCedar.EntityUid.parse(~s|User::"alice"|)
{:ok, %ExCedar.EntityUid{type: "User", id: "alice"}}
iex> {:ok, uid} = ExCedar.EntityUid.parse(~s|App::User::"bob"|)
iex> uid.type
"App::User"Returns {:error, %ExCedar.Error.Request{}} if the string is not a valid
Cedar entity UID.
Returns the Cedar JSON entity-reference shape: %{"type" => type, "id" => id}.
Renders the EntityUid as a Cedar-syntax string (Type::"id").
Special characters in id (backslash and double-quote) are escaped.