rust-ldap
rust-ldap copied to clipboard
Use of filters in search
Currently this code exists:
// connection.rs
pub fn search(&mut self,
base: String,
scope: Scope,
alias: DerefAlias,
size_limit: i32,
time_limit: i32,
types_only: bool,
filters: Tag, // TODO: Figure something out...
attributes: Vec<String>
) -> LDAPResult<Vec<Entry>>
{
It looks like there is a whole layer (or more) of extraction missing for filters. In lieu of that, I have no idea how to do basic searches e.g. cn=whatever. I tried something like this, but honestly I'm pretty lost.. :)
let filters = {
let payload = Payload::Primitive(Vec::from("(cn=whatever)".as_bytes()));
Tag::new(Class::Universal(Type::GeneralString), payload)
};
Is this something that can be done with the library as it stands today? I don't have very complicated requirements, so a workaround would be fine..