RemoteFileDestinationPolicy
class RemoteFileDestinationPolicy extends PublicDestinationPolicy
Constants
| protected DISALLOWED_NETWORKS |
|
Methods
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 a hostname using the configured resolver or the system resolver.
Resolve one address family within its share of the request budget.
Details
at line 17
__construct(Closure|null $resolver = null)
Create a destination policy for a remote file download.
in
PublicDestinationPolicy at line 60
ResolvedDestination
resolve(string $url, float $timeoutSeconds)
Resolve and authorize one outbound destination within the given time budget.
in
PublicDestinationPolicy 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.
in
PublicDestinationPolicy 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.
in
PublicDestinationPolicy 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 28
protected array
resolveHost(string $host, float $timeoutSeconds)
Resolve a hostname using the configured resolver or the system resolver.
in
PublicDestinationPolicy at line 185
protected array|false
resolveAddressFamily(string $host, int $family, float $timeoutSeconds)
Resolve one address family within its share of the request budget.