withAuditContext
function withAuditContext<S>(fetch, options?): BunFetch<S>;Defined in: src/adapters/bun.ts:54
Wrap a Bun.serve fetch handler so each request runs inside an audit
context scope (ADR 0013): actor / tenant / context resolve from the
request, and IP / user agent / request id are captured (the socket IP via
server.requestIP is the fallback when no trusted proxy header is set).
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
S extends BunServerLike |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
fetch |
BunFetch<S> |
options? |
AuditContextOptions<Request> |
Returns
Section titled “Returns”BunFetch<S>