Meta
To implement various kinds of functionality the framework uses a metadata object, which is passed to
the handlers. The convention is to use a variable named $meta to refer to that parameter.
The metadata may contain the following properties:
mtid: the type of message being processed, one ofrequest,response,notification,error,eventmethod: the method nameauth: authentication informationactorId: user identifiersessionId: sessionmlek: encryption keymlsk: signing keypermissionMap: map of permissions
language:languageId: active language
httpResponse: used to set HTTP response propertiestype: string to set as content-typeredirect: URL to redirect tocode: status code to setstate: cookies to setheader: headers to set
httpRequest: contains HTTP request data, when applicableurl: request URLstate: request cookiesheaders: request headers
name: the execution context name. The handler proxy injects it when a handler is reached through a naming alias, which is how a test report, a log line or a trace says which step ran rather than only which method (see the unified handler-test rationale)expect: used during tests to suppress logging of expected error typescheckpoint: function that records a named progress point during execution,(name, data?) => void, used to observe the intermediate state of a flow. Absent in production, so callers optional-chain it (see checkpoints and progress points)decide: takes a branch and keeps which one it was —decide(discriminator, values, branches), returning the chosen branch's result. Present in every mode, because a branch has to be taken whether or not anything is recordingprogress: everything this invocation announced, in the order it announced it — one entry per call tocheckpoint({kind: 'point', name, data?, timestamp, regions?}) and one per call todecide({kind: 'region', discriminator, candidates, chosen, values, regions?}), so a test can assert on the moments and on the choices between them, in one list. An entry'sregionsnames the branches it sat inside, outermost first, which is what lets a report draw a branch as the group of the points taken in it — and what keeps that nesting intact when the entry arrived from another processforward: contains b3-propagation data used for tracingdispatch: optional function to be called during thedispatchstep of the adapter loop, instead of the framework's built-in dispatch functiontimeout: used for tracking the remaining time until timeoutgateway: gateway to use when calling the methodvalidation: details for the validation errorretry:stream:headers:reply:request:
Properties used by codecs:
trace:opcode:conId:
These properties are used for the audit log and are set by the gateway, based on information from the HTTP server and the OS:
hostName:ipAddress:machineName:os:version:serviceName:frontEnd:localAddress:localPort:deviceId:latitude:longitude:
These properties are used internally and should not be modified by user code:
cache: object, that helps for cache implementationport:optional:instead:before:key:ttl:after:
timer:name:newTime:
errorCode: error code when mtid=error, used for loggingerrorMessage: error message when mtid=error, used for logging