Example #1
0
 public void addSecurityWithAdminConfig() throws Exception {
   addLdapSecurityWith(
       new LdapConfig(new GoCipher()),
       true,
       new PasswordFileConfig(addPasswordFile().getAbsolutePath()),
       new AdminsConfig(new AdminUser(new CaseInsensitiveString("admin1"))));
 }
Example #2
0
 public void addSecurityWithNonExistantPasswordFile() throws IOException {
   addLdapSecurityWith(
       new LdapConfig(new GoCipher()),
       true,
       new PasswordFileConfig(new File("invalid", "path").getAbsolutePath()),
       new AdminsConfig());
 }
Example #3
0
 public void addSecurityWithBogusLdapConfig(boolean anonymous) {
   addLdapSecurityWith(
       new LdapConfig("uri", "dn", "pw", null, true, new BasesConfig(new BaseConfig("sb")), "sf"),
       anonymous,
       new PasswordFileConfig(),
       new AdminsConfig());
 }
Example #4
0
 public File addSecurityWithPasswordFile() throws IOException {
   addLdapSecurityWith(
       new LdapConfig(new GoCipher()),
       true,
       new PasswordFileConfig(addPasswordFile().getAbsolutePath()),
       new AdminsConfig());
   return passwordFile;
 }
Example #5
0
 public void addLdapSecurity(
     String uri,
     String managerDn,
     String managerPassword,
     String searchBase,
     String searchFilter) {
   LdapConfig ldapConfig =
       new LdapConfig(
           uri,
           managerDn,
           managerPassword,
           null,
           true,
           new BasesConfig(new BaseConfig(searchBase)),
           searchFilter);
   addLdapSecurityWith(ldapConfig, true, new PasswordFileConfig(), new AdminsConfig());
 }
Example #6
0
 public void addLdapSecurityWithAdmin(
     String uri,
     String managerDn,
     String managerPassword,
     String searchBase,
     String searchFilter,
     String adminUser) {
   LdapConfig ldapConfig =
       new LdapConfig(
           uri,
           managerDn,
           managerPassword,
           null,
           true,
           new BasesConfig(new BaseConfig(searchBase)),
           searchFilter);
   addLdapSecurityWith(
       ldapConfig,
       true,
       new PasswordFileConfig(),
       new AdminsConfig(new AdminUser(new CaseInsensitiveString(adminUser))));
 }