예제 #1
0
 public void addSecurityWithAdminConfig() throws Exception {
   addLdapSecurityWith(
       new LdapConfig(new GoCipher()),
       true,
       new PasswordFileConfig(addPasswordFile().getAbsolutePath()),
       new AdminsConfig(new AdminUser(new CaseInsensitiveString("admin1"))));
 }
예제 #2
0
 public void addSecurityWithNonExistantPasswordFile() throws IOException {
   addLdapSecurityWith(
       new LdapConfig(new GoCipher()),
       true,
       new PasswordFileConfig(new File("invalid", "path").getAbsolutePath()),
       new AdminsConfig());
 }
예제 #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());
 }
예제 #4
0
 public File addSecurityWithPasswordFile() throws IOException {
   addLdapSecurityWith(
       new LdapConfig(new GoCipher()),
       true,
       new PasswordFileConfig(addPasswordFile().getAbsolutePath()),
       new AdminsConfig());
   return passwordFile;
 }
예제 #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());
 }
예제 #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))));
 }