Skip to content

Binary attributes are converted to string when queried by #320

Closed as not planned
@goto1134

Description

@goto1134

I have the following Entity

@Entry(objectClasses = ["top", "person", "user"], base = "ou=users")
class LdapUser {

    @Id
    lateinit var id: Name

    @Attribute(name = "objectGUID", type = Attribute.Type.BINARY, readonly = true)
    lateinit var guid: ByteArray
}

interface LdapUserRepository : Repository<LdapUser, Name> {
    fun findByGuid(guid: ByteArray): AlternativeLdapUser
}

When I search by guid with value 90d1c68e-01be-4485-aafd-b3ffb9ddb026 converted to a 32 element byte array, the library generates the following request:

base=ou=users, finalFilter=(&(&(objectclass=top)(objectclass=person)(objectclass=user))(objectGUID=[B@7363e35b))

And the result is always empty. The correct filter would be:

base=ou=users, finalFilter=(&(&(objectclass=top)(objectclass=person)(objectclass=user))(objectGUID=\90\d1\c6\8e\01\be\44\85\aa\fd\b3\ff\b9\dd\b0\26))

Please, support binary attribute query parameters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions