Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
2f11db4b
Commit
2f11db4b
authored
Sep 20, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt DN class for Gitlab
parent
7bc4278e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
207 additions
and
195 deletions
+207
-195
lib/gitlab/ldap/dn.rb
lib/gitlab/ldap/dn.rb
+207
-195
No files found.
lib/gitlab/ldap/dn.rb
View file @
2f11db4b
# -*- ruby encoding: utf-8 -*-
# -*- ruby encoding: utf-8 -*-
# Based on the `ruby-net-ldap` gem's `Net::LDAP::DN`
#
# For our purposes, this class is used to normalize DNs in order to allow proper
# comparison.
#
# E.g. DNs should be compared case-insensitively (in basically all LDAP
# implementations or setups), therefore we downcase every DN.
##
##
# Objects of this class represent an LDAP DN ("Distinguished Name"). A DN
# Objects of this class represent an LDAP DN ("Distinguished Name"). A DN
# ("Distinguished Name") is a unique identifier for an entry within an LDAP
# ("Distinguished Name") is a unique identifier for an entry within an LDAP
...
@@ -11,7 +19,9 @@
...
@@ -11,7 +19,9 @@
#
#
# A fully escaped DN needs to be unescaped when analysing its contents. This
# A fully escaped DN needs to be unescaped when analysing its contents. This
# class also helps take care of that.
# class also helps take care of that.
class
Net::LDAP::DN
module
Gitlab
module
LDAP
class
DN
##
##
# Initialize a DN, escaping as required. Pass in attributes in name/value
# Initialize a DN, escaping as required. Pass in attributes in name/value
# pairs. If there is a left over argument, it will be appended to the dn
# pairs. If there is a left over argument, it will be appended to the dn
...
@@ -221,4 +231,6 @@ class Net::LDAP::DN
...
@@ -221,4 +231,6 @@ class Net::LDAP::DN
def
method_missing
(
method
,
*
args
,
&
block
)
def
method_missing
(
method
,
*
args
,
&
block
)
@dn
.
send
(
method
,
*
args
,
&
block
)
@dn
.
send
(
method
,
*
args
,
&
block
)
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment