/*
Authors:
Pavel Březina <pbrezina@redhat.com>
Copyright (C) 2016 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _CACHE_REQ_PLUGIN_H_
#define _CACHE_REQ_PLUGIN_H_
#include "responder/common/cache_req/cache_req_private.h"
enum cache_object_status {
};
/**
* Create an object debug name that is used in debug messages to identify
* this object.
*
* @return EOK If everything went fine.
* @return Other errno code in case of an error.
*/
typedef errno_t
struct cache_req_data *data,
struct sss_domain_info *domain);
/**
* Create an object debug name that is used in debug messages to identify
* this object.
*
* @return Debug name or NULL in case of an error.
**/
typedef const char *
struct cache_req_data *data,
struct sss_domain_info *domain);
/**
* Check if an object is stored in negative cache.
*
* @return EOK If the object is not found.
* @return EEXIST If the object is found in negative cache.
* @return Other errno code in case of an error.
*/
typedef errno_t
struct sss_domain_info *domain,
struct cache_req_data *data);
/**
* Add an object into negative cache.
*
* @return EOK If everything went fine.
* @return Other errno code in case of an error.
*/
typedef errno_t
struct sss_domain_info *domain,
struct cache_req_data *data);
/**
* Add an object into global negative cache.
*
* @return EOK If everything went fine.
* @return Other errno code in case of an error.
*/
typedef errno_t
struct cache_req_data *data);
/**
* Lookup object in sysdb.
*
* @return EOK If the object is found.
* @return ENOENT If the object is not found.
* @return Other errno code in case of an error.
*/
typedef errno_t
struct cache_req_data *data,
struct sss_domain_info *domain,
struct ldb_result **_result);
/**
* Return parameters for Data Provider request.
*
* @return EOK If everything went fine.
* @return Other errno code in case of an error.
*/
typedef errno_t
struct ldb_result *result,
const char **_string,
const char **_flag);
struct cache_req_plugin {
/**
* Plugin name.
*/
const char *name;
/**
* Data provider request type.
*/
/**
* Expiration timestamp attribute name.
*/
const char *attr_expiration;
/**
* Flags that are passed to get_next_domain().
*/
/**
* True if input name should be parsed for domain.
*/
bool parse_name;
/**
* True if we always contact data provider.
*/
bool bypass_cache;
/**
* True if only one result is expected.
*/
bool only_one_result;
/**
* Allow missing domain part even if domain requires fully qualified name
* on domain less searches.
*/
bool allow_missing_fqn;
/**
* True if this plugin can be swapped for equivalent search with UPN.
*/
bool allow_switch_to_upn;
/* Operations */
};
extern struct cache_req_plugin cache_req_user_by_name;
extern struct cache_req_plugin cache_req_user_by_upn;
extern struct cache_req_plugin cache_req_user_by_id;
extern struct cache_req_plugin cache_req_group_by_name;
extern struct cache_req_plugin cache_req_group_by_id;
extern struct cache_req_plugin cache_req_initgroups_by_name;
extern struct cache_req_plugin cache_req_initgroups_by_upn;
extern struct cache_req_plugin cache_req_user_by_cert;
extern struct cache_req_plugin cache_req_user_by_filter;
extern struct cache_req_plugin cache_req_group_by_filter;
extern struct cache_req_plugin cache_req_object_by_sid;
#endif /* _CACHE_REQ_PLUGIN_H_ */