Parc.Request (parc v0.1.0)

Copy Markdown View Source

The PARC (Principal, Action, Resource, Context) authorization request: the data a Parc.PolicyDecider decides on. An adapter builds it, the declared preparers transform it, and the decider evaluates it.

Fields:

  • :principal: who is asking; nil when anonymous.
  • :action: what is being attempted (action/0); required.
  • :resource: what it acts on (resource/0); required.
  • :context: facts a preparer adds for the decider; %{} by default.

Summary

Types

action()

@type action() :: %{name: atom(), arguments: %{optional(atom()) => term()}}

resource()

@type resource() :: %{type: module(), attributes: %{optional(atom()) => term()} | nil}

t()

@type t() :: %Parc.Request{
  action: action(),
  context: %{optional(atom()) => term()},
  principal: term() | nil,
  resource: resource()
}