-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for LDAP paged queries #57
Comments
I guess MaxPageSize is the challenge on Active Directory, because its default is slightly low (1000) and it is enforced by server. If several other directory servers also have the same problem, I think introducing paged search seems useful. |
I was trying to find this link: https://sourcesup.renater.fr/tracker/?aid=7369 but it seems is down. Do you have the code? I need it to find a solution about pagination. |
Hello,
An option (global or per list) would be better. |
That is useless when the LDAP server enforces a limit. It also does not scale well. So supporting paged queries is the way to go IMHO. |
Replacing a standard LDAP query with a paged one is pretty straightforward. This is an excerpt of a Perl script I made to query my Active Directory infrastructure: ...
my $ldap = Net::LDAPS->new( $server, onerror => 'die' ) or die "new: $@";
my @controls = ();
# Creates a control for pages of 100 items
my $ctrl_page = Net::LDAP::Control::Paged->new( size => 100 );
push @controls, $ctrl_page;
my @ldap_args = (
base => $base,
filter => $filter,
attrs => @attributes,
callback => \&processObject,
control => @controls
);
my $cookie;
while (1) {
my $mesg = $ldap->search( @ldap_args );
$mesg->code && die $mesg->error;
if ($mesg->entries < 1) {
print STDERR "NO RESULTS\n";
}
# Retrieves the page control cookie
my($resp) = $mesg->control( LDAP_CONTROL_PAGED ) || last;
$cookie = $resp->cookie || last;
# Sets the cookie for the next search
$ctrl_page->cookie($cookie);
} |
Yes you're right this is the best way. sizelimit is a quick workaround at least for openldap for queries between soft and hard limit, if no size.pr is specified, if I understand well openldap documentation. |
If anyone would like to submit a pull request to make this feature request a reality, it would be appreciated. In my opinion, it is desirable to be able to use the paged operation transparently from the my $db = Sympa::Database->new('LDAP', ...);
if ($db->__dbh->root_dse->supported_control(
Net::LDAP::Constant::LDAP_CONTROL_PAGED()
) {
# Process paged search operations.
} else {
# Process simple search operation.
} |
Inclusion from LDAP data sources supports RFC 2696 Paged Results control (#57)
Closed as fixed. |
I'm bringing here an enhancement request regarding LDAP paged queries already filed in this two tickets:
(The bug tracker at renater.fr seems to be restricted to users from French institutions, so I'm not able to contribute)
The rationale behind this request was already documented in those tickets (I'm adding some opinions from my own)
The text was updated successfully, but these errors were encountered: