boolean validateHost(AmbariTProxyConfiguration tProxyConfiguration, String proxyUserName, String remoteAddress) {
    String allowedHosts = tProxyConfiguration.getAllowedHosts(proxyUserName);

    if (StringUtils.isNotEmpty(allowedHosts)) {
      Set<String> hostSpecs = Arrays.stream(allowedHosts.split("\\s*,\\s*"))
          .map(s -> s.trim().toLowerCase())
          .collect(toSet());

      if (hostSpecs.contains("*")) {
        return true;
      } else {
        for (String hostSpec : hostSpecs) {
          if (isIPAddress(hostSpec)) {
            if (hostSpec.equals(remoteAddress)) {
              return true;
            }
          } else if (isIPAddressRange(hostSpec)) {
            if (isInIpAddressRange(hostSpec, remoteAddress)) {
              return true;
            }
          } else if (matchesHostname(hostSpec, remoteAddress)) {
            return true;
          }
        }
      }
    }

    return false;
  }
Constructor.
<p>
Given the Ambari {@link Configuration}, initializes the {@link KerberosName} class using
the <code>auth-to-local</code> rules from {@link AmbariKerberosAuthenticationProperties#getAuthToLocalRules()}.

@param configuration the Ambari configuration data
@param users         the Ambari users access object
ambari-server/src/main/java/org/apache/ambari/server/security/authentication/kerberos/AmbariProxiedUserDetailsService.java