PublicDestinationPolicy
class PublicDestinationPolicy implements DestinationPolicy
Constants
| protected DISALLOWED_NETWORKS |
|
Methods
Create a new public destination policy instance.
Resolve and authorize one outbound destination within the given time budget.
Validate a destination URL without resolving it, such as before storing one a user entered.
Return an approved proxy for the destination.
Determine whether a non-public address may be used.
Resolve every address for a hostname.
Resolve one address family within its share of the request budget.
Details
at line 48
__construct(array $allowedNetworks = [])
Create a new public destination policy instance.
at line 60
ResolvedDestination
resolve(string $url, float $timeoutSeconds)
Resolve and authorize one outbound destination within the given time budget.
at line 107
void
validate(string $url)
Validate a destination URL without resolving it, such as before storing one a user entered.
A host given as an address literal is authorized now. A hostname is not resolved, so its addresses are checked when a request resolves them.
at line 125
protected string|null
proxyFor(UriInterface $uri)
Return an approved proxy for the destination.
Applications that require trusted egress proxies may extend this policy and select an absolute URL from a bounded operator-configured set. The policy then vets and pins only the proxy: hostname targets are resolved by the proxy, so it must enforce the same destination rules itself.
at line 136
protected bool
allowsAddress(UriInterface $uri, string $address)
Determine whether a non-public address may be used.
Applications may narrowly allow known internal destinations by extending this policy. Every resolved address must be allowed.
at line 148
protected array
resolveHost(string $host, float $timeoutSeconds)
Resolve every address for a hostname.
at line 185
protected array|false
resolveAddressFamily(string $host, int $family, float $timeoutSeconds)
Resolve one address family within its share of the request budget.