Visitar URL original
doc: describe OPT_SERVER_CONTROLS and OPT_CLIENT_CONTROLS · droideck/python-ldap@8f00f75 · GitHub
Skip to content

Commit 8f00f75

Browse files
committed
doc: describe OPT_SERVER_CONTROLS and OPT_CLIENT_CONTROLS
Both entries were empty. Say that they hold request controls attached to every operation, how the two set_option() variants take them, and that response controls come back from result3()/result4() instead. Point to the 4.0 issue for get_option(). Related: python-ldap#643
1 parent 0ff5616 commit 8f00f75

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎Doc/reference/ldap.rst‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,16 @@ the following option identifiers are defined as constants:
180180
181181
.. py:data:: OPT_CLIENT_CONTROLS
182182
183+
Client-side request controls that libldap attaches to every operation
184+
on the connection. :py:meth:`LDAPObject.set_option` takes a list of
185+
:py:class:`ldap.controls.RequestControl` instances, the module-level
186+
:py:func:`set_option` takes the encoded 3-tuples. Response controls
187+
never show up here, they are returned by :py:meth:`LDAPObject.result3`
188+
and :py:meth:`LDAPObject.result4`. :py:meth:`LDAPObject.get_option`
189+
decodes the stored controls with the response control classes, which
190+
only works for controls whose request and response values share a
191+
schema, see https://github.com/python-ldap/python-ldap/issues/643.
192+
183193
.. py:data:: OPT_DEBUG_LEVEL
184194
185195
Sets the debug level within the underlying OpenLDAP C lib (libldap).
@@ -220,6 +230,13 @@ the following option identifiers are defined as constants:
220230
221231
.. py:data:: OPT_SERVER_CONTROLS
222232
233+
Server-side request controls that libldap attaches to every operation
234+
on the connection, for example
235+
:py:class:`ldap.controls.sessiontrack.SessionTrackingControl`.
236+
Same rules as :py:data:`OPT_CLIENT_CONTROLS`. Controls meant for a
237+
single operation belong in the ``serverctrls`` argument of that
238+
operation instead.
239+
223240
.. py:data:: OPT_SIZELIMIT
224241
225242
.. py:data:: OPT_SUCCESS

0 commit comments

Comments
 (0)