コード例 #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))));
 }