Directory Studio
  1. Directory Studio
  2. DIRSTUDIO-356

Add a way to get the connection config as an URL

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0
    • Component/s: studio-ldapbrowser
    • Labels:
      None

      Description

      It would be very interesting to be able to get the connection configuration as an URL you can copy and paste so that it makes it easy to share a connection config with omeone else simply by pasting the URL in a mail/IM/whatever.

      For instance,

      LDAP://<connection-name>@<ldap server host>:<port>/security=TLS?bindDN=uid=admin,ou=system?...(other parameters)

      The URL syntax has to be defined, of course

        Activity

        Emmanuel Lecharny created issue -
        Hide
        Stefan Seelmann added a comment -

        I would suggest we use "X-" extensions, as defined in RFC2255, for all the parameters beside host and port.

        The URL would then look like this:
        ldap://host:port/????extensions

        Here are the possible extensions:
        X-CONNECTION-NAME=<conection name> - current date if absent
        X-ENCRYPTION=[none|ldaps|StartTLS] - none if other or absent
        X-AUTH-METHOD=[Anonymous|Simple|DIGEST-MD5|CRAM-MD5] - Simple if other or absent AND X-BIND-USER is present, else Anonymous
        X-BIND-USER=<DN or Username> - none if empty or absent
        X-BIND-PASSWORD=<password> - none if empty or absent
        X-SASL-REALM=<SASL-Realm> - none if empty or absent
        X-BASE-DN=<Base DN> - get from Root DSE if empty or absent
        X-COUNT-LIMIT=<count limit> - 1000 if non-numeric or absent
        X-TIME-LIMIT=<time limit> - 0 if non-numeric or absent
        X-ALIAS-HANDLING=[NEVER|SEARCHING|FINDING|ALWAYS] - ALWAYS if other or absent
        X-REFERRAL-HANDLING=[FOLLOW|IGNORE|MANAGE] - FOLLOW if other of absent

        Thanks to our LdapURL class it should be easy to implement this, URL-encoding of the values is handled by this class.

        Here is an example URL:
        ldap://localhost:10389/????X-BIND-USER=uid=admin%2cou=system,X-CONNECTION-NAME=Apache%20DS,X-BIND-PASSWORD=secret

        RFC2255 includes an extension "bindname", however I would suggest we only use private "X-" extensions for all parameters.

        An open question is if we should add the X-BIND-PASSWORD, when copy/paste the URL?

        Thought?

        Show
        Stefan Seelmann added a comment - I would suggest we use "X-" extensions, as defined in RFC2255, for all the parameters beside host and port. The URL would then look like this: ldap://host:port/????extensions Here are the possible extensions: X-CONNECTION-NAME=<conection name> - current date if absent X-ENCRYPTION= [none|ldaps|StartTLS] - none if other or absent X-AUTH-METHOD= [Anonymous|Simple|DIGEST-MD5|CRAM-MD5] - Simple if other or absent AND X-BIND-USER is present, else Anonymous X-BIND-USER=<DN or Username> - none if empty or absent X-BIND-PASSWORD=<password> - none if empty or absent X-SASL-REALM=<SASL-Realm> - none if empty or absent X-BASE-DN=<Base DN> - get from Root DSE if empty or absent X-COUNT-LIMIT=<count limit> - 1000 if non-numeric or absent X-TIME-LIMIT=<time limit> - 0 if non-numeric or absent X-ALIAS-HANDLING= [NEVER|SEARCHING|FINDING|ALWAYS] - ALWAYS if other or absent X-REFERRAL-HANDLING= [FOLLOW|IGNORE|MANAGE] - FOLLOW if other of absent Thanks to our LdapURL class it should be easy to implement this, URL-encoding of the values is handled by this class. Here is an example URL: ldap://localhost:10389/????X-BIND-USER=uid=admin%2cou=system,X-CONNECTION-NAME=Apache%20DS,X-BIND-PASSWORD=secret RFC2255 includes an extension "bindname", however I would suggest we only use private "X-" extensions for all parameters. An open question is if we should add the X-BIND-PASSWORD, when copy/paste the URL? Thought?
        Hide
        Pierre-Arnaud Marcelot added a comment -

        That's a very good idea to use LDAP URL's "X-" extensions!

        I think the bind password should be added when copy/pasting the URL.

        But it could maybe be interesting to have a specific preference for this behavior.

        Show
        Pierre-Arnaud Marcelot added a comment - That's a very good idea to use LDAP URL's "X-" extensions! I think the bind password should be added when copy/pasting the URL. But it could maybe be interesting to have a specific preference for this behavior.
        Stefan Seelmann made changes -
        Field Original Value New Value
        Assignee Stefan Seelmann [ seelmann ]
        Stefan Seelmann made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Stefan Seelmann added a comment -

        Added a first implementation here:
        http://svn.apache.org/viewvc?rev=688867&view=rev

        I have the following problem, not sure if this must be handled in my code or if there are encoding issues in the LdapURL class or if an LDAP URL doesn't support non-ASCII characters. When my connection name has non-ASCII characters (e.g. Ä alias %C4 (ULR encoded) alias C384 (UTF-8 encoded)) then the extension part of the resulting URL string contains these non-ASCII characters. When parsing this string back to an LdapURL it just contains an '?'. Has anyone an hint how to handle it?

        Here is some test code:

        public void testNonAscii() throws Exception
        {
        String A_uml = new String( new byte[]

        { (byte)0xC3, (byte)0x84 }

        , "UTF-8" );

        LdapURL url1 = new LdapURL();
        url1.setHost( "localhost" );
        url1.setPort( 389 );
        url1.setDn( LdapDN.EMPTY_LDAPDN );
        url1.getExtensions().put( "X-CONNECTION-NAME", A_uml );
        System.out.println(url1.toString());
        System.out.println(url1.getExtensions());

        LdapURL url2 = new LdapURL("ldap://localhost:389/????X-CONNECTION-NAME=" + A_uml);
        System.out.println(url2.toString());
        System.out.println(url2.getExtensions());

        LdapURL url3 = new LdapURL("ldap://localhost:389/????X-CONNECTION-NAME=%C4");
        System.out.println(url3.toString());
        System.out.println(url3.getExtensions());
        }

        Show
        Stefan Seelmann added a comment - Added a first implementation here: http://svn.apache.org/viewvc?rev=688867&view=rev I have the following problem, not sure if this must be handled in my code or if there are encoding issues in the LdapURL class or if an LDAP URL doesn't support non-ASCII characters. When my connection name has non-ASCII characters (e.g. Ä alias %C4 (ULR encoded) alias C384 (UTF-8 encoded)) then the extension part of the resulting URL string contains these non-ASCII characters. When parsing this string back to an LdapURL it just contains an '?'. Has anyone an hint how to handle it? Here is some test code: public void testNonAscii() throws Exception { String A_uml = new String( new byte[] { (byte)0xC3, (byte)0x84 } , "UTF-8" ); LdapURL url1 = new LdapURL(); url1.setHost( "localhost" ); url1.setPort( 389 ); url1.setDn( LdapDN.EMPTY_LDAPDN ); url1.getExtensions().put( "X-CONNECTION-NAME", A_uml ); System.out.println(url1.toString()); System.out.println(url1.getExtensions()); LdapURL url2 = new LdapURL("ldap://localhost:389/????X-CONNECTION-NAME=" + A_uml); System.out.println(url2.toString()); System.out.println(url2.getExtensions()); LdapURL url3 = new LdapURL("ldap://localhost:389/????X-CONNECTION-NAME=%C4"); System.out.println(url3.toString()); System.out.println(url3.getExtensions()); }
        Hide
        Stefan Seelmann added a comment -

        Fixed the URL encoding according to RFC 4516:
        http://svn.apache.org/viewvc?rev=689638&view=rev

        Show
        Stefan Seelmann added a comment - Fixed the URL encoding according to RFC 4516: http://svn.apache.org/viewvc?rev=689638&view=rev
        Stefan Seelmann made changes -
        Resolution Fixed [ 1 ]
        Status In Progress [ 3 ] Resolved [ 5 ]
        Pierre-Arnaud Marcelot made changes -
        Component/s studio-ldapbrowser [ 12311538 ]
        Pierre-Arnaud Marcelot made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        37d 2h 3m 1 Stefan Seelmann 25/Aug/08 17:54
        In Progress In Progress Resolved Resolved
        2d 5h 13m 1 Stefan Seelmann 27/Aug/08 23:08
        Resolved Resolved Closed Closed
        197d 16h 27m 1 Pierre-Arnaud Marcelot 13/Mar/09 14:36

          People

          • Assignee:
            Stefan Seelmann
            Reporter:
            Emmanuel Lecharny
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development