# `PaperTiger.Plugs.Sandbox`
[🔗](https://github.com/EnaiaInc/paper_tiger/blob/v1.2.2/lib/paper_tiger/plugs/sandbox.ex#L1)

Plug that extracts test namespace from HTTP headers for sandbox isolation.

When a request includes the `x-paper-tiger-namespace` header, this plug
sets the namespace in the process dictionary so that all PaperTiger
operations scope data to that namespace.

## Usage in Tests

    # In your test setup
    setup :checkout_paper_tiger

    # When making HTTP requests, include the namespace header
    Req.post(url,
      headers: [
        {"authorization", "Bearer sk_test_mock"},
        {"x-paper-tiger-namespace", inspect(self())}
      ]
    )

    # Or use the helper from PaperTiger.Test
    Req.post(url, headers: PaperTiger.Test.sandbox_headers())

## How It Works

1. Client sends `x-paper-tiger-namespace` header with the test PID as a string
2. This plug parses the PID and sets it in the process dictionary
3. All subsequent store operations in this request use that namespace
4. Data is isolated from other concurrent tests

# `call`

# `init`

---

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