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

Copy Markdown View Source

Raised by verify_mac! when a tag does not verify.

The key version was found, the scope is not destroyed and the provider answered: the tag is simply not the tag for this data, under this context (scope, resource, field) and this key version. Causes are a forged or tampered tag, tampered data, a tag replayed from another scope, resource or field, or a tag paired with the wrong key version.

It is deliberately distinct from the three answers that are not "the tag is wrong":

The struct carries neither the tag nor the data. A tag is a bearer credential, and Ash logs and reports errors verbatim.

Summary

Functions

exception(args)

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

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

Keys

  • :resource
  • :field
  • :key_version