Shun.Provider.verify_ip
verify_ip
, go back to Shun.Provider module for more information.
Specs
verify_ip(address :: Shun.address()) :: result_address()
Provides decision on the IPv4 or IPv6 address.
For each incoming IP Address, or for URIs that have previously been marked as :resolve
and
since have been resolved to IP addresses, the following values are accepted:
:accept
: the IP Address is is accepted for use. No further verification is required. Verification will halt with typed result{:ok, nonempty_list(Shun.address())}
.:reject
: the IP Address is not accepted. No further verification is required. Verification will halt with typed result{:error, :rejected}
.{:dynamic, dynamic_fun}
: the IP Address is to be handed to the function which will return a further result. It is used mostly for scenarios where the whitelist / blacklist is maintained and updated dynamically.{:verify_ip, address}
: the value resolves to an IP Address which needs to be verified again. This can happen when the IP Address has been identified as an IPv6 address wrapping an IPv4 address (as perShun.Preset.IPv6.Embedded
), so the underlying IPv4 address must be verified next.