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
Léo-Paul Géneau
gitlab-ce
Commits
baa65e89
Commit
baa65e89
authored
Oct 07, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check if LDAP user was removed or blocked when use git over ssh
parent
2db94109
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
lib/api/internal.rb
lib/api/internal.rb
+1
-0
lib/gitlab/ldap/user.rb
lib/gitlab/ldap/user.rb
+10
-0
No files found.
lib/api/internal.rb
View file @
baa65e89
...
@@ -35,6 +35,7 @@ module API
...
@@ -35,6 +35,7 @@ module API
user
=
key
.
user
user
=
key
.
user
return
false
if
user
.
blocked?
return
false
if
user
.
blocked?
return
false
if
user
.
ldap_user?
&&
Gitlab
::
LDAP
::
User
.
blocked?
(
user
.
extern_uid
)
action
=
case
git_cmd
action
=
case
git_cmd
when
*
DOWNLOAD_COMMANDS
when
*
DOWNLOAD_COMMANDS
...
...
lib/gitlab/ldap/user.rb
View file @
baa65e89
...
@@ -71,6 +71,16 @@ module Gitlab
...
@@ -71,6 +71,16 @@ module Gitlab
find_by_uid
(
ldap_user
.
dn
)
if
ldap_user
find_by_uid
(
ldap_user
.
dn
)
if
ldap_user
end
end
# Check LDAP user existance by dn. User in git over ssh check
#
# It covers 2 cases:
# * when ldap account was removed
# * when ldap account was deactivated by change of OU membership in 'dn'
def
blocked?
(
dn
)
ldap
=
OmniAuth
::
LDAP
::
Adaptor
.
new
(
ldap_conf
)
ldap
.
connection
.
search
(
base:
dn
,
size:
1
).
blank?
end
private
private
def
find_by_uid
(
uid
)
def
find_by_uid
(
uid
)
...
...
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