AshVault.DecryptFor (AshVault v0.2.0)

Copy Markdown View Source

Evaluates an encrypt ..., decrypt_for: [...] list against an actor.

Entries:

  • an Ash.Policy.SimpleCheck module — match?(actor, context, [])
  • {check, opts} — the same, with opts passed to the check
  • {check, only: [action_name]} (:only may be combined with check opts) — matches only on those actions. On the decrypt calculation, where no action is known, such an entry never matches.
  • &Mod.fun/1 — a remote actor predicate (the DSL cannot hold anonymous functions)

A nil actor never matches. Unset (nil) decrypt_for admits everyone.

Read callbacks supply normalized tenant, resource, field, phase and source context. :action is always derived from the explicit action argument, never from context. Three-argument callers retain the original action-only context.

Summary

Functions

Whether actor may have the field decrypted on action (nil when unknown).

Types

entry()

@type entry() :: module() | {module(), keyword()} | (term() -> boolean())

Functions

allowed?(entries, actor, action, context \\ %{})

@spec allowed?([entry()] | nil, term(), term(), map()) :: boolean()

Whether actor may have the field decrypted on action (nil when unknown).