AshVault.Errors.InvalidScope exception (AshVault v0.2.0)

Copy Markdown View Source

Raised when an AshVault.Scope implementation returns something other than a binary.

Scope keys address key material in the provider and are baked into the AAD of every ciphertext, so they must be stable across processes, releases and OTP upgrades. A non-binary term is not: :erlang.term_to_binary/1 is explicitly not stable, and an encoding change would relocate a tenant's tombstone and key name at once.

The :scope field holds a description of the offending term, never the term itself — see AshVault.Scope.describe/1. A scope term is usually a tenant, and a loaded tenant record carries customer PII into every log line and APM trace this error reaches. The shape is the entire diagnosis.

Summary

Functions

exception(args)

@spec exception(opts :: Keyword.t()) :: %AshVault.Errors.InvalidScope{
  __exception__: true,
  bread_crumbs: term(),
  class: term(),
  field: term(),
  path: term(),
  resource: term(),
  scope: term(),
  scope_module: term(),
  splode: term(),
  stacktrace: term(),
  vars: term()
}

Create an Elixir.AshVault.Errors.InvalidScope without raising it.

Keys

  • :scope_module
  • :scope
  • :resource
  • :field