Skip to content
This repository was archived by the owner on Oct 17, 2019. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ ADD patches/*.patch /tmp/
RUN apt-get -y update \
&& apt-get -y install patch \
&& patch /opt/gitlab/embedded/service/gitlab-rails/app/controllers/omniauth_callbacks_controller.rb /tmp/omniauth_callbacks_controller.patch \
&& patch /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/o_auth/user.rb /tmp/user.rb.patch \
&& patch /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/ldap/person.rb /tmp/person.rb.patch \
&& patch /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/auth/o_auth/user.rb /tmp/user.rb.patch \
&& patch /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/auth/ldap/person.rb /tmp/person.rb.patch \
&& apt-get -y remove patch \
&& apt-get -y clean \
&& rm -f /tmp/*.patch
Expand Down
28 changes: 13 additions & 15 deletions patches/person.rb.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
diff --git a/person.rb.orig b/person.rb
index 4d6f8ac..1a2cb35 100644
--- a/person.rb.orig
+++ b/person.rb
@@ -8,6 +8,11 @@ module Gitlab

attr_accessor :entry, :provider

+ def self.find_by_uuid(uuid, adapter)
+ uuid = Net::LDAP::Filter.escape(uuid)
+ adapter.user('entryUUID', uuid)
+ end
--- ./lib/gitlab/auth/ldap/person.rb
+++ ./lib/gitlab/auth/ldap/person.rb.patched
@@ -11,6 +11,11 @@

attr_accessor :entry, :provider

+ def self.find_by_uuid(uuid, adapter)
+ uuid = Net::LDAP::Filter.escape(uuid)
+ adapter.user('entryUUID', uuid)
+ end
+
def self.find_by_uid(uid, adapter)
uid = Net::LDAP::Filter.escape(uid)
adapter.user(adapter.config.uid, uid)
def self.find_by_uid(uid, adapter)
uid = Net::LDAP::Filter.escape(uid)
adapter.user(adapter.config.uid, uid)
18 changes: 9 additions & 9 deletions patches/user.rb.patch
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
--- ./lib/gitlab/o_auth/user.rb
+++ ./lib/gitlab/o_auth/user-patched.rb
@@ -119,6 +119,7 @@
--- ./lib/gitlab/auth/o_auth/user.rb
+++ ./lib/gitlab/auth/o_auth/user.rb.patched
@@ -122,6 +122,7 @@

def find_ldap_person(auth_hash, adapter)
Gitlab::LDAP::Person.find_by_uid(auth_hash.uid, adapter) ||
+ Gitlab::LDAP::Person.find_by_uuid(auth_hash.uid, adapter) ||
Gitlab::LDAP::Person.find_by_email(auth_hash.uid, adapter) ||
Gitlab::LDAP::Person.find_by_dn(auth_hash.uid, adapter)
end
def find_ldap_person(auth_hash, adapter)
Gitlab::Auth::LDAP::Person.find_by_uid(auth_hash.uid, adapter) ||
+ Gitlab::Auth::LDAP::Person.find_by_uuid(auth_hash.uid, adapter) ||
Gitlab::Auth::LDAP::Person.find_by_email(auth_hash.uid, adapter) ||
Gitlab::Auth::LDAP::Person.find_by_dn(auth_hash.uid, adapter)
end