Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

novell.py 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. """
  2. """
  3. # Created on 2014.06.27
  4. #
  5. # Author: Giovanni Cannata
  6. #
  7. # Copyright 2014 - 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 pyasn1.type.univ import OctetString, Integer, Sequence, SequenceOf
  25. from pyasn1.type.namedtype import NamedType, NamedTypes, OptionalNamedType
  26. from pyasn1.type.tag import Tag, tagFormatSimple, tagClassUniversal, TagSet
  27. NMAS_LDAP_EXT_VERSION = 1
  28. class Identity(OctetString):
  29. encoding = 'utf-8'
  30. class LDAPDN(OctetString):
  31. tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassUniversal, tagFormatSimple, 4))
  32. encoding = 'utf-8'
  33. class Password(OctetString):
  34. tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassUniversal, tagFormatSimple, 4))
  35. encoding = 'utf-8'
  36. class LDAPOID(OctetString):
  37. tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassUniversal, tagFormatSimple, 4))
  38. encoding = 'utf-8'
  39. class GroupCookie(Integer):
  40. tagSet = Integer.tagSet.tagImplicitly(Tag(tagClassUniversal, tagFormatSimple, 2))
  41. class NmasVer(Integer):
  42. tagSet = Integer.tagSet.tagImplicitly(Tag(tagClassUniversal, tagFormatSimple, 2))
  43. class Error(Integer):
  44. tagSet = Integer.tagSet.tagImplicitly(Tag(tagClassUniversal, tagFormatSimple, 2))
  45. class NmasGetUniversalPasswordRequestValue(Sequence):
  46. componentType = NamedTypes(NamedType('nmasver', NmasVer()),
  47. NamedType('reqdn', Identity())
  48. )
  49. class NmasGetUniversalPasswordResponseValue(Sequence):
  50. componentType = NamedTypes(NamedType('nmasver', NmasVer()),
  51. NamedType('err', Error()),
  52. OptionalNamedType('passwd', Password())
  53. )
  54. class NmasSetUniversalPasswordRequestValue(Sequence):
  55. componentType = NamedTypes(NamedType('nmasver', NmasVer()),
  56. NamedType('reqdn', Identity()),
  57. NamedType('new_passwd', Password())
  58. )
  59. class NmasSetUniversalPasswordResponseValue(Sequence):
  60. componentType = NamedTypes(NamedType('nmasver', NmasVer()),
  61. NamedType('err', Error())
  62. )
  63. class ReplicaList(SequenceOf):
  64. componentType = OctetString()
  65. class ReplicaInfoRequestValue(Sequence):
  66. tagSet = TagSet()
  67. componentType = NamedTypes(NamedType('server_dn', LDAPDN()),
  68. NamedType('partition_dn', LDAPDN())
  69. )
  70. class ReplicaInfoResponseValue(Sequence):
  71. # tagSet = Sequence.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatConstructed, 3))
  72. tagSet = TagSet()
  73. componentType = NamedTypes(NamedType('partition_id', Integer()),
  74. NamedType('replica_state', Integer()),
  75. NamedType('modification_time', Integer()),
  76. NamedType('purge_time', Integer()),
  77. NamedType('local_partition_id', Integer()),
  78. NamedType('partition_dn', LDAPDN()),
  79. NamedType('replica_type', Integer()),
  80. NamedType('flags', Integer())
  81. )
  82. class CreateGroupTypeRequestValue(Sequence):
  83. componentType = NamedTypes(NamedType('createGroupType', LDAPOID()),
  84. OptionalNamedType('createGroupValue', OctetString())
  85. )
  86. class CreateGroupTypeResponseValue(Sequence):
  87. componentType = NamedTypes(NamedType('createGroupCookie', GroupCookie()),
  88. OptionalNamedType('createGroupValue', OctetString())
  89. )
  90. class EndGroupTypeRequestValue(Sequence):
  91. componentType = NamedTypes(NamedType('endGroupCookie', GroupCookie()),
  92. OptionalNamedType('endGroupValue', OctetString())
  93. )
  94. class EndGroupTypeResponseValue(Sequence):
  95. componentType = NamedTypes(OptionalNamedType('endGroupValue', OctetString())
  96. )
  97. class GroupingControlValue(Sequence):
  98. componentType = NamedTypes(NamedType('groupingCookie', GroupCookie()),
  99. OptionalNamedType('groupValue', OctetString())
  100. )