# `Alternera.Plugin.Provisional.ChildEnv`
[🔗](https://github.com/10e-ab/alternera-sdk/blob/v0.9.0/alternera_plugin_sdk/lib/alternera/plugin/provisional/child_env.ex#L1)

The environment a plugin gives an OS process it starts.

A port's child inherits the node's whole environment unless told
otherwise, and the node's environment holds what the proxy itself runs
on: the vault key, the database URL, the session secret, the release
cookie. A host process runs code the proxy did not write (an operator's
command, a JVM running routes, a WASM runtime running tenants' modules),
and each has `/proc/self/environ`; a guard around that code that failed
would hand over the installation, not the one tenant.

Two answers, both in the shape `Port.open/2`'s `:env` takes (a name with
`false` is unset in the child):

  * `without_proxy_secrets/1` unsets the proxy's own secrets and leaves
    everything else, for a process an operator configured and whose other
    variables (`JAVA_HOME`, a driver's own settings) are theirs to rely on;
  * `only/2` unsets everything outside an allowlist, for a process that
    needs nothing from the environment.

# `port_env`

```elixir
@type port_env() :: [{charlist(), charlist() | false}]
```

# `only`

```elixir
@spec only([String.t()], %{required(String.t()) =&gt; String.t()}) :: port_env()
```

Unsets every inherited variable whose name is not in `allowed`.

# `without_proxy_secrets`

```elixir
@spec without_proxy_secrets(%{required(String.t()) =&gt; String.t()}) :: port_env()
```

Unsets the proxy's own secrets in the child; every other variable is inherited.

---

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