src/server/safs/ldap.h

Sun, 12 Mar 2023 11:29:02 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 12 Mar 2023 11:29:02 +0100
changeset 465
d22ff46c171c
parent 464
0a29110b94ec
permissions
-rw-r--r--

rename ldap-query to ldap-search, rename query parameter to filter

/*
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 *
 * Copyright 2023 Olaf Wintermann. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   1. Redistributions of source code must retain the above copyright
 *      notice, this list of conditions and the following disclaimer.
 *
 *   2. Redistributions in binary form must reproduce the above copyright
 *      notice, this list of conditions and the following disclaimer in the
 *      documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef WS_SAFS_LDAP_H
#define WS_SAFS_LDAP_H

#include "../public/nsapi.h"

#include "../daemon/ldap_resource.h"

#ifdef __cplusplus
extern "C" {
#endif

#define WS_SAFS_LDAP_DEFAULT_SCOPE LDAP_SCOPE_SUBTREE
#define WS_SAFS_LDAP_DEFAULT_TIMEOUT 30
#define WS_SAFS_LDAP_DEFAULT_SIZELIMIT 1000
    
#define WS_SAFS_LDAP_MAX_TIMEOUT 32767
    
#define WS_SAFS_LDAP_EMPTY_FILTER_ERROR  404
#define WS_SAFS_LDAP_EMPTY_RESULT_ERROR 404
    
/*
 * ldap-search
 * 
 * Sends an ldap search result as ldif to the client. If no filter parameter is
 * specified, the SAFs tries to use the "ldap_filter" parameter from rq->vars.
 * 
 * required parameters:
 *  resource    name of the ldap resource pool
 *  basedn      ldap basedn
 * 
 * optional parameters:
 *  binddn              bind ldap session to binddn
 *  bindpw              binddn password
 *  filter              ldap search filter
 *  scope               search scope: base, onelevel, subtree, children
 *  timeout             timeout in seconds                       default: 30
 *  sizelimit           maximum number of result entries         defazkt: 1000
 *  empty_filter_error  status code if the filter is empty/null  default: 404
 *  empty_result_error  status code if the result is empty       default: 404  
 * 
 * If the query or result is empty and the status code is 2xx, an empty
 * response is sent to the client.
 */
int service_ldap_search(pblock *pb, Session *sn, Request *rq);


#ifdef __cplusplus
}
#endif

#endif /* WS_SAFS_LDAP_H */

mercurial