PHP Class Neos\Flow\Http\Component\TrustedProxiesComponent

Inheritance: implements Neos\Flow\Http\Component\ComponentInterface
Afficher le fichier Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Свойство Type Description
$settings array

Méthodes publiques

Méthode Description
handle ( ComponentContext $componentContext ) : void

Méthodes protégées

Méthode Description
getFirstTrustedProxyHeaderValue ( string $type, Request $request ) : mixed | null Convenience getter for the first value of a given trusted proxy header.
getTrustedClientIpAddress ( Request $request ) : string | boolean Get the most trusted client's IP address.
getTrustedProxyHeaderValues ( string $type, Request $request ) : Iterator Get the values of trusted proxy header.
ipIsTrustedProxy ( string $ipAddress ) : boolean Check if the given IP address is from a trusted proxy.
isFromTrustedProxy ( Request $request ) : boolean Check if the given request is from a trusted proxy.

Method Details

getFirstTrustedProxyHeaderValue() protected méthode

Convenience getter for the first value of a given trusted proxy header.
protected getFirstTrustedProxyHeaderValue ( string $type, Request $request ) : mixed | null
$type string One of the HEADER_* constants
$request Neos\Flow\Http\Request The request to get the trusted proxy header from
Résultat mixed | null The first value of this header type or NULL if this header type should not be trusted

getTrustedClientIpAddress() protected méthode

This is the right-most address in the trusted client IP header, that is not a trusted proxy address. If all proxies are trusted, this is the left-most address in the header. If no proxies are trusted or no client IP header is trusted, this is the remote address of the machine directly connected to the server.
protected getTrustedClientIpAddress ( Request $request ) : string | boolean
$request Neos\Flow\Http\Request
Résultat string | boolean The most trusted client's IP address or FALSE if no remote address can be found

getTrustedProxyHeaderValues() protected méthode

Get the values of trusted proxy header.
protected getTrustedProxyHeaderValues ( string $type, Request $request ) : Iterator
$type string One of the HEADER_* constants
$request Neos\Flow\Http\Request The request to get the trusted proxy header from
Résultat Iterator An array of the values for this header type or NULL if this header type should not be trusted

handle() public méthode

public handle ( ComponentContext $componentContext ) : void
$componentContext ComponentContext
Résultat void

ipIsTrustedProxy() protected méthode

Check if the given IP address is from a trusted proxy.
protected ipIsTrustedProxy ( string $ipAddress ) : boolean
$ipAddress string
Résultat boolean

isFromTrustedProxy() protected méthode

Check if the given request is from a trusted proxy.
protected isFromTrustedProxy ( Request $request ) : boolean
$request Neos\Flow\Http\Request
Résultat boolean If the server REMOTE_ADDR is from a trusted proxy

Property Details

$settings protected_oe property

protected array $settings
Résultat array