Skip to main content
Version: 7 - Gugelhupf

ConnectorTypeLDAP

class connector_types.connector_type_ldap.ConnectorTypeLDAP

Call a LDAP service.

Inputs

NameTypeDefaultDescription
encodingstrutf-8The encoding of the return values of the LDAP server
hoststrThe LDAP server to connect to
ignore_decoding_errorsboolTrueIf set, decoding errors will be ignored. Values which cannot be decoded into strings will be returned as bytes:base64:[base64-string].
include_raw_resultsboolFalseIf set, raw results will also be returned. Raw fields are not transformed into a human-readable format and returned as-is. Fields which are affected include timestamps, UUIDs, and SIDs. Binary data will be returned as bytes:base64:[base64-string].
paged_searchboolFalsePerform a paged search until the enpoint is exhausted
passwordstrThe password used to bind to the LDAP server
portintNoneThe port number to use. If unset port 389 for ldap:// and port 636 for ldaps:// will be used
searchdictPerform a LDAP search. Pass a dictionary containing the parameters of the search. e.g. {'search_base': 'o=test', 'search_filter': '(objectclass=*)', 'attributes': '*'}
use_sslboolTrueWill use ldap:// if set to False, ldaps:// otherwise
userstrThe username used to bind to the LDAP server

Outputs

NameTypeDefaultDescription
responseobject
resultobject

Constants

input_list = ['encoding', 'host', 'ignore_decoding_errors', 'include_raw_results', 'paged_search', 'password', 'port', 'search', 'use_ssl', 'user'] output_list = ['response', 'result'] ssl_context_inputs = ['check_hostname', 'client_cert', 'client_key', 'server_ca'] version = 1

Methods

execute

log

one_of_inputs

run

Example

import flow_api

def handler(system: flow_api.System, this: flow_api.Execution):
this.connect(
connector_type='LDAP',
host='my-ldap-server',
user='cn=user,dc=example,dc=com',
password='my-secret-password',
search={
'search_base': 'dc=example,dc=com',
'search_filter': '(objectclass=*)',
'attributes': '*',
},
)
return this.success('all done')