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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
84e40a7d
Commit
84e40a7d
authored
Mar 03, 2019
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature flag and small refactor
parent
ae06ea33
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
3 deletions
+7
-3
ee/changelogs/unreleased/5014-automatically-deprovision-users-when-removed-from-a-configured-identity-provider.yml
...sers-when-removed-from-a-configured-identity-provider.yml
+1
-2
ee/lib/api/scim.rb
ee/lib/api/scim.rb
+1
-0
ee/lib/ee/api/helpers.rb
ee/lib/ee/api/helpers.rb
+4
-0
ee/spec/lib/gitlab/scim/params_parser_spec.rb
ee/spec/lib/gitlab/scim/params_parser_spec.rb
+1
-1
No files found.
ee/changelogs/unreleased/5014-automatically-deprovision-users-when-removed-from-a-configured-identity-provider.yml
View file @
84e40a7d
---
---
title
:
Resolve Automatically deprovision users when removed from a configured identity
title
:
Automatically deprovision and update users from a configured identity via SCIM
provider
merge_request
:
9388
merge_request
:
9388
author
:
author
:
type
:
added
type
:
added
ee/lib/api/scim.rb
View file @
84e40a7d
...
@@ -37,6 +37,7 @@ module API
...
@@ -37,6 +37,7 @@ module API
resource
:Users
do
resource
:Users
do
before
do
before
do
check_group_scim_enabled
(
find_group
(
params
[
:group
]))
check_group_saml_configured
check_group_saml_configured
end
end
...
...
ee/lib/ee/api/helpers.rb
View file @
84e40a7d
...
@@ -135,6 +135,10 @@ module EE
...
@@ -135,6 +135,10 @@ module EE
unauthorized!
unless
can?
(
current_user
,
:admin_group_saml
,
group
)
unauthorized!
unless
can?
(
current_user
,
:admin_group_saml
,
group
)
end
end
def
check_group_scim_enabled
(
group
)
forbidden!
(
'Group SCIM not enabled.'
)
unless
Feature
.
enabled?
(
:group_scim
,
group
)
end
def
check_group_saml_configured
def
check_group_saml_configured
forbidden!
(
'Group SAML not enabled.'
)
unless
::
Gitlab
::
Auth
::
GroupSaml
::
Config
.
enabled?
forbidden!
(
'Group SAML not enabled.'
)
unless
::
Gitlab
::
Auth
::
GroupSaml
::
Config
.
enabled?
end
end
...
...
ee/spec/lib/gitlab/scim/params_parser_spec.rb
View file @
84e40a7d
...
@@ -36,7 +36,7 @@ describe EE::Gitlab::Scim::ParamsParser do
...
@@ -36,7 +36,7 @@ describe EE::Gitlab::Scim::ParamsParser do
expect
(
described_class
.
new
(
operations:
operations
).
deprovision_user?
).
to
be
true
expect
(
described_class
.
new
(
operations:
operations
).
deprovision_user?
).
to
be
true
end
end
it
'returns
an empty hash for the wrong operations
'
do
it
'returns
false when not deprovisioning
'
do
operations
=
[{
"op"
:
"Replace"
,
"path"
:
"active"
,
"value"
:
"True"
}]
operations
=
[{
"op"
:
"Replace"
,
"path"
:
"active"
,
"value"
:
"True"
}]
expect
(
described_class
.
new
(
operations:
operations
).
deprovision_user?
).
to
be
false
expect
(
described_class
.
new
(
operations:
operations
).
deprovision_user?
).
to
be
false
...
...
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