public void customize()

in phoenix-queryserver/src/main/java/org/apache/phoenix/queryserver/server/customizers/BasicAuthenticationServerCustomizer.java [58:85]


  public void customize(Server server) {
      LOG.debug("Customizing server to allow requests for {}", USER_AUTHORIZED);

      UserStore store = new UserStore();
      store.addUser(USER_AUTHORIZED, Credential.getCredential(USER_PW), new String[] {"users"});
      HashLoginService login = new HashLoginService();
      login.setName("users");
      login.setUserStore(store);

      Constraint constraint = new Constraint();
      constraint.setName(Constraint.__BASIC_AUTH);
      constraint.setRoles(new String[]{"users"});
      constraint.setAuthenticate(true);

      ConstraintMapping cm = new ConstraintMapping();
      cm.setConstraint(constraint);
      cm.setPathSpec("/*");

      ConstraintSecurityHandler security = new ConstraintSecurityHandler();
      security.setAuthenticator(new BasicAuthenticator());
      security.setRealmName("users");
      security.addConstraintMapping(cm);
      security.setLoginService(login);

      // chain the PQS handler to security
      security.setHandler(server.getHandlers()[0]);
      server.setHandler(security);
  }