# `AshVault.Dsl`
[🔗](https://github.com/jakeschurch/ash_vault/blob/main/lib/ash_vault/dsl.ex#L1)

The `ash_vault` DSL section, as consumed by `use Spark.Dsl.Extension` in `AshVault`.

    use Ash.Resource, extensions: [AshVault]

    ash_vault do
      vault MyApp.Vault
      scope :tenant

      encrypt :email
      encrypt :ssn, encrypt_nil?: false

      decrypt_by_default [:email]
    end

`attributes [:email, :ssn]` is sugar for a list of `encrypt` entities with default
options; `AshVault.Transformers.ExpandAttributes` expands it.

A `macaroon` entity declares an attenuable bearer token for the resource's records;
see `AshVault.Macaroon` and [Macaroons](macaroons.md).

# `sections`

```elixir
@spec sections() :: [Spark.Dsl.Section.t()]
```

The `ash_vault` section definition.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
