class AmbariProxiedUserDetailsService implements UserDetailsService {

  boolean validateUser(AmbariTProxyConfiguration tProxyConfiguration, String proxyUserName, String proxiedUserName) {
    String allowedUsers = tProxyConfiguration.getAllowedUsers(proxyUserName);

    if (StringUtils.isNotEmpty(allowedUsers)) {
      String[] userSpecs = allowedUsers.split("\\s*,\\s*");
      for (String userSpec : userSpecs) {
        if ("*".equals(userSpec) || (userSpec.equalsIgnoreCase(proxiedUserName))) {
          return true;
        }
      }
    }

    return false;
  }

    AmbariProxiedUserDetailsService(Configuration configuration, Users users);

}