Package com.cloudera.lib.service

Examples of com.cloudera.lib.service.ProxyUser


   * the doAs-user.
   */
  private String getEffectiveUser(Principal user, String doAs) throws IOException {
    String effectiveUser = user.getName();
    if (doAs != null && !doAs.equals(user.getName())) {
      ProxyUser proxyUser = HoopServer.get().get(ProxyUser.class);
      proxyUser.validate(user.getName(), HostnameFilter.get(), doAs);
      effectiveUser = doAs;
      AUDIT_LOG.info("Proxy user [{}] DoAs user [{}]", user.getName(), doAs);
    }
    return effectiveUser;
  }
View Full Code Here


    XConfiguration conf = new XConfiguration();
    conf.set("server.services", StringUtils.toString(Arrays.asList(GroupsService.class.getName(),
                                                                   ProxyUserService.class.getName()), ","));
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ProxyUser proxyUser = server.get(ProxyUser.class);
    Assert.assertNotNull(proxyUser);
    server.destroy();
  }
View Full Code Here

                                                                   ProxyUserService.class.getName()), ","));
    conf.set("server.proxyuser.foo.hosts", "*");
    conf.set("server.proxyuser.foo.groups", "*");
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ProxyUser proxyUser = server.get(ProxyUser.class);
    Assert.assertNotNull(proxyUser);
    proxyUser.validate("foo", "localhost", "bar");
    server.destroy();
  }
View Full Code Here

                                                                   ProxyUserService.class.getName()), ","));
    conf.set("server.proxyuser.foo.hosts", "*");
    conf.set("server.proxyuser.foo.groups", "*");
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ProxyUser proxyUser = server.get(ProxyUser.class);
    Assert.assertNotNull(proxyUser);
    proxyUser.validate("bar", "localhost", "foo");
    server.destroy();
  }
View Full Code Here

                                                                   ProxyUserService.class.getName()), ","));
    conf.set("server.proxyuser.foo.hosts", "localhost");
    conf.set("server.proxyuser.foo.groups", "*");
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ProxyUser proxyUser = server.get(ProxyUser.class);
    Assert.assertNotNull(proxyUser);
    proxyUser.validate("foo", "localhost", "bar");
    server.destroy();
  }
View Full Code Here

                                                                   ProxyUserService.class.getName()), ","));
    conf.set("server.proxyuser.foo.hosts", "*");
    conf.set("server.proxyuser.foo.groups", getGroup());
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ProxyUser proxyUser = server.get(ProxyUser.class);
    Assert.assertNotNull(proxyUser);
    proxyUser.validate("foo", "localhost", System.getProperty("user.name"));
    server.destroy();
  }
View Full Code Here

                                                                   ProxyUserService.class.getName()), ","));
    conf.set("server.proxyuser.foo.hosts", "localhost");
    conf.set("server.proxyuser.foo.groups", "*");
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ProxyUser proxyUser = server.get(ProxyUser.class);
    Assert.assertNotNull(proxyUser);
    proxyUser.validate("foo", "unknownhost.bar.foo", "bar");
    server.destroy();
  }
View Full Code Here

                                                                   ProxyUserService.class.getName()), ","));
    conf.set("server.proxyuser.foo.hosts", "localhost");
    conf.set("server.proxyuser.foo.groups", "*");
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ProxyUser proxyUser = server.get(ProxyUser.class);
    Assert.assertNotNull(proxyUser);
    proxyUser.validate("foo", "www.yahoo.com", "bar");
    server.destroy();
  }
View Full Code Here

                                                                   ProxyUserService.class.getName()), ","));
    conf.set("server.proxyuser.foo.hosts", "localhost");
    conf.set("server.proxyuser.foo.groups", "nobody");
    Server server = new Server("server", dir, dir, dir, dir, conf);
    server.init();
    ProxyUser proxyUser = server.get(ProxyUser.class);
    Assert.assertNotNull(proxyUser);
    proxyUser.validate("foo", "localhost", System.getProperty("user.name"));
    server.destroy();
  }
View Full Code Here

TOP

Related Classes of com.cloudera.lib.service.ProxyUser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.