ldap3.strategy.base module

class ldap3.strategy.base.BaseStrategy(ldap_connection)

Bases: object

Base class for connection strategy

close()

Close connection

static compute_ldap_message_size(data)

Compute LDAP Message size according to BER definite length rules Returns -1 if too few data to compute message length

static decode_control(control)

decode control, return a 2-element tuple where the first element is the control oid and the second element is a dictionary with description (from Oids), criticality and decoded control value

static decode_control_fast(control)

decode control, return a 2-element tuple where the first element is the control oid and the second element is a dictionary with description (from Oids), criticality and decoded control value

static decode_request(message_type, component, controls=None)
decode_response(ldap_message)

Convert received LDAPMessage to a dict

decode_response_fast(ldap_message)

Convert received LDAPMessage from fast ber decoder to a dict

do_operation_on_referral(request, referrals)
do_search_on_auto_range(request, response)
get_response(message_id, timeout=None, get_request=False)

Get response LDAP messages Responses are returned by the underlying connection strategy Check if message_id LDAP message is still outstanding and wait for timeout to see if it appears in _get_response Result is stored in connection.result Responses without result is stored in connection.response A tuple (responses, result) is returned

get_stream()
open(reset_usage=True, read_server_info=True)

Open a socket to a server. Choose a server from the server pool if available

post_send_single_response(message_id)
receiving()
send(message_type, request, controls=None)

Send an LDAP message Returns the message_id

sending(ldap_message)
set_stream(value)
unbind_referral_cache()
valid_referral_list(referrals)