modify-response.js 924 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. 'use strict'
  2. const LdapResult = require('../ldap-result')
  3. const { operations } = require('@ldapjs/protocol')
  4. /**
  5. * Implements the MODIFY response message as described in
  6. * https://www.rfc-editor.org/rfc/rfc4511.html#section-4.6.
  7. */
  8. class ModifyResponse extends LdapResult {
  9. /**
  10. * @param {LdapResultOptions} options
  11. */
  12. constructor (options = {}) {
  13. options.protocolOp = operations.LDAP_RES_MODIFY
  14. super(options)
  15. }
  16. /**
  17. * The name of the request type.
  18. *
  19. * @type {string}
  20. */
  21. get type () {
  22. return 'ModifyResponse'
  23. }
  24. /**
  25. * Implements the standardized `parseToPojo` method.
  26. *
  27. * @see LdapMessage.parseToPojo
  28. *
  29. * @param {import('@ldapjs/asn1').BerReader} ber
  30. *
  31. * @returns {object}
  32. */
  33. static parseToPojo (ber) {
  34. return LdapResult._parseToPojo({
  35. opCode: operations.LDAP_RES_MODIFY,
  36. berReader: ber
  37. })
  38. }
  39. }
  40. module.exports = ModifyResponse