ldap3.core.server module

class ldap3.core.server.Server(host, port=None, use_ssl=False, allowed_referral_hosts=None, get_info='SCHEMA', tls=None, formatter=None, connect_timeout=None, mode='IP_V6_PREFERRED')

Bases: object

LDAP Server definition class

Allowed_referral_hosts can be None (default), or a list of tuples of allowed servers ip address or names to contact while redirecting search to referrals.

The second element of the tuple is a boolean to indicate if authentication to that server is allowed; if False only anonymous bind will be used.

Per RFC 4516. Use [(‘*’, False)] to allow any host with anonymous bind, use [(‘*’, True)] to allow any host with same authentication of Server.

address_info
attach_dsa_info(dsa_info=None)
attach_schema_info(dsa_schema=None)
candidate_addresses()
check_availability()

Tries to open, connect and close a socket to specified address and port to check availability. Timeout in seconds is specified in CHECK_AVAILABITY_TIMEOUT if not specified in the Server object

static from_definition(host, dsa_info, dsa_schema, port=None, use_ssl=False, formatter=None)

Define a dummy server with preloaded schema and info :param host: host name :param dsa_info: DsaInfo preloaded object or a json formatted string or a file name :param dsa_schema: SchemaInfo preloaded object or a json formatted string or a file name :param port: dummy port :param use_ssl: use_ssl :param formatter: custom formatter :return: Server object

get_info_from_server(connection)

reads info from DSE and from subschema

info
static next_message_id()

LDAP messageId is unique for all connections to same server

reset_availability()
schema
update_availability(address, available)