Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

148 Zeilen
4.2 KiB

  1. """
  2. """
  3. # Created on 2013.05.15
  4. #
  5. # Author: Giovanni Cannata
  6. #
  7. # Copyright 2013 - 2018 Giovanni Cannata
  8. #
  9. # This file is part of ldap3.
  10. #
  11. # ldap3 is free software: you can redistribute it and/or modify
  12. # it under the terms of the GNU Lesser General Public License as published
  13. # by the Free Software Foundation, either version 3 of the License, or
  14. # (at your option) any later version.
  15. #
  16. # ldap3 is distributed in the hope that it will be useful,
  17. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. # GNU Lesser General Public License for more details.
  20. #
  21. # You should have received a copy of the GNU Lesser General Public License
  22. # along with ldap3 in the COPYING and COPYING.LESSER files.
  23. # If not, see <http://www.gnu.org/licenses/>.
  24. from types import GeneratorType
  25. # authentication
  26. ANONYMOUS = 'ANONYMOUS'
  27. SIMPLE = 'SIMPLE'
  28. SASL = 'SASL'
  29. NTLM = 'NTLM'
  30. # SASL MECHANISMS
  31. EXTERNAL = 'EXTERNAL'
  32. DIGEST_MD5 = 'DIGEST-MD5'
  33. KERBEROS = GSSAPI = 'GSSAPI'
  34. PLAIN = 'PLAIN'
  35. AUTO_BIND_DEFAULT = 'DEFAULT' # binds connection whens using "with" context manager
  36. AUTO_BIND_NONE = 'NONE' # same as False
  37. AUTO_BIND_NO_TLS = 'NO_TLS' # same as True
  38. AUTO_BIND_TLS_BEFORE_BIND = 'TLS_BEFORE_BIND'
  39. AUTO_BIND_TLS_AFTER_BIND = 'TLS_AFTER_BIND'
  40. # server IP dual stack mode
  41. IP_SYSTEM_DEFAULT = 'IP_SYSTEM_DEFAULT'
  42. IP_V4_ONLY = 'IP_V4_ONLY'
  43. IP_V6_ONLY = 'IP_V6_ONLY'
  44. IP_V4_PREFERRED = 'IP_V4_PREFERRED'
  45. IP_V6_PREFERRED = 'IP_V6_PREFERRED'
  46. # search scope
  47. BASE = 'BASE'
  48. LEVEL = 'LEVEL'
  49. SUBTREE = 'SUBTREE'
  50. # search alias
  51. DEREF_NEVER = 'NEVER'
  52. DEREF_SEARCH = 'SEARCH'
  53. DEREF_BASE = 'FINDING_BASE'
  54. DEREF_ALWAYS = 'ALWAYS'
  55. # search attributes
  56. ALL_ATTRIBUTES = '*'
  57. NO_ATTRIBUTES = '1.1' # as per RFC 4511
  58. ALL_OPERATIONAL_ATTRIBUTES = '+' # as per RFC 3673
  59. # modify type
  60. MODIFY_ADD = 'MODIFY_ADD'
  61. MODIFY_DELETE = 'MODIFY_DELETE'
  62. MODIFY_REPLACE = 'MODIFY_REPLACE'
  63. MODIFY_INCREMENT = 'MODIFY_INCREMENT'
  64. # client strategies
  65. SYNC = 'SYNC'
  66. ASYNC = 'ASYNC'
  67. LDIF = 'LDIF'
  68. RESTARTABLE = 'RESTARTABLE'
  69. REUSABLE = 'REUSABLE'
  70. MOCK_SYNC = 'MOCK_SYNC'
  71. MOCK_ASYNC = 'MOCK_ASYNC'
  72. ASYNC_STREAM = 'ASYNC_STREAM'
  73. # get rootDSE info
  74. NONE = 'NO_INFO'
  75. DSA = 'DSA'
  76. SCHEMA = 'SCHEMA'
  77. ALL = 'ALL'
  78. OFFLINE_EDIR_8_8_8 = 'EDIR_8_8_8'
  79. OFFLINE_EDIR_9_1_4 = 'EDIR_9_1_4'
  80. OFFLINE_AD_2012_R2 = 'AD_2012_R2'
  81. OFFLINE_SLAPD_2_4 = 'SLAPD_2_4'
  82. OFFLINE_DS389_1_3_3 = 'DS389_1_3_3'
  83. # server pooling
  84. FIRST = 'FIRST'
  85. ROUND_ROBIN = 'ROUND_ROBIN'
  86. RANDOM = 'RANDOM'
  87. # Hashed password
  88. HASHED_NONE = 'PLAIN'
  89. HASHED_SHA = 'SHA'
  90. HASHED_SHA256 = 'SHA256'
  91. HASHED_SHA384 = 'SHA384'
  92. HASHED_SHA512 = 'SHA512'
  93. HASHED_MD5 = 'MD5'
  94. HASHED_SALTED_SHA = 'SALTED_SHA'
  95. HASHED_SALTED_SHA256 = 'SALTED_SHA256'
  96. HASHED_SALTED_SHA384 = 'SALTED_SHA384'
  97. HASHED_SALTED_SHA512 = 'SALTED_SHA512'
  98. HASHED_SALTED_MD5 = 'SALTED_MD5'
  99. if str is not bytes: # Python 3
  100. NUMERIC_TYPES = (int, float)
  101. INTEGER_TYPES = (int, )
  102. else:
  103. NUMERIC_TYPES = (int, long, float)
  104. INTEGER_TYPES = (int, long)
  105. # types for string and sequence
  106. if str is not bytes: # Python 3
  107. STRING_TYPES = (str, )
  108. SEQUENCE_TYPES = (set, list, tuple, GeneratorType, type(dict().keys())) # dict.keys() is a iterable memoryview in Python 3
  109. else: # Python 2
  110. try:
  111. from future.types.newstr import newstr
  112. except ImportError:
  113. pass
  114. STRING_TYPES = (str, unicode)
  115. SEQUENCE_TYPES = (set, list, tuple, GeneratorType)
  116. # centralized imports # must be at the end of the __init__.py file
  117. from .version import __author__, __version__, __email__, __description__, __status__, __license__, __url__
  118. from .utils.config import get_config_parameter, set_config_parameter
  119. from .core.server import Server
  120. from .core.connection import Connection
  121. from .core.tls import Tls
  122. from .core.pooling import ServerPool
  123. from .abstract.objectDef import ObjectDef
  124. from .abstract.attrDef import AttrDef
  125. from .abstract.attribute import Attribute, WritableAttribute, OperationalAttribute
  126. from .abstract.entry import Entry, WritableEntry
  127. from .abstract.cursor import Reader, Writer
  128. from .protocol.rfc4512 import DsaInfo, SchemaInfo