# `PrivateChannel`

A class in `fastatp.peerapp` ([source](https://github.com/jacoblapenna/fastatp/blob/main/fastatp/peerapp.py#L91)).

```python
PrivateChannel(
    handle: RepoHandle,
    ephemeral_did: str,
    wg_public_key: str,
    wg_private_key: str,
    endpoint_host: str | None,
    expires_at: str,
    issuer_did: str,
)
```

A live ephemeral private-response repo.

A fresh `did:key` + repo + WG identity, hosted gated with a TTL, admitting
exactly one counterpart by public key. The reply is written into it and a
signed [`Attestation`](https://fastatp.com/api/attestation.md) points at it; when the TTL passes the host makes
it unroutable and cuts subscribers (producer-authoritative lifetime, ADR
0015). Writes go only through this handle — never `emit(did=...)`.

## Attributes

- `handle: RepoHandle`
- `ephemeral_did: str`
- `wg_public_key: str`
- `wg_private_key: str`
- `endpoint_host: str | None`
- `expires_at: str`
- `issuer_did: str`
- `did: str`
- `tunnel_ip: str`: The channel's overlay address: derived from its WG key, never allocated. The host answers on it by adding it to its interface.

## Methods

### `put_record`

```python
async put_record(collection: str, rkey: str, record: RecordLike) -> CommitEvent | None
```

### `close`

```python
async close() -> None
```

Retire the channel now (before its TTL).
