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
125cb9b8
Commit
125cb9b8
authored
May 12, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't accidentally unblock auto created users from Active Directory.
parent
f84e78f3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
5 deletions
+25
-5
CHANGELOG
CHANGELOG
+1
-0
lib/gitlab/ldap/access.rb
lib/gitlab/ldap/access.rb
+1
-1
spec/lib/gitlab/ldap/access_spec.rb
spec/lib/gitlab/ldap/access_spec.rb
+23
-4
No files found.
CHANGELOG
View file @
125cb9b8
...
@@ -52,6 +52,7 @@ v 7.11.0 (unreleased)
...
@@ -52,6 +52,7 @@ v 7.11.0 (unreleased)
- Add current_sign_in_at to UserFull REST api.
- Add current_sign_in_at to UserFull REST api.
- Make Sidekiq MemoryKiller shutdown signal configurable
- Make Sidekiq MemoryKiller shutdown signal configurable
- Add "Create Merge Request" buttons to commits and branches pages and push event.
- Add "Create Merge Request" buttons to commits and branches pages and push event.
- Fix automatic blocking of auto-created users from Active Directory.
v 7.10.2
v 7.10.2
- Fix CI links on MR page
- Fix CI links on MR page
...
...
lib/gitlab/ldap/access.rb
View file @
125cb9b8
...
@@ -40,7 +40,7 @@ module Gitlab
...
@@ -40,7 +40,7 @@ module Gitlab
user
.
block
unless
user
.
blocked?
user
.
block
unless
user
.
blocked?
false
false
else
else
user
.
activate
if
user
.
blocked?
user
.
activate
if
user
.
blocked?
&&
!
ldap_config
.
block_auto_created_users
true
true
end
end
else
else
...
...
spec/lib/gitlab/ldap/access_spec.rb
View file @
125cb9b8
...
@@ -16,7 +16,7 @@ describe Gitlab::LDAP::Access do
...
@@ -16,7 +16,7 @@ describe Gitlab::LDAP::Access do
context
'when the user is found'
do
context
'when the user is found'
do
before
{
Gitlab
::
LDAP
::
Person
.
stub
(
find_by_dn: :ldap_user
)
}
before
{
Gitlab
::
LDAP
::
Person
.
stub
(
find_by_dn: :ldap_user
)
}
context
'and the user is diabled via active directory'
do
context
'and the user is di
s
abled via active directory'
do
before
{
Gitlab
::
LDAP
::
Person
.
stub
(
disabled_via_active_directory?:
true
)
}
before
{
Gitlab
::
LDAP
::
Person
.
stub
(
disabled_via_active_directory?:
true
)
}
it
{
is_expected
.
to
be_falsey
}
it
{
is_expected
.
to
be_falsey
}
...
@@ -36,11 +36,30 @@ describe Gitlab::LDAP::Access do
...
@@ -36,11 +36,30 @@ describe Gitlab::LDAP::Access do
it
{
is_expected
.
to
be_truthy
}
it
{
is_expected
.
to
be_truthy
}
context
'when auto-created users are blocked'
do
before
do
Gitlab
::
LDAP
::
Config
.
any_instance
.
stub
(
block_auto_created_users:
true
)
end
it
"does not unblock user in GitLab"
do
access
.
allowed?
user
.
should
be_blocked
end
end
context
"when auto-created users are not blocked"
do
before
do
Gitlab
::
LDAP
::
Config
.
any_instance
.
stub
(
block_auto_created_users:
false
)
end
it
"should unblock user in GitLab"
do
it
"should unblock user in GitLab"
do
access
.
allowed?
access
.
allowed?
user
.
should_not
be_blocked
user
.
should_not
be_blocked
end
end
end
end
end
context
'without ActiveDirectory enabled'
do
context
'without ActiveDirectory enabled'
do
before
do
before
do
...
...
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