Arc.Identity.Context (cratis_arc v0.1.0)

Copy Markdown View Source

The input of an identity details provider: the authenticated caller.

  • :id - the identity identifier from the identity provider, "unknown" when absent
  • :name - the display name
  • :claims - {type, value} string pairs from the authenticated principal, including a {"role", role} pair per role
  • :principal - the full Arc.Principal
  • :application and :tenant - the Arc application and the tenant of the request, so a provider can read tenant-scoped data. context/1 turns them into an Arc.Context

Summary

Functions

An Arc.Context for the caller: the application, principal and tenant of the identity request, for example to read a profile with Arc.MongoDB.

Types

t()

@type t() :: %Arc.Identity.Context{
  application: module() | nil,
  claims: [{String.t(), String.t()}],
  id: String.t(),
  name: String.t(),
  principal: Arc.Principal.t() | nil,
  tenant: String.t() | nil
}

Functions

context(identity)

@spec context(t()) :: Arc.Context.t()

An Arc.Context for the caller: the application, principal and tenant of the identity request, for example to read a profile with Arc.MongoDB.