Le 11/07/16 à 12:24, Claude Libois a écrit :
> Hello,
> I'm using ApacheDS as an embedeed server for unit testing in java. It works
> great except except when I'm doing a filter with a wildcard in the middle
> such as (uniqueMember=uid=%u,*,ou=Users,o=XX,dc=XX,dc=be).
> With the reald LDAP it works not with the embedded one.
> Here are my metadata of the unit test:
> *@CreateLdapServer(*
> *        transports =*
> *                {*
> *                        @CreateTransport(protocol = "LDAP")*
> *                }*
> *)*
> *@CreateDS(name = "classDS",*
> *        partitions =*
> *                {*
> *                        @CreatePartition(*
> *                                name = "XX",*
> *                                suffix = "o=XX,dc=XX,dc=be"*
> *                        )*
> *                }*
> *)*
> *@ApplyLdifFiles({*
>
> *        "ldif/XX.ldif"*
> *}*
> *)*
> *@CreateLdapConnectionPool(*
> *        maxActive = 1,*
> *        maxWait = 5000)*
>
> Is there something else to set in the metadata to enable wildcard in the
> middle of a string ?

Not all the AttributeType accept substring filters (filters with a
wildcard). Typicallt, uniqueMember does not have a SUBSTRING Matching
Rule, thus does not accept searches done with a wildcard :

attributetype ( 2.5.4.50 NAME 'uniqueMember'
    DESC 'RFC2256: unique member of a group'
    EQUALITY uniqueMemberMatch
    SYNTAX 1.3.6.1.4.1.1466.115.121.1.34
    USAGE userApplications )

In order to be able to use a '*' in a filter, you need to have the
AttributeType defined with a SUBSTRING mathcing rule, like :

attributetype ( 2.5.4.3 NAME ( 'cn' 'commonName' )
    DESC 'RFC2256: common name(s) for which the entity is known by'
    SUP name
    EQUALITY caseIgnoreMatch
    SUBSTR caseIgnoreSubstringsMatch
    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
    USAGE userApplications )

This is not specific to ApacheDS. Every LDAP server will behave the same.

Reply via email to