ldaptor API Reference¶
Subpackages¶
- ldaptor.protocols package
- Subpackages
- ldaptor.protocols.ldap package
- Subpackages
- Submodules
- ldaptor.protocols.ldap.distinguishedname module
- ldaptor.protocols.ldap.fetchschema module
- ldaptor.protocols.ldap.ldapclient module
LDAPClientLDAPClient.berdecoderLDAPClient.bind()LDAPClient.connectionLost()LDAPClient.connectionMade()LDAPClient.dataReceived()LDAPClient.debugLDAPClient.handle()LDAPClient.notifyOnDisconnect()LDAPClient.send()LDAPClient.send_multiResponse()LDAPClient.send_multiResponse_ex()LDAPClient.send_noResponse()LDAPClient.startTLS()LDAPClient.unbind()LDAPClient.unsolicitedNotification()
LDAPClientConnectionLostExceptionLDAPStartTLSBusyErrorLDAPStartTLSInvalidResponseName
- ldaptor.protocols.ldap.ldapconnector module
- ldaptor.protocols.ldap.ldaperrors module
LDAPAdminLimitExceededLDAPAffectsMultipleDSAsLDAPAliasDereferencingProblemLDAPAliasProblemLDAPAttributeOrValueExistsLDAPAuthMethodNotSupportedLDAPBusyLDAPCompareFalseLDAPCompareTrueLDAPConfidentialityRequiredLDAPConstraintViolationLDAPEntryAlreadyExistsLDAPExceptionLDAPExceptionCollectionLDAPInappropriateAuthenticationLDAPInappropriateMatchingLDAPInsufficientAccessRightsLDAPInvalidAttributeSyntaxLDAPInvalidCredentialsLDAPInvalidDNSyntaxLDAPLoopDetectLDAPNamingViolationLDAPNoSuchAttributeLDAPNoSuchObjectLDAPNotAllowedOnNonLeafLDAPNotAllowedOnRDNLDAPObjectClassModsProhibitedLDAPObjectClassViolationLDAPOperationsErrorLDAPOtherLDAPProtocolErrorLDAPReferralLDAPResultLDAPSaslBindInProgressLDAPSizeLimitExceededLDAPStrongAuthRequiredLDAPTimeLimitExceededLDAPUnavailableLDAPUnavailableCriticalExtensionLDAPUndefinedAttributeTypeLDAPUnknownErrorLDAPUnwillingToPerformSuccessget()
- ldaptor.protocols.ldap.ldapserver module
BaseLDAPServerBaseLDAPServer.berdecoderBaseLDAPServer.checkControls()BaseLDAPServer.connectionLost()BaseLDAPServer.connectionMade()BaseLDAPServer.dataReceived()BaseLDAPServer.debugBaseLDAPServer.failDefault()BaseLDAPServer.handle()BaseLDAPServer.handleUnknown()BaseLDAPServer.queue()BaseLDAPServer.unsolicitedNotification()
LDAPServerLDAPServer.boundUserLDAPServer.extendedRequest_LDAPPasswordModifyRequest()LDAPServer.fail_LDAPAddRequestLDAPServer.fail_LDAPBindRequestLDAPServer.fail_LDAPCompareRequestLDAPServer.fail_LDAPDelRequestLDAPServer.fail_LDAPExtendedRequestLDAPServer.fail_LDAPModifyDNRequestLDAPServer.fail_LDAPModifyRequestLDAPServer.fail_LDAPSearchRequestLDAPServer.getRootDSE()LDAPServer.handle_LDAPAddRequest()LDAPServer.handle_LDAPBindRequest()LDAPServer.handle_LDAPCompareRequest()LDAPServer.handle_LDAPDelRequest()LDAPServer.handle_LDAPExtendedRequest()LDAPServer.handle_LDAPModifyDNRequest()LDAPServer.handle_LDAPModifyRequest()LDAPServer.handle_LDAPSearchRequest()LDAPServer.handle_LDAPUnbindRequest()
LDAPServerConnectionLostException
- ldaptor.protocols.ldap.ldapsyntax module
CannotRemoveRDNErrorDNNotPresentErrorJournaledLDAPAttributeSetLDAPEntryLDAPEntryWithAutoFillLDAPEntryWithClientLDAPEntryWithClient.addChild()LDAPEntryWithClient.bind()LDAPEntryWithClient.buildAttributeSet()LDAPEntryWithClient.commit()LDAPEntryWithClient.delete()LDAPEntryWithClient.fetch()LDAPEntryWithClient.get()LDAPEntryWithClient.has_key()LDAPEntryWithClient.items()LDAPEntryWithClient.journal()LDAPEntryWithClient.keys()LDAPEntryWithClient.lookup()LDAPEntryWithClient.move()LDAPEntryWithClient.namingContext()LDAPEntryWithClient.search()LDAPEntryWithClient.setPassword()LDAPEntryWithClient.setPasswordMaybe_ExtendedOperation()LDAPEntryWithClient.setPasswordMaybe_Samba()LDAPEntryWithClient.setPassword_ExtendedOperation()LDAPEntryWithClient.setPassword_Samba()LDAPEntryWithClient.toWire()LDAPEntryWithClient.undo()
MatchNotImplementedNoContainingNamingContextObjectDeletedErrorObjectDirtyErrorObjectInBadStateErrorPasswordSetAbortedPasswordSetAggregateError
- ldaptor.protocols.ldap.ldif module
- ldaptor.protocols.ldap.ldifdelta module
- ldaptor.protocols.ldap.ldifprotocol module
- ldaptor.protocols.ldap.proxy module
- ldaptor.protocols.ldap.svcbindproxy module
- Module contents
- ldaptor.protocols.ldap package
- Submodules
- ldaptor.protocols.pureber module
- ldaptor.protocols.pureldap module
LDAPAbandonRequestLDAPAddRequestLDAPAddResponseLDAPAssertionValueLDAPAttributeDescriptionLDAPAttributeValueLDAPAttributeValueAssertionLDAPBERDecoderContextLDAPBERDecoderContext_BindResponseLDAPBERDecoderContext_CompareLDAPBERDecoderContext_FilterLDAPBERDecoderContext_Filter_substringsLDAPBERDecoderContext_LDAPBindRequestLDAPBERDecoderContext_LDAPControlsLDAPBERDecoderContext_LDAPExtendedRequestLDAPBERDecoderContext_LDAPExtendedResponseLDAPBERDecoderContext_LDAPMessageLDAPBERDecoderContext_LDAPPasswordModifyRequestLDAPBERDecoderContext_LDAPSearchResultReferenceLDAPBERDecoderContext_MatchingRuleAssertionLDAPBERDecoderContext_ModifyDNRequestLDAPBERDecoderContext_TopLevelLDAPBindRequestLDAPBindResponseLDAPBindResponse_serverSaslCredsLDAPCompareRequestLDAPCompareResponseLDAPControlLDAPControlsLDAPDelRequestLDAPDelResponseLDAPExtendedRequestLDAPExtendedResponseLDAPFilterLDAPFilterSetLDAPFilter_andLDAPFilter_approxMatchLDAPFilter_equalityMatchLDAPFilter_extensibleMatchLDAPFilter_greaterOrEqualLDAPFilter_lessOrEqualLDAPFilter_notLDAPFilter_orLDAPFilter_presentLDAPFilter_substringsLDAPFilter_substrings_anyLDAPFilter_substrings_finalLDAPFilter_substrings_initialLDAPIntegerLDAPMatchingRuleAssertionLDAPMatchingRuleAssertion_dnAttributesLDAPMatchingRuleAssertion_matchValueLDAPMatchingRuleAssertion_matchingRuleLDAPMatchingRuleAssertion_typeLDAPMatchingRuleIdLDAPMessageLDAPModifyDNRequestLDAPModifyDNResponseLDAPModifyDNResponse_newSuperiorLDAPModifyRequestLDAPModifyResponseLDAPOIDLDAPPasswordModifyRequestLDAPPasswordModifyRequest_newPasswdLDAPPasswordModifyRequest_oldPasswdLDAPPasswordModifyRequest_passwdLDAPPasswordModifyRequest_userIdentityLDAPProtocolOpLDAPProtocolRequestLDAPProtocolResponseLDAPReferralLDAPResponseLDAPResponseNameLDAPResultLDAPSearchRequestLDAPSearchResultDoneLDAPSearchResultEntryLDAPSearchResultReferenceLDAPStartTLSRequestLDAPStartTLSResponseLDAPStringLDAPUnbindRequestalloc_ldap_message_id()binary_escape()escape()smart_escape()
- Module contents
- Subpackages
- ldaptor.samba package
Submodules¶
ldaptor.attributeset module¶
ldaptor.checkers module¶
ldaptor.config module¶
- class ldaptor.config.LDAPConfig(baseDN=None, serviceLocationOverrides=None, identityBaseDN=None, identitySearch=None)[source]¶
Bases:
object- baseDN = None¶
- identityBaseDN = None¶
- identitySearch = None¶
ldaptor.delta module¶
Changes to the content of one single LDAP entry.
(This means these do not belong here: adding or deleting of entries, changing of location in tree)
- class ldaptor.delta.Add(key, *a, **kw)[source]¶
Bases:
Modification
- class ldaptor.delta.Delete(key, *a, **kw)[source]¶
Bases:
Modification
- class ldaptor.delta.Modification(key, *a, **kw)[source]¶
Bases:
LDAPAttributeSet
ldaptor.dns module¶
DNS-related utilities.
ldaptor.entry module¶
- class ldaptor.entry.BaseLDAPEntry(dn, attributes={})[source]¶
Bases:
WireStrAlias- diff(other)[source]¶
Compute differences between this and another LDAP entry.
@param other: An LDAPEntry to compare to.
@return: None if equal, otherwise a ModifyOp that would make this entry look like other.
- dn = None¶
- class ldaptor.entry.EditableLDAPEntry(dn, attributes={})[source]¶
Bases:
BaseLDAPEntry
ldaptor.entryhelpers module¶
ldaptor.generate_password module¶
ldaptor.inmemory module¶
- class ldaptor.inmemory.InMemoryLDIFProtocol[source]¶
Bases:
LDIFReceive LDIF data and gather results into an ReadOnlyInMemoryLDAPEntry.
You can override lookupFailed and addFailed to provide smarter error handling. They are called as Deferred errbacks; returning the reason causes error to pass onward and abort the whole operation. Returning None from lookupFailed skips that entry, but continues loading.
When the full LDIF data has been read, the completed Deferred will trigger.
- exception ldaptor.inmemory.LDAPCannotRemoveRootError(message=None)[source]¶
Bases:
LDAPNamingViolationCannot remove root of LDAP tree
- class ldaptor.inmemory.ReadOnlyInMemoryLDAPEntry(*a, **kw)[source]¶
Bases:
EditableLDAPEntry,DiffTreeMixin,SubtreeFromChildrenMixin,MatchMixin,SearchByTreeWalkingMixin
ldaptor.interfaces module¶
ldaptor.ldapfilter module¶
ldaptor.ldiftree module¶
Manage LDAP data as a tree of LDIF files.
- exception ldaptor.ldiftree.LDAPCannotRemoveRootError(message=None)[source]¶
Bases:
LDAPNamingViolationCannot remove root of LDAP tree
- class ldaptor.ldiftree.LDIFTreeEntry(path, dn=None, *a, **kw)[source]¶
Bases:
EditableLDAPEntry,DiffTreeMixin,SubtreeFromChildrenMixin,MatchMixin,SearchByTreeWalkingMixin
- exception ldaptor.ldiftree.LDIFTreeEntryContainsMultipleEntries[source]¶
Bases:
ExceptionLDIFTree entry contains multiple LDIF entries.
- exception ldaptor.ldiftree.LDIFTreeEntryContainsNoEntries[source]¶
Bases:
ExceptionLDIFTree entry does not contain a valid LDIF entry.
- exception ldaptor.ldiftree.LDIFTreeNoSuchObject[source]¶
Bases:
ExceptionLDIFTree does not contain such entry.
ldaptor.numberalloc module¶
Find an available uidNumber/gidNumber/other similar number.
ldaptor.schema module¶
- class ldaptor.schema.AttributeTypeDescription(text)[source]¶
Bases:
ASN1ParserThingie,WireStrAliasASN Syntax:
AttributeTypeDescription = "(" whsp numericoid whsp ; AttributeType identifier [ "NAME" qdescrs ] ; name used in AttributeType [ "DESC" qdstring ] ; description [ "OBSOLETE" whsp ] [ "SUP" woid ] ; derived from this other AttributeType [ "EQUALITY" woid ; Matching Rule name [ "ORDERING" woid ; Matching Rule name [ "SUBSTR" woid ] ; Matching Rule name [ "SYNTAX" whsp noidlen whsp ] ; see section 4.3 [ "SINGLE-VALUE" whsp ] ; default multi-valued [ "COLLECTIVE" whsp ] ; default not collective [ "NO-USER-MODIFICATION" whsp ]; default user modifiable [ "USAGE" whsp AttributeUsage ]; default userApplications whsp ")" AttributeUsage = "userApplications" / "directoryOperation" / "distributedOperation" / ; DSA-shared "dSAOperation" ; DSA-specific, value depends on server noidlen = numericoid [ "{" len "}" ] len = numericstring
- class ldaptor.schema.MatchingRuleDescription(text)[source]¶
Bases:
ASN1ParserThingie,WireStrAliasASN Syntax:
MatchingRuleDescription = "(" whsp numericoid whsp ; MatchingRule identifier [ "NAME" qdescrs ] [ "DESC" qdstring ] [ "OBSOLETE" whsp ] "SYNTAX" numericoid whsp ")"
- class ldaptor.schema.ObjectClassDescription(text)[source]¶
Bases:
ASN1ParserThingie,WireStrAliasASN Syntax:
d = "0" / "1" / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9" numericstring = 1*d numericoid = numericstring *( "." numericstring ) space = 1*" " whsp = [ space ] descr = keystring qdescr = whsp "'" descr "'" whsp qdescrlist = [ qdescr *( qdescr ) ] ; object descriptors used as schema element names qdescrs = qdescr / ( whsp "(" qdescrlist ")" whsp ) dstring = 1*utf8 qdstring = whsp "'" dstring "'" whsp descr = keystring oid = descr / numericoid woid = whsp oid whsp ; set of oids of either form oids = woid / ( "(" oidlist ")" ) ObjectClassDescription = "(" whsp numericoid whsp ; ObjectClass identifier [ "NAME" qdescrs ] [ "DESC" qdstring ] [ "OBSOLETE" whsp ] [ "SUP" oids ] ; Superior ObjectClasses [ ( "ABSTRACT" / "STRUCTURAL" / "AUXILIARY" ) whsp ] ; default structural [ "MUST" oids ] ; AttributeTypes [ "MAY" oids ] ; AttributeTypes whsp ")"
- class ldaptor.schema.SyntaxDescription(text)[source]¶
Bases:
ASN1ParserThingie,WireStrAliasASN Syntax:
SyntaxDescription = "(" whsp numericoid whsp [ "DESC" qdstring ] whsp ")"
ldaptor.testutil module¶
Utilities for writing Twistedy unit tests and debugging.
- class ldaptor.testutil.LDAPClientTestDriver(*responses)[source]¶
Bases:
objectA test driver that looks somewhat like a real LDAPClient.
Pass in a list of lists of LDAPProtocolResponses. For each sent LDAP message, the first item of said list is iterated through, and all the items are sent as responses to the callback. The sent LDAP messages are stored in self.sent, so you can assert that the sent messages are what they are supposed to be.
It is also possible to include a Failure instance instead of a list of LDAPProtocolResponses which will cause the errback to be called with the failure.
- fakeUnbindResponse = 'fake-unbind-by-LDAPClientTestDriver'¶
- ldaptor.testutil.createServer(proto, *responses, **kw)[source]¶
Create an LDAP server for testing. :param proto: The server protocol factory (e.g. ProxyBase). :param responses: The responses to initialize the LDAPClientTestDrive. :param proto_args: Optional mapping passed as keyword args to protocol factory.
ldaptor.usage module¶
Command line argument/options available to various ldaptor tools.
- class ldaptor.usage.Options_base[source]¶
Bases:
Options_base_optional
- class ldaptor.usage.Options_base_optional[source]¶
Bases:
object- optParameters = (('base', None, None, 'LDAP base dn'),)¶
- class ldaptor.usage.Options_bind[source]¶
Bases:
object- optParameters = (('binddn', None, None, 'use Distinguished Name to bind to the directory'), ('bind-auth-fd', None, None, 'read bind password from filedescriptor'))¶
- class ldaptor.usage.Options_bind_mandatory[source]¶
Bases:
Options_bind
- class ldaptor.usage.Options_scope[source]¶
Bases:
object- optParameters = (('scope', None, 'sub', 'LDAP search scope (one of base, one, sub)'),)¶
Module contents¶
A Pure-Python Twisted library for LDAP