View Source DSL: AshCloak

An extension for encrypting attributes of a resource.

See the getting started guide for more information.

cloak

Encrypt attributes of a resource

Options

NameTypeDefaultDocs
vaultmoduleThe vault to use to encrypt & decrypt the value
attributesatom | list(atom)[]The attribute or attributes to encrypt. The attribute will be renamed to encrypted_{attribute}, and a calculation with the same name will be added.
decrypt_by_defaultatom | list(atom)[]A list of attributes that should be decrypted (their calculation should be loaded) by default.
on_decrypt(any, any, any, any -> any) | mfaA function to call when decrypting any value. Takes the resource, field, records, and calculation context. Must return :ok or {:error, error}