mirror of
https://github.com/nitnelave/lldap.git
synced 2023-04-12 14:25:13 +00:00
ldap_handler: Reports groups as groupOfNames as well
This commit is contained in:
parent
2197fe77a5
commit
3ac38bb96f
@ -550,8 +550,14 @@ impl<Backend: BackendHandler + LoginHandler + OpaqueHandler> LdapHandler<Backend
|
|||||||
&self.base_dn_str,
|
&self.base_dn_str,
|
||||||
)?;
|
)?;
|
||||||
Ok(GroupRequestFilter::Member(user_name))
|
Ok(GroupRequestFilter::Member(user_name))
|
||||||
} else if field.to_lowercase() == "objectclass" && value == "groupOfUniqueNames" {
|
} else if field.to_lowercase() == "objectclass" {
|
||||||
Ok(GroupRequestFilter::And(vec![]))
|
if value == "groupOfUniqueNames" || value == "groupOfNames" {
|
||||||
|
Ok(GroupRequestFilter::And(vec![]))
|
||||||
|
} else {
|
||||||
|
Ok(GroupRequestFilter::Not(Box::new(GroupRequestFilter::And(
|
||||||
|
vec![],
|
||||||
|
))))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
let field = map_field(field)?;
|
let field = map_field(field)?;
|
||||||
if field == "display_name" {
|
if field == "display_name" {
|
||||||
@ -1116,6 +1122,7 @@ mod tests {
|
|||||||
GroupRequestFilter::DisplayName("group_1".to_string()),
|
GroupRequestFilter::DisplayName("group_1".to_string()),
|
||||||
GroupRequestFilter::Member(UserId::new("bob")),
|
GroupRequestFilter::Member(UserId::new("bob")),
|
||||||
GroupRequestFilter::And(vec![]),
|
GroupRequestFilter::And(vec![]),
|
||||||
|
GroupRequestFilter::And(vec![]),
|
||||||
]))))
|
]))))
|
||||||
.times(1)
|
.times(1)
|
||||||
.return_once(|_| {
|
.return_once(|_| {
|
||||||
@ -1135,6 +1142,7 @@ mod tests {
|
|||||||
"cn=bob,ou=people,dc=example,dc=com".to_string(),
|
"cn=bob,ou=people,dc=example,dc=com".to_string(),
|
||||||
),
|
),
|
||||||
LdapFilter::Equality("objectclass".to_string(), "groupOfUniqueNames".to_string()),
|
LdapFilter::Equality("objectclass".to_string(), "groupOfUniqueNames".to_string()),
|
||||||
|
LdapFilter::Equality("objectclass".to_string(), "groupOfNames".to_string()),
|
||||||
]),
|
]),
|
||||||
vec!["cn"],
|
vec!["cn"],
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user