Examples of LdapDN


Examples of org.apache.directory.shared.ldap.name.LdapDN

            schemaRoot.modifyAttributes( "cn=Krb5kdc", mods );
        }

        // create referral entry
        ServerEntry entry = new DefaultServerEntry( ldapServer.getDirectoryService().getRegistries() );
        entry.setDn( new LdapDN( "cn=referral,ou=system" ) );
        entry.add( "objectClass", "top", "referral", "extensibleObject" );
        entry.add( "cn", "referralDialogTest" );
        entry.add( "ref", "ldap://localhost:" + ldapServer.getPort() + "/ou=users,ou=system" );
        ldapServer.getDirectoryService().getAdminSession().add( entry );
View Full Code Here

Examples of org.apache.directory.shared.ldap.name.LdapDN

    {
        // create a bookmark
        IBrowserConnection browserConnection = BrowserCorePlugin.getDefault().getConnectionManager()
            .getBrowserConnection( connection );
        browserConnection.getBookmarkManager().addBookmark(
            new Bookmark( browserConnection, new LdapDN( "uid=user.1,ou=users,ou=system" ), "Existing Bookmark" ) );

        // select the bookmark
        browserViewBot.selectEntry( "Bookmarks", "Existing Bookmark" );

        // check that entry editor was opened and attributes are visible
View Full Code Here

Examples of org.apache.directory.shared.ldap.name.LdapDN

        browserViewBot.expandEntry( "DIT", "Root DSE", "ou=system", "ou=users" );
        assertFalse( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=refresh" ) );

        // add the entry directly in the server
        ServerEntry entry = new DefaultServerEntry( ldapServer.getDirectoryService().getRegistries() );
        entry.setDn( new LdapDN( "cn=refresh,ou=users,ou=system" ) );
        entry.add( "objectClass", "top", "person" );
        entry.add( "cn", "refresh" );
        entry.add( "sn", "refresh" );
        ldapServer.getDirectoryService().getAdminSession().add( entry );

        // check the entry still isn't visible in the tree
        assertFalse( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=refresh" ) );

        // refresh parent
        browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users" );
        browserViewBot.refresh();

        // check the entry exists now
        browserViewBot.expandEntry( "DIT", "Root DSE", "ou=system", "ou=users" );
        assertTrue( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=refresh" ) );
        browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=refresh" );

        // delete the entry directly in the server
        ldapServer.getDirectoryService().getAdminSession().delete( new LdapDN( "cn=refresh,ou=users,ou=system" ) );

        // check the entry still is now visible in the tree
        assertTrue( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=refresh" ) );

        // refresh parent
View Full Code Here

Examples of org.apache.directory.shared.ldap.name.LdapDN

        browserViewBot.expandEntry( "DIT", "Root DSE", "ou=system", "ou=users" );
        assertFalse( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=refresh" ) );

        // add the entry directly in the server
        ServerEntry entry = new DefaultServerEntry( ldapServer.getDirectoryService().getRegistries() );
        entry.setDn( new LdapDN( "cn=refresh,ou=users,ou=system" ) );
        entry.add( "objectClass", "top", "person" );
        entry.add( "cn", "refresh" );
        entry.add( "sn", "refresh" );
        ldapServer.getDirectoryService().getAdminSession().add( entry );

        // check the entry still isn't visible in the tree
        assertFalse( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=refresh" ) );

        // refresh context entry
        browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system" );
        browserViewBot.refresh();

        // check the entry exists now
        browserViewBot.expandEntry( "DIT", "Root DSE", "ou=system", "ou=users" );
        assertTrue( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=refresh" ) );
        browserViewBot.selectEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=refresh" );

        // delete the entry directly in the server
        ldapServer.getDirectoryService().getAdminSession().delete( new LdapDN( "cn=refresh,ou=users,ou=system" ) );

        // check the entry still is now visible in the tree
        assertTrue( browserViewBot.existsEntry( "DIT", "Root DSE", "ou=system", "ou=users", "cn=refresh" ) );

        // refresh context entry
View Full Code Here

Examples of org.platformlayer.ops.ldap.LdapDN

  }

  public static LdapSchemaEntry build(String schemaName) {
    LdapSchemaEntry ldapSchemaEntry = OpsContext.get().getOpsSystem().getInjector()
        .getInstance(LdapSchemaEntry.class);
    LdapDN ldapDN = OpenLdapServer.CONFIG_DN.childDN(LdapAttributes.LDAP_ATTRIBUTE_CN, schemaName);
    ldapSchemaEntry.setLdapDN(ldapDN);
    ldapSchemaEntry.setSchemaFile(schemaName + ".schema");
    ldapSchemaEntry.setOnlyConfigureOnForce(true);
    return ldapSchemaEntry;
  }
View Full Code Here

Examples of org.platformlayer.ops.ldap.LdapDN

  LdapDomain ldapDomain;

  LdapDomain getLdapDomain() throws OpsException {
    if (ldapDomain == null) {
      GitService model = OpsContext.get().getInstance(GitService.class);
      LdapDN ldapGroup = LdapDN.parseLdifEncoded(model.ldapGroup);

      LdapDomain best = null;
      for (LdapDomain candidate : platformLayer.listItems(LdapDomain.class)) {
        switch (candidate.getState()) {
        case DELETE_REQUESTED:
        case DELETED:
          continue;
        }

        LdapDN organizationName = LdapDN.fromDomainName(candidate.organizationName);

        if (!organizationName.isParentOf(ldapGroup)) {
          log.info("LdapDomain does not match: " + organizationName + " vs " + ldapGroup);
          continue;
        }

        log.info("Found matching LdapDomain: " + organizationName + " vs " + ldapGroup);
View Full Code Here

Examples of org.platformlayer.ops.ldap.LdapDN

  @Override
  public void buildTemplateModel(Map<String, Object> model) throws OpsException {
    LdapDomain ldapDomain = getLdapDomain();
    LdapService ldapService = getLdapService();

    LdapDN organizationDN = LdapDN.fromDomainName(ldapDomain.organizationName);
    LdapDN allUsersDN = organizationDN.childDN("ou", "Users");
    LdapDN managerDN = organizationDN.childDN("cn", "Manager");
    LdapDN groupsDN = organizationDN.childDN("ou", "Groups");
    LdapDN gitUsersDN = groupsDN.childDN("cn", "Git");

    // String authLdapUrl = "ldap://192.168.192.67:389/ou=Users,dc=com,dc=fathomscale?uid";
    // String authLDAPBindDN = "cn=Manager,dc=com,dc=fathomscale";
    // String authLDAPBindPassword = "adminsecret";
    // String requireLdapGroup = "cn=Git,ou=Groups,dc=com,dc=fathomscale";

    int port = 389;
    List<EndpointInfo> endpoints = EndpointInfo.findEndpoints(ldapService.getTags(), port);

    EndpointInfo ldapEndpoint = EndpointChooser.preferIpv4().choose(endpoints);

    if (ldapEndpoint == null) {
      throw new OpsException("Cannot find suitable LDAP endpoint");
    }

    // TODO: Maybe we should just reference an LdapGroup

    // TODO: It sucks that we're logging in here as the Manager account

    // LdapGroup -> LdapDomain -> LdapService

    String authLdapUrl = "ldap://" + ldapEndpoint.publicIp + ":389/" + allUsersDN.toLdifEncoded() + "?uid";
    String authLDAPBindDN = managerDN.toLdifEncoded();
    String authLDAPBindPassword = ldapDomain.adminPassword.plaintext();
    String requireLdapGroup = gitUsersDN.toLdifEncoded();

    model.put("AuthLDAPURL", authLdapUrl);
    model.put("AuthLDAPBindDN", authLDAPBindDN);
    model.put("AuthLDAPBindPassword", authLDAPBindPassword);
    model.put("requireLdapGroup", requireLdapGroup);
View Full Code Here

Examples of org.platformlayer.ops.ldap.LdapDN

  @Override
  protected void addChildren() throws OpsException {
    LdapDomain ldapDomain = OpsContext.get().getInstance(LdapDomain.class);
    String hostName = ldapDomain.organizationName;

    LdapDN ldapBase = LdapServerUtilities.createBaseDN(hostName);

    File dataRoot = new File("/var/ldap/data");
    File dataDir = new File(dataRoot, hostName);

    String ldapBaseOrganization = hostName;
View Full Code Here

Examples of org.platformlayer.ops.ldap.LdapDN

  }

  private HdbDatabaseEntry buildDatabase(LdapDN ldapBase, File dataDir, String dbName) {
    HdbDatabaseEntry database = Injection.getInstance(HdbDatabaseEntry.class);

    database.setLdapDN(new LdapDN(LdapAttributes.LDAP_ATTRIBUTE_CN, "config").childDN("olcDatabase", "hdb"));
    database.setLdapRoot(ldapBase);
    database.setDataDirectory(dataDir);
    database.setDbName(dbName);

    database.setOnlyConfigureOnForce(true);
View Full Code Here

Examples of org.platformlayer.ops.ldap.LdapDN

        // Ignore
        continue;
      }

      if (key.equals("dn")) {
        LdapDN ldapDN = LdapDN.parseLdifEncoded(value);
        current = new LdifRecord(ldapDN);
        records.add(current);
        continue;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.