# `WardrikDaemon.Config.Orgs`

Reads `config.yaml`'s `orgs`: the orgs beside the deployment's own.

    orgs:
      "*":
        mcp: [search]
        policy: base
      payments:
        mcp: [stripe, github]
        channels: [payments-slack]
        notify: [audit]
        policy: payments-strict

## Keys

  * `mcp`, `channels`, `notify` - the servers, channels and targets the org's agents use, by the
    names their sections give them.
  * `policy` - the policy in `policies/` the org's agents are held to.

`"*"` is every org: what it lists, every org uses, and its policy holds every org.

A server, channel or target no entry lists is the deployment's own org's. A channel serves one
org, or every org if `"*"` lists it.

# `entry`

```elixir
@type entry() :: %{
  mcp: [String.t()],
  channels: [String.t()],
  notify: [String.t()],
  policy: String.t() | nil
}
```

# `read`

```elixir
@spec read(map() | nil, %{required(String.t()) =&gt; [String.t()]}) ::
  {:ok, %{required(String.t()) =&gt; entry()}} | {:error, String.t()}
```

Returns each org's entry, `"*"`'s too.

`defined` holds the names `mcp`, `channels` and `notify` define, which entries may list.

# `using`

```elixir
@spec using(%{required(String.t()) =&gt; entry()}, atom(), String.t(), String.t()) ::
  :all | [String.t()]
```

Returns the orgs whose agents use the `kind` of thing called `name`.

Returns `:all` if `"*"` lists it, the orgs whose entries list it, or `[org]` if none does.

---

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