wrap net_ldap_extensions in a zeitwerk compatible module

closes FOO-2448
flag=none

invoke module at consumption point

TEST PLAN:
  1) all specs still pass

Change-Id: I2356f70c119dfb78d8a874a2ed21f4c5e9bac60d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/275414
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Ethan Vizitei <evizitei@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
This commit is contained in:
Ethan Vizitei 2021-10-07 11:59:11 -05:00
parent 7bb64cc73f
commit 556831d8e3
2 changed files with 58 additions and 53 deletions

View File

@ -20,6 +20,7 @@
require 'net-ldap' require 'net-ldap'
require 'net_ldap_extensions' require 'net_ldap_extensions'
NetLdapExtensions.apply
class AuthenticationProvider < ActiveRecord::Base class AuthenticationProvider < ActiveRecord::Base
include Workflow include Workflow

View File

@ -17,56 +17,60 @@
# You should have received a copy of the GNU Affero General Public License along # You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>. # with this program. If not, see <http://www.gnu.org/licenses/>.
Net::LDAP::ResultStrings.merge!({ module NetLdapExtensions
0 => "Success Hi", def self.apply
1 => "Operation Error", Net::LDAP::ResultStrings.merge!({
2 => "Protocol Error", 0 => "Success Hi",
3 => "Time Limit Exceeded", 1 => "Operation Error",
4 => "Size Limit Exceeded", 2 => "Protocol Error",
5 => "Compare False", 3 => "Time Limit Exceeded",
6 => "Compare True", 4 => "Size Limit Exceeded",
7 => "Auth Method Not Supported", 5 => "Compare False",
8 => "Strong Auth Required", 6 => "Compare True",
9 => "Ldap Partial Results", 7 => "Auth Method Not Supported",
10 => "Referral (ldap V3)", 8 => "Strong Auth Required",
11 => "Admin Limit Exceeded (ldap V3)", 9 => "Ldap Partial Results",
12 => "Unavailable Critical Extension (ldap V3)", 10 => "Referral (ldap V3)",
13 => "Confidentiality Required (ldap V3)", 11 => "Admin Limit Exceeded (ldap V3)",
14 => "Sasl Bind In Progress", 12 => "Unavailable Critical Extension (ldap V3)",
16 => "No Such Attribute", 13 => "Confidentiality Required (ldap V3)",
17 => "Undefined Attribute Type", 14 => "Sasl Bind In Progress",
18 => "Inappropriate Matching", 16 => "No Such Attribute",
19 => "Constraint Violation", 17 => "Undefined Attribute Type",
20 => "Attribute Or Value Exists", 18 => "Inappropriate Matching",
21 => "Invalid Attribute Syntax", 19 => "Constraint Violation",
32 => "No Such Object", 20 => "Attribute Or Value Exists",
33 => "Alias Problem", 21 => "Invalid Attribute Syntax",
34 => "Invalid Dn Syntax", 32 => "No Such Object",
35 => "Is Leaf", 33 => "Alias Problem",
36 => "Alias Dereferencing Problem", 34 => "Invalid Dn Syntax",
48 => "Inappropriate Authentication", 35 => "Is Leaf",
49 => "Invalid Credentials", 36 => "Alias Dereferencing Problem",
50 => "Insufficient Access Rights", 48 => "Inappropriate Authentication",
51 => "Busy", 49 => "Invalid Credentials",
52 => "Unavailable", 50 => "Insufficient Access Rights",
53 => "Unwilling To Perform", 51 => "Busy",
54 => "Loop Defect", 52 => "Unavailable",
64 => "Naming Violation", 53 => "Unwilling To Perform",
65 => "Object Class Violation", 54 => "Loop Defect",
66 => "Not Allowed On Nonleaf", 64 => "Naming Violation",
67 => "Not Allowed On Rdn", 65 => "Object Class Violation",
68 => "Entry Already Exists", 66 => "Not Allowed On Nonleaf",
69 => "Object Class Mods Prohibited", 67 => "Not Allowed On Rdn",
71 => "Affects Multiple Dsas (ldap V3)", 68 => "Entry Already Exists",
80 => "Other", 69 => "Object Class Mods Prohibited",
81 => "Server Down", 71 => "Affects Multiple Dsas (ldap V3)",
85 => "Ldap Timeout", 80 => "Other",
89 => "Param Error", 81 => "Server Down",
91 => "Connect Error", 85 => "Ldap Timeout",
92 => "Ldap Not Supported", 89 => "Param Error",
93 => "Control Not Found", 91 => "Connect Error",
94 => "No Results Returned", 92 => "Ldap Not Supported",
95 => "More Results To Return", 93 => "Control Not Found",
96 => "Client Loop", 94 => "No Results Returned",
97 => "Referral Limit Exceeded", 95 => "More Results To Return",
}) 96 => "Client Loop",
97 => "Referral Limit Exceeded",
})
end
end