diff options
author | molotkov-and <molotkov-and@ydb.tech> | 2023-08-18 17:20:47 +0300 |
---|---|---|
committer | molotkov-and <molotkov-and@ydb.tech> | 2023-08-18 19:42:07 +0300 |
commit | 73215359bc33e76f5b94d1832a377072bf245cfc (patch) | |
tree | 9cb8ad61d8c3cd107353d42951560ff3cf1b966d /contrib/libs/openldap/include/ldap_rq.h | |
parent | 1cbfd34a55732f7b1d407986b45e40853f01f2c2 (diff) | |
download | ydb-73215359bc33e76f5b94d1832a377072bf245cfc.tar.gz |
KIKIMR-18220: Enrich token with groups from LDAP
Add ldap functions wrapper and separate in different files for compatibility with different OS.
Add user groups fetching from ldap server.
Limitations:
- Fixed 'memberOf' attribute
- No tests to check how filter for search created
- Fetched groups are returned in event as is.
Diffstat (limited to 'contrib/libs/openldap/include/ldap_rq.h')
-rw-r--r-- | contrib/libs/openldap/include/ldap_rq.h | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/contrib/libs/openldap/include/ldap_rq.h b/contrib/libs/openldap/include/ldap_rq.h new file mode 100644 index 0000000000..1050550ba8 --- /dev/null +++ b/contrib/libs/openldap/include/ldap_rq.h @@ -0,0 +1,102 @@ +/* $OpenLDAP$ */ +/* This work is part of OpenLDAP Software <http://www.openldap.org/>. + * + * Copyright 1998-2022 The OpenLDAP Foundation. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * <http://www.OpenLDAP.org/license.html>. + */ + +#ifndef LDAP_RQ_H +#define LDAP_RQ_H 1 + +#include <ldap_cdefs.h> + +LDAP_BEGIN_DECL + +typedef struct re_s { + struct timeval next_sched; + struct timeval interval; + LDAP_STAILQ_ENTRY(re_s) tnext; /* it includes running */ + LDAP_STAILQ_ENTRY(re_s) rnext; + ldap_pvt_thread_start_t *routine; + void *arg; + char *tname; + char *tspec; + void *pool_cookie; +} re_t; + +typedef struct runqueue_s { + LDAP_STAILQ_HEAD(l, re_s) task_list; + LDAP_STAILQ_HEAD(rl, re_s) run_list; + ldap_pvt_thread_mutex_t rq_mutex; +} runqueue_t; + +LDAP_F( struct re_s* ) +ldap_pvt_runqueue_insert( + struct runqueue_s* rq, + time_t interval, + ldap_pvt_thread_start_t* routine, + void *arg, + char *tname, + char *tspec +); + +LDAP_F( struct re_s* ) +ldap_pvt_runqueue_find( + struct runqueue_s* rq, + ldap_pvt_thread_start_t* routine, + void *arg +); + +LDAP_F( void ) +ldap_pvt_runqueue_remove( + struct runqueue_s* rq, + struct re_s* entry +); + +LDAP_F( struct re_s* ) +ldap_pvt_runqueue_next_sched( + struct runqueue_s* rq, + struct timeval* next_run +); + +LDAP_F( void ) +ldap_pvt_runqueue_runtask( + struct runqueue_s* rq, + struct re_s* entry +); + +LDAP_F( void ) +ldap_pvt_runqueue_stoptask( + struct runqueue_s* rq, + struct re_s* entry +); + +LDAP_F( int ) +ldap_pvt_runqueue_isrunning( + struct runqueue_s* rq, + struct re_s* entry +); + +LDAP_F( void ) +ldap_pvt_runqueue_resched( + struct runqueue_s* rq, + struct re_s* entry, + int defer +); + +LDAP_F( int ) +ldap_pvt_runqueue_persistent_backload( + struct runqueue_s* rq +); + +LDAP_END_DECL + +#endif |