node-ldapjs/lib/messages/unbind_request.js

63 lines
1.2 KiB
JavaScript
Raw Normal View History

2011-08-04 20:32:01 +00:00
// Copyright 2011 Mark Cavage, Inc. All rights reserved.
2020-10-31 21:07:32 +00:00
const assert = require('assert-plus')
const util = require('util')
2011-08-04 20:32:01 +00:00
2020-10-31 21:07:32 +00:00
const LDAPMessage = require('./message')
const dn = require('../dn')
const Protocol = require('../protocol')
2011-08-04 20:32:01 +00:00
/// --- Globals
2011-08-04 20:32:01 +00:00
2020-10-31 21:07:32 +00:00
const DN = dn.DN
const RDN = dn.RDN
2011-08-04 20:32:01 +00:00
/// --- API
2011-08-04 20:32:01 +00:00
function UnbindRequest (options) {
options = options || {}
assert.object(options)
2011-08-04 20:32:01 +00:00
options.protocolOp = Protocol.LDAP_REQ_UNBIND
LDAPMessage.call(this, options)
2011-08-04 20:32:01 +00:00
}
util.inherits(UnbindRequest, LDAPMessage)
Object.defineProperties(UnbindRequest.prototype, {
type: {
get: function getType () { return 'UnbindRequest' },
configurable: false
},
_dn: {
get: function getDN () {
if (this.connection) {
return this.connection.ldap.bindDN
} else {
return new DN([new RDN({ cn: 'anonymous' })])
}
},
configurable: false
2011-08-04 20:32:01 +00:00
}
})
2011-08-04 20:32:01 +00:00
UnbindRequest.prototype._parse = function (ber) {
assert.ok(ber)
2011-08-04 20:32:01 +00:00
return true
}
2011-08-04 20:32:01 +00:00
UnbindRequest.prototype._toBer = function (ber) {
assert.ok(ber)
2011-08-04 20:32:01 +00:00
return ber
}
2011-08-04 20:32:01 +00:00
UnbindRequest.prototype._json = function (j) {
assert.ok(j)
return j
}
/// --- Exports
module.exports = UnbindRequest