Sha256: d4f02be91e02348fd1e8ce51085de38e1bbbc0ad92a403fe5054e7b42ce793c9
Contents?: true
Size: 749 Bytes
Versions: 49
Compression:
Stored size: 749 Bytes
Contents
# frozen_string_literal: true module Truemail module Audit class Ip < Truemail::Audit::Base GET_MY_IP_URL = 'https://api.ipify.org' IPIFY_ERROR = 'impossible to detect current host address via third party service' def run return add_warning(Truemail::Audit::Ip::IPIFY_ERROR) unless detect_current_host_ip Truemail::Audit::Dns.check(result) Truemail::Audit::Ptr.check(result) end private def detect_ip_via_ipify ::Net::HTTP.get(URI(Truemail::Audit::Ip::GET_MY_IP_URL)) end def detect_current_host_ip result.current_host_ip = Truemail::Wrapper.call(configuration: configuration) do detect_ip_via_ipify end end end end end
Version data entries
49 entries across 49 versions & 1 rubygems