Nexus API Reference

DefaultEnvelopeSerializer
in package
implements EnvelopeSerializer

Read onlyYes
FinalYes
Tags
psalm-api

Default envelope serializer that wraps a MessageSerializer.

Serializes the envelope structure (sender, target, metadata) as JSON, delegating inner message serialization to the wrapped MessageSerializer.

SECURITY: on deserialize, the messageType is read from the wire and passed as the target type to the wrapped serializer. When (and only when) a future remote/cluster transport decodes untrusted peer data through this class, the wrapped serializer MUST bound instantiation to an allow-list of registered types (e.g. ValinorMessageSerializer + TypeRegistry) and reject unregistered messageType values. Never wrap PhpNativeSerializer for cross-boundary envelopes. No production transport feeds untrusted input here today.

Table of Contents

Interfaces

EnvelopeSerializer

Methods

__construct()  : mixed
deserialize()  : Envelope
Deserializes a string representation back into an Envelope.
serialize()  : string
Serializes an Envelope to a string representation.

Methods

On this page

Search results