# `Attesto.StatusListStore`
[🔗](https://github.com/XukuLLC/attesto/blob/v2.0.1/lib/attesto/status_list_store.ex#L1)

Storage seam for issuer-managed Token Status Lists.

Each status-list URI has its own monotonically allocated index space. Newly
allocated indices default to status `0` (VALID), and callers can later update
an allocated index before passing `statuses/1` to `Attesto.StatusList`.

`Attesto.StatusListStore.ETS` is a ready single-node implementation. A
multi-node deployment implements this behaviour over shared storage so every
issuer node allocates from the same index space.

# `allocate`

```elixir
@callback allocate(uri :: String.t()) :: {:ok, non_neg_integer()} | {:error, term()}
```

Reserve and return the next status-list index for `uri`.

# `get_status`
*optional* 

```elixir
@callback get_status(uri :: String.t(), idx :: non_neg_integer()) ::
  {:ok, non_neg_integer()} | :error
```

Read an allocated index's current status.

# `set_status`

```elixir
@callback set_status(
  uri :: String.t(),
  idx :: non_neg_integer(),
  status :: non_neg_integer()
) :: :ok | :error
```

Set an allocated index's status, or return `:error` if it was not allocated.

# `statuses`

```elixir
@callback statuses(uri :: String.t()) :: [non_neg_integer()]
```

Return the dense status list for `uri`, ordered from index zero.

---

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