Introspection functions for the AshCloak extension.
Summary
Functions
The attribute or attributes to encrypt. The attribute will be renamed to encrypted_{attribute}, and a calculation with the same name will be added.
The attribute or attributes to encrypt. The attribute will be renamed to encrypted_{attribute}, and a calculation with the same name will be added.
A list of attributes that should be decrypted (their calculation should be loaded) by default.
A list of attributes that should be decrypted (their calculation should be loaded) by default.
A function to call when decrypting any value. Takes the resource, field, records, and calculation context. Must return :ok or {:error, error}
A function to call when decrypting any value. Takes the resource, field, records, and calculation context. Must return :ok or {:error, error}
cloak DSL options
The vault to use to encrypt & decrypt the value. Accepts a module implementing Cloak.Vault, a fun/2 of the form (resource_module, context) -> vault_module, or an MFA tuple. When a function or MFA is given, it is called at every encrypt and decrypt operation and its return value is used as the vault module.
The vault to use to encrypt & decrypt the value. Accepts a module implementing Cloak.Vault, a fun/2 of the form (resource_module, context) -> vault_module, or an MFA tuple. When a function or MFA is given, it is called at every encrypt and decrypt operation and its return value is used as the vault module.
Functions
The attribute or attributes to encrypt. The attribute will be renamed to encrypted_{attribute}, and a calculation with the same name will be added.
The attribute or attributes to encrypt. The attribute will be renamed to encrypted_{attribute}, and a calculation with the same name will be added.
A list of attributes that should be decrypted (their calculation should be loaded) by default.
A list of attributes that should be decrypted (their calculation should be loaded) by default.
@spec cloak_on_decrypt(dsl_or_extended :: module() | map()) :: {:ok, (any(), any(), any(), any() -> any()) | mfa()} | :error
A function to call when decrypting any value. Takes the resource, field, records, and calculation context. Must return :ok or {:error, error}
@spec cloak_on_decrypt!(dsl_or_extended :: module() | map()) :: ((any(), any(), any(), any() -> any()) | mfa()) | no_return()
A function to call when decrypting any value. Takes the resource, field, records, and calculation context. Must return :ok or {:error, error}
cloak DSL options
Returns a map containing the and any configured or default values.
@spec cloak_vault(dsl_or_extended :: module() | map()) :: {:ok, module() | (any(), any() -> any()) | mfa()} | :error
The vault to use to encrypt & decrypt the value. Accepts a module implementing Cloak.Vault, a fun/2 of the form (resource_module, context) -> vault_module, or an MFA tuple. When a function or MFA is given, it is called at every encrypt and decrypt operation and its return value is used as the vault module.
@spec cloak_vault!(dsl_or_extended :: module() | map()) :: (module() | (any(), any() -> any()) | mfa()) | no_return()
The vault to use to encrypt & decrypt the value. Accepts a module implementing Cloak.Vault, a fun/2 of the form (resource_module, context) -> vault_module, or an MFA tuple. When a function or MFA is given, it is called at every encrypt and decrypt operation and its return value is used as the vault module.