ResolvedRequestContext
final class ResolvedRequestContext (View source)
Captures one immutable, trust-aware view of externally visible request metadata.
Methods
Stores peer identity, resolved client identity and the validated external request origin.
Returns the direct network peer reported by the server request.
Returns the first client address outside the trusted proxy chain.
Reports whether the immediate peer belongs to an explicitly trusted proxy network.
Returns the resolved external HTTP scheme.
Reports whether the resolved external request used HTTPS.
Returns an allowlisted host without brackets, or null when no request-derived host was approved.
Returns a non-default external port, or null when the scheme default applies.
Returns the normalized external application prefix, or an empty string when none was trusted.
Details
__construct
__construct(string|null $peerIp, string|null $clientIp, bool $viaTrustedProxy, string $scheme, string|null $host, int|null $port, string $prefix)
Stores peer identity, resolved client identity and the validated external request origin.
peerIp
string|null
peerIp()
Returns the direct network peer reported by the server request.
clientIp
string|null
clientIp()
Returns the first client address outside the trusted proxy chain.
viaTrustedProxy
bool
viaTrustedProxy()
Reports whether the immediate peer belongs to an explicitly trusted proxy network.
scheme
string
scheme()
Returns the resolved external HTTP scheme.
secure
bool
secure()
Reports whether the resolved external request used HTTPS.
host
string|null
host()
Returns an allowlisted host without brackets, or null when no request-derived host was approved.
port
int|null
port()
Returns a non-default external port, or null when the scheme default applies.
prefix
string
prefix()
Returns the normalized external application prefix, or an empty string when none was trusted.