# Class LittleGhost::Network::Gateway

Documentation version: Edge

Canonical HTML: https://littleghostai.org/docs/LittleGhost/Network/Gateway.html

Lifecycle contract implemented by filtered-egress gateways. A Gateway is one
part of enforcement; the Sandbox must also prevent direct networking.

## Inheritance

`LittleGhost::Network::Gateway < Object`

## Attributes

<a id="attribute-i-policy"></a>
### `policy` (R)

Network policy enforced by this gateway.

## Class methods

<a id="method-c-new"></a>
### `.new`

```ruby
.new(policy:)
```

Builds a gateway for a normalized network `policy`.

## Instance methods

<a id="method-i-client_network"></a>
### `#client_network`

```ruby
#client_network()
```

Returns an isolated container network name when applicable.

<a id="method-i-close"></a>
### `#close`

```ruby
#close()
```

Stops owned resources. Calling `close` more than once must be safe.

<a id="method-i-environment"></a>
### `#environment`

```ruby
#environment()
```

Returns child-process proxy and trust environment variables.

<a id="method-i-mounts"></a>
### `#mounts`

```ruby
#mounts()
```

Returns read-only mounts required by child processes.

<a id="method-i-open"></a>
### `#open`

```ruby
#open(run: nil)
```

Starts run-scoped gateway resources.

<a id="method-i-validate-21"></a>
### `#validate!`

```ruby
#validate!()
```

Fails closed when the gateway is no longer ready for a child process.
