From 0509dd44c0eb6dad7235df7838bdb05ea31cde14 Mon Sep 17 00:00:00 2001 From: Patrick Mooney Date: Tue, 1 Jul 2014 18:36:47 -0500 Subject: [PATCH] Fix circular dependency in controls --- .../server_side_sorting_response_control.js | 2 +- lib/errors/codes.js | 44 +++++++++++++++++++ lib/errors/index.js | 44 +------------------ 3 files changed, 46 insertions(+), 44 deletions(-) create mode 100644 lib/errors/codes.js diff --git a/lib/controls/server_side_sorting_response_control.js b/lib/controls/server_side_sorting_response_control.js index 9ac2a67..ed4e60e 100644 --- a/lib/controls/server_side_sorting_response_control.js +++ b/lib/controls/server_side_sorting_response_control.js @@ -5,7 +5,7 @@ var asn1 = require('asn1'); var Control = require('./control'); -var CODES = require('../errors/index'); +var CODES = require('../errors/codes'); diff --git a/lib/errors/codes.js b/lib/errors/codes.js new file mode 100644 index 0000000..4021a42 --- /dev/null +++ b/lib/errors/codes.js @@ -0,0 +1,44 @@ +// Copyright 2014 Joyent, Inc. All rights reserved. + +module.exports = { + LDAP_SUCCESS: 0, + LDAP_OPERATIONS_ERROR: 1, + LDAP_PROTOCOL_ERROR: 2, + LDAP_TIME_LIMIT_EXCEEDED: 3, + LDAP_SIZE_LIMIT_EXCEEDED: 4, + LDAP_COMPARE_FALSE: 5, + LDAP_COMPARE_TRUE: 6, + LDAP_AUTH_METHOD_NOT_SUPPORTED: 7, + LDAP_STRONG_AUTH_REQUIRED: 8, + LDAP_REFERRAL: 10, + LDAP_ADMIN_LIMIT_EXCEEDED: 11, + LDAP_UNAVAILABLE_CRITICAL_EXTENSION: 12, + LDAP_CONFIDENTIALITY_REQUIRED: 13, + LDAP_SASL_BIND_IN_PROGRESS: 14, + LDAP_NO_SUCH_ATTRIBUTE: 16, + LDAP_UNDEFINED_ATTRIBUTE_TYPE: 17, + LDAP_INAPPROPRIATE_MATCHING: 18, + LDAP_CONSTRAINT_VIOLATION: 19, + LDAP_ATTRIBUTE_OR_VALUE_EXISTS: 20, + LDAP_INVALID_ATTRIBUTE_SYNTAX: 21, + LDAP_NO_SUCH_OBJECT: 32, + LDAP_ALIAS_PROBLEM: 33, + LDAP_INVALID_DN_SYNTAX: 34, + LDAP_ALIAS_DEREF_PROBLEM: 36, + LDAP_INAPPROPRIATE_AUTHENTICATION: 48, + LDAP_INVALID_CREDENTIALS: 49, + LDAP_INSUFFICIENT_ACCESS_RIGHTS: 50, + LDAP_BUSY: 51, + LDAP_UNAVAILABLE: 52, + LDAP_UNWILLING_TO_PERFORM: 53, + LDAP_LOOP_DETECT: 54, + LDAP_NAMING_VIOLATION: 64, + LDAP_OBJECTCLASS_VIOLATION: 65, + LDAP_NOT_ALLOWED_ON_NON_LEAF: 66, + LDAP_NOT_ALLOWED_ON_RDN: 67, + LDAP_ENTRY_ALREADY_EXISTS: 68, + LDAP_OBJECTCLASS_MODS_PROHIBITED: 69, + LDAP_AFFECTS_MULTIPLE_DSAS: 71, + LDAP_OTHER: 80, + LDAP_PROXIED_AUTHORIZATION_DENIED: 123 +}; diff --git a/lib/errors/index.js b/lib/errors/index.js index 192971e..6352036 100644 --- a/lib/errors/index.js +++ b/lib/errors/index.js @@ -7,49 +7,7 @@ var LDAPResult = require('../messages').LDAPResult; ///--- Globals -var CODES = { - LDAP_SUCCESS: 0, - LDAP_OPERATIONS_ERROR: 1, - LDAP_PROTOCOL_ERROR: 2, - LDAP_TIME_LIMIT_EXCEEDED: 3, - LDAP_SIZE_LIMIT_EXCEEDED: 4, - LDAP_COMPARE_FALSE: 5, - LDAP_COMPARE_TRUE: 6, - LDAP_AUTH_METHOD_NOT_SUPPORTED: 7, - LDAP_STRONG_AUTH_REQUIRED: 8, - LDAP_REFERRAL: 10, - LDAP_ADMIN_LIMIT_EXCEEDED: 11, - LDAP_UNAVAILABLE_CRITICAL_EXTENSION: 12, - LDAP_CONFIDENTIALITY_REQUIRED: 13, - LDAP_SASL_BIND_IN_PROGRESS: 14, - LDAP_NO_SUCH_ATTRIBUTE: 16, - LDAP_UNDEFINED_ATTRIBUTE_TYPE: 17, - LDAP_INAPPROPRIATE_MATCHING: 18, - LDAP_CONSTRAINT_VIOLATION: 19, - LDAP_ATTRIBUTE_OR_VALUE_EXISTS: 20, - LDAP_INVALID_ATTRIBUTE_SYNTAX: 21, - LDAP_NO_SUCH_OBJECT: 32, - LDAP_ALIAS_PROBLEM: 33, - LDAP_INVALID_DN_SYNTAX: 34, - LDAP_ALIAS_DEREF_PROBLEM: 36, - LDAP_INAPPROPRIATE_AUTHENTICATION: 48, - LDAP_INVALID_CREDENTIALS: 49, - LDAP_INSUFFICIENT_ACCESS_RIGHTS: 50, - LDAP_BUSY: 51, - LDAP_UNAVAILABLE: 52, - LDAP_UNWILLING_TO_PERFORM: 53, - LDAP_LOOP_DETECT: 54, - LDAP_NAMING_VIOLATION: 64, - LDAP_OBJECTCLASS_VIOLATION: 65, - LDAP_NOT_ALLOWED_ON_NON_LEAF: 66, - LDAP_NOT_ALLOWED_ON_RDN: 67, - LDAP_ENTRY_ALREADY_EXISTS: 68, - LDAP_OBJECTCLASS_MODS_PROHIBITED: 69, - LDAP_AFFECTS_MULTIPLE_DSAS: 71, - LDAP_OTHER: 80, - LDAP_PROXIED_AUTHORIZATION_DENIED: 123 -}; - +var CODES = require('./codes'); var ERRORS = [];