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
Jérome Perrin
gitlab-ce
Commits
714f264d
Commit
714f264d
authored
Oct 02, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename method to `to_normalized_s`
parent
a6a764f7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
db/post_migrate/20170921101004_normalize_ldap_extern_uids.rb
db/post_migrate/20170921101004_normalize_ldap_extern_uids.rb
+2
-2
lib/gitlab/ldap/auth_hash.rb
lib/gitlab/ldap/auth_hash.rb
+1
-1
lib/gitlab/ldap/dn.rb
lib/gitlab/ldap/dn.rb
+1
-1
lib/gitlab/ldap/person.rb
lib/gitlab/ldap/person.rb
+1
-1
spec/lib/gitlab/ldap/dn_spec.rb
spec/lib/gitlab/ldap/dn_spec.rb
+2
-2
No files found.
db/post_migrate/20170921101004_normalize_ldap_extern_uids.rb
View file @
714f264d
...
@@ -220,7 +220,7 @@ class NormalizeLdapExternUids < ActiveRecord::Migration
...
@@ -220,7 +220,7 @@ class NormalizeLdapExternUids < ActiveRecord::Migration
##
##
# Return the DN as an escaped and normalized string.
# Return the DN as an escaped and normalized string.
def
to_
s_normalized
def
to_
normalized_s
self
.
class
.
new
(
*
to_a
).
to_s
self
.
class
.
new
(
*
to_a
).
to_s
end
end
...
@@ -270,7 +270,7 @@ class NormalizeLdapExternUids < ActiveRecord::Migration
...
@@ -270,7 +270,7 @@ class NormalizeLdapExternUids < ActiveRecord::Migration
ldap_identities
=
Identity
.
where
(
"provider like 'ldap%'"
)
ldap_identities
=
Identity
.
where
(
"provider like 'ldap%'"
)
ldap_identities
.
find_each
do
|
identity
|
ldap_identities
.
find_each
do
|
identity
|
begin
begin
identity
.
extern_uid
=
Gitlab
::
LDAP
::
DN
.
new
(
identity
.
extern_uid
).
to_
s_normalized
identity
.
extern_uid
=
Gitlab
::
LDAP
::
DN
.
new
(
identity
.
extern_uid
).
to_
normalized_s
unless
identity
.
save
unless
identity
.
save
say
"Unable to normalize
\"
#{
identity
.
extern_uid
}
\"
. Skipping."
say
"Unable to normalize
\"
#{
identity
.
extern_uid
}
\"
. Skipping."
end
end
...
...
lib/gitlab/ldap/auth_hash.rb
View file @
714f264d
...
@@ -4,7 +4,7 @@ module Gitlab
...
@@ -4,7 +4,7 @@ module Gitlab
module
LDAP
module
LDAP
class
AuthHash
<
Gitlab
::
OAuth
::
AuthHash
class
AuthHash
<
Gitlab
::
OAuth
::
AuthHash
def
uid
def
uid
Gitlab
::
LDAP
::
DN
.
new
(
super
).
to_
s_normalized
Gitlab
::
LDAP
::
DN
.
new
(
super
).
to_
normalized_s
end
end
private
private
...
...
lib/gitlab/ldap/dn.rb
View file @
714f264d
...
@@ -235,7 +235,7 @@ module Gitlab
...
@@ -235,7 +235,7 @@ module Gitlab
##
##
# Return the DN as an escaped and normalized string.
# Return the DN as an escaped and normalized string.
def
to_
s_normalized
def
to_
normalized_s
self
.
class
.
new
(
*
to_a
).
to_s
.
downcase
self
.
class
.
new
(
*
to_a
).
to_s
.
downcase
end
end
...
...
lib/gitlab/ldap/person.rb
View file @
714f264d
...
@@ -72,7 +72,7 @@ module Gitlab
...
@@ -72,7 +72,7 @@ module Gitlab
end
end
def
dn
def
dn
DN
.
new
(
entry
.
dn
).
to_
s_normalized
DN
.
new
(
entry
.
dn
).
to_
normalized_s
end
end
private
private
...
...
spec/lib/gitlab/ldap/dn_spec.rb
View file @
714f264d
...
@@ -3,8 +3,8 @@ require 'spec_helper'
...
@@ -3,8 +3,8 @@ require 'spec_helper'
describe
Gitlab
::
LDAP
::
DN
do
describe
Gitlab
::
LDAP
::
DN
do
using
RSpec
::
Parameterized
::
TableSyntax
using
RSpec
::
Parameterized
::
TableSyntax
describe
'#to_
s_normalized
'
do
describe
'#to_
normalized_s
'
do
subject
{
described_class
.
new
(
given
).
to_
s_normalized
}
subject
{
described_class
.
new
(
given
).
to_
normalized_s
}
# Regarding the telephoneNumber test:
# Regarding the telephoneNumber test:
#
#
...
...
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