How to use the ldaptor.protocols.ldap.ldaperrors.LDAPException function in ldaptor

To help you get started, we’ve selected a few ldaptor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github twisted / ldaptor / ldaptor / protocols / ldap / ldaperrors.py View on Github external
# 35 reserved for undefined isLeaf


class LDAPAliasDereferencingProblem(LDAPException):
    resultCode = 36
    name = b'aliasDereferencingProblem'

# 37-47 unused


class LDAPInappropriateAuthentication(LDAPException):
    resultCode = 48
    name = b'inappropriateAuthentication'


class LDAPInvalidCredentials(LDAPException):
    resultCode = 49
    name = b'invalidCredentials'


class LDAPInsufficientAccessRights(LDAPException):
    resultCode = 50
    name = b'insufficientAccessRights'


class LDAPBusy(LDAPException):
    resultCode = 51
    name = b'busy'


class LDAPUnavailable(LDAPException):
    resultCode = 52
github twisted / ldaptor / ldaptor / protocols / ldap / ldaperrors.py View on Github external
class LDAPUnknownError(LDAPException):
    def __init__(self, resultCode, message=None):
        assert resultCode not in LDAPExceptionCollection.collection, \
            "resultCode %r must be unknown" % resultCode
        self.code = resultCode
        LDAPException.__init__(self, message)

    def toWire(self):
        codeName = b'unknownError(%d)' % self.code
        if self.message:
            return b'%s: %s' % (codeName, to_bytes(self.message))
        else:
            return codeName


class LDAPOperationsError(LDAPException):
    resultCode = 1
    name = b'operationsError'


class LDAPProtocolError(LDAPException):
    resultCode = 2
    name = b'protocolError'


class LDAPTimeLimitExceeded(LDAPException):
    resultCode = 3
    name = b'timeLimitExceeded'


class LDAPSizeLimitExceeded(LDAPException):
    resultCode = 4
github twisted / ldaptor / ldaptor / protocols / ldap / ldaperrors.py View on Github external
name = b'unavailable'


class LDAPUnwillingToPerform(LDAPException):
    resultCode = 53
    name = b'unwillingToPerform'


class LDAPLoopDetect(LDAPException):
    resultCode = 54
    name = b'loopDetect'

# 55-63 unused


class LDAPNamingViolation(LDAPException):
    resultCode = 64
    name = b'namingViolation'


class LDAPObjectClassViolation(LDAPException):
    resultCode = 65
    name = b'objectClassViolation'


class LDAPNotAllowedOnNonLeaf(LDAPException):
    resultCode = 66
    name = b'notAllowedOnNonLeaf'


class LDAPNotAllowedOnRDN(LDAPException):
    resultCode = 67
github twisted / ldaptor / ldaptor / protocols / ldap / ldaperrors.py View on Github external
class LDAPConfidentialityRequired(LDAPException):
    resultCode = 13
    name = b'confidentialityRequired'


class LDAPSaslBindInProgress(LDAPException):
    resultCode = 14
    name = b'saslBindInProgress'


class LDAPNoSuchAttribute(LDAPException):
    resultCode = 16
    name = b'noSuchAttribute'


class LDAPUndefinedAttributeType(LDAPException):
    resultCode = 17
    name = b'undefinedAttributeType'


class LDAPInappropriateMatching(LDAPException):
    resultCode = 18
    name = b'inappropriateMatching'


class LDAPConstraintViolation(LDAPException):
    resultCode = 19
    name = b'constraintViolation'


class LDAPAttributeOrValueExists(LDAPException):
    resultCode = 20
github twisted / ldaptor / ldaptor / protocols / ldap / ldaperrors.py View on Github external
class LDAPNamingViolation(LDAPException):
    resultCode = 64
    name = b'namingViolation'


class LDAPObjectClassViolation(LDAPException):
    resultCode = 65
    name = b'objectClassViolation'


class LDAPNotAllowedOnNonLeaf(LDAPException):
    resultCode = 66
    name = b'notAllowedOnNonLeaf'


class LDAPNotAllowedOnRDN(LDAPException):
    resultCode = 67
    name = b'notAllowedOnRDN'


class LDAPEntryAlreadyExists(LDAPException):
    resultCode = 68
    name = b'entryAlreadyExists'


class LDAPObjectClassModsProhibited(LDAPException):
    resultCode = 69
    name = b'objectClassModsProhibited'

# 70 reserved for CLDAP
github twisted / ldaptor / ldaptor / protocols / ldap / ldaperrors.py View on Github external
class LDAPInsufficientAccessRights(LDAPException):
    resultCode = 50
    name = b'insufficientAccessRights'


class LDAPBusy(LDAPException):
    resultCode = 51
    name = b'busy'


class LDAPUnavailable(LDAPException):
    resultCode = 52
    name = b'unavailable'


class LDAPUnwillingToPerform(LDAPException):
    resultCode = 53
    name = b'unwillingToPerform'


class LDAPLoopDetect(LDAPException):
    resultCode = 54
    name = b'loopDetect'

# 55-63 unused


class LDAPNamingViolation(LDAPException):
    resultCode = 64
    name = b'namingViolation'
github twisted / ldaptor / ldaptor / protocols / ldap / ldaperrors.py View on Github external
class LDAPObjectClassViolation(LDAPException):
    resultCode = 65
    name = b'objectClassViolation'


class LDAPNotAllowedOnNonLeaf(LDAPException):
    resultCode = 66
    name = b'notAllowedOnNonLeaf'


class LDAPNotAllowedOnRDN(LDAPException):
    resultCode = 67
    name = b'notAllowedOnRDN'


class LDAPEntryAlreadyExists(LDAPException):
    resultCode = 68
    name = b'entryAlreadyExists'


class LDAPObjectClassModsProhibited(LDAPException):
    resultCode = 69
    name = b'objectClassModsProhibited'

# 70 reserved for CLDAP


class LDAPAffectsMultipleDSAs(LDAPException):
    resultCode = 71
    name = b'affectsMultipleDSAs'

# 72-79 unused
github twisted / ldaptor / ldaptor / protocols / ldap / ldaperrors.py View on Github external
name = b'loopDetect'

# 55-63 unused


class LDAPNamingViolation(LDAPException):
    resultCode = 64
    name = b'namingViolation'


class LDAPObjectClassViolation(LDAPException):
    resultCode = 65
    name = b'objectClassViolation'


class LDAPNotAllowedOnNonLeaf(LDAPException):
    resultCode = 66
    name = b'notAllowedOnNonLeaf'


class LDAPNotAllowedOnRDN(LDAPException):
    resultCode = 67
    name = b'notAllowedOnRDN'


class LDAPEntryAlreadyExists(LDAPException):
    resultCode = 68
    name = b'entryAlreadyExists'


class LDAPObjectClassModsProhibited(LDAPException):
    resultCode = 69
github twisted / ldaptor / ldaptor / protocols / ldap / ldaperrors.py View on Github external
class LDAPInvalidDNSyntax(LDAPException):
    resultCode = 34
    name = b'invalidDNSyntax'

# 35 reserved for undefined isLeaf


class LDAPAliasDereferencingProblem(LDAPException):
    resultCode = 36
    name = b'aliasDereferencingProblem'

# 37-47 unused


class LDAPInappropriateAuthentication(LDAPException):
    resultCode = 48
    name = b'inappropriateAuthentication'


class LDAPInvalidCredentials(LDAPException):
    resultCode = 49
    name = b'invalidCredentials'


class LDAPInsufficientAccessRights(LDAPException):
    resultCode = 50
    name = b'insufficientAccessRights'


class LDAPBusy(LDAPException):
    resultCode = 51
github twisted / ldaptor / ldaptor / protocols / ldap / ldapserver.py View on Github external
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

"""LDAP protocol server"""

from ldaptor import interfaces, delta
from ldaptor.protocols import pureldap, pureber
from ldaptor.protocols.ldap import distinguishedname, ldaperrors
from twisted.python import log
from twisted.internet import protocol, defer


class LDAPServerConnectionLostException(ldaperrors.LDAPException):
    pass


class BaseLDAPServer(protocol.Protocol):
    debug = False

    def __init__(self):
        self.buffer = b''
        self.connected = None

    berdecoder = pureldap.LDAPBERDecoderContext_TopLevel(
        inherit=pureldap.LDAPBERDecoderContext_LDAPMessage(
            fallback=pureldap.LDAPBERDecoderContext(
                fallback=pureber.BERDecoderContext()),
            inherit=pureldap.LDAPBERDecoderContext(
                fallback=pureber.BERDecoderContext())))