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

Copy Markdown View Source

Raised when a searchable field's normalize: strategy did not produce a binary.

A lookup token is HMAC-SHA256(key, normalized_plaintext), so the normalized value has to be bytes. AshVault deliberately does not to_string/1 whatever it was handed: inspect/1 of a struct is a stable-looking string that would silently become the searchable identity of the row, and two structs differing only in a field inspect truncates would collide.

The offending value is described, never reproduced — it is the plaintext of an encrypted field, and this error travels wherever Ash sends errors.

Summary

Functions

exception(args)

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

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

Keys

  • :resource
  • :field
  • :strategy
  • :value