Interface: SafContext
Static, serializable context about what's currently going on. These should always be available in backend systems.
Extended by
Properties
acceptLanguage?
optionalacceptLanguage:string
HTTP Accept-Language header when present.
auth?
optionalauth:Auth
If the request is backed by an authenticated user, this will be set. More info should be gotten directly from the auth service.
clientIp?
optionalclientIp:string
Best-effort client IP for the inbound request (e.g. first X-Forwarded-For hop, else Express req.ip, else socket).
host?
optionalhost:string
HTTP Host header (or equivalent) for the inbound request, when known (e.g. Express). Used for analytics and routing diagnostics.
jobId?
optionaljobId:string
When this request is a job delivery, the delivering job's id (from assertion claims). Chained enqueue() calls use it as parentJobId.
operationName
operationName:
string
Format: "{method_name}" e.g. "GetUser", such as operationId in OpenAPI, rpc name in gRPC, job name in cron, or command name in CLI.
origin?
optionalorigin:string
HTTP Origin header when the client sends it (e.g. browsers, CORS).
originalRequestId?
optionaloriginalRequestId:string
Lineage root of a background chain. Set from assertion claims when present; consumers fall back to requestId when absent.
requestId?
optionalrequestId:string
Format: "{uuid}" Generated by request instantiators server-side, so things like reverse proxies, async job services, and http servers which are directly accessible by clients. Generally, grpc and http servers receive a request ID and should use it to correlate requests across processes.
serviceName
serviceName:
string
Format: "{service}" e.g. "auth", "payment", "logging", or the name of a product. The name should match the docker service and npm package name (not including the org).
subsystemName
subsystemName:
SubsystemName
Format: "{subsystem}"
Basically, a single server or long-running "process".
userAgent?
optionaluserAgent:string
HTTP User-Agent header when present.