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
Name | Type | Default | Docs |
---|---|---|---|
vault | module | The vault to use to encrypt & decrypt the value | |
attributes | atom | 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_default | atom | list(atom) | [] | A list of attributes that should be decrypted (their calculation should be loaded) by default. |
on_decrypt | (any, any, any, any -> any) | mfa | A function to call when decrypting any value. Takes the resource, field, records, and calculation context. Must return :ok or {:error, error} |