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
1b350d99
Commit
1b350d99
authored
Mar 01, 2019
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update controller and group
parent
e9b2253f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
9 deletions
+30
-9
ee/app/controllers/groups/scim_oauth_controller.rb
ee/app/controllers/groups/scim_oauth_controller.rb
+27
-9
ee/app/models/ee/group.rb
ee/app/models/ee/group.rb
+1
-0
ee/config/routes/group.rb
ee/config/routes/group.rb
+2
-0
No files found.
ee/app/controllers/groups/scim_oauth_controller.rb
View file @
1b350d99
# frozen_string_literal: true
class
Groups::ScimOauthController
<
Groups
::
ApplicationController
before_action
:require_top_level_group
before_action
:authorize_manage_saml!
before_action
:check_group_saml_available!
before_action
:check_group_saml_configured
# before_action :require_top_level_group
# before_action :authorize_manage_saml!
# before_action :check_group_saml_available!
# before_action :check_group_saml_configured
skip_before_filter
:verify_authenticity_token
def
show
@saml_provider
=
@group
.
saml_provider
||
@group
.
build_saml_provider
scim_token
=
ScimOauthAccessToken
.
find_by_group_id
(
@group
.
id
)
respond_to
do
|
format
|
format
.
json
do
if
scim_token
render
json:
ScimOauthAccessTokenEntity
.
new
(
scim_token
).
as_json
else
render
json:
{}
end
end
end
end
def
create
@saml_provider
=
@group
.
build_saml_provider
(
saml_provider_params
)
@saml_provider
.
save
scim_token
=
ScimOauthAccessToken
.
safe_find_or_create_by
(
group:
@group
)
render
:show
respond_to
do
|
format
|
format
.
json
do
if
scim_token
&
.
valid?
render
json:
ScimOauthAccessTokenEntity
.
new
(
scim_token
).
as_json
else
render
json:
{
errors:
scim_token
&
.
errors
&
.
full_messages
},
status: :unprocessable_entity
end
end
end
end
end
ee/app/models/ee/group.rb
View file @
1b350d99
...
...
@@ -20,6 +20,7 @@ module EE
has_one
:saml_provider
has_one
:insight
,
foreign_key: :namespace_id
accepts_nested_attributes_for
:insight
has_one
:scim_ouath_access_token
,
dependent: :destroy
has_many
:ldap_group_links
,
foreign_key:
'group_id'
,
dependent: :destroy
# rubocop:disable Cop/ActiveRecordDependent
has_many
:hooks
,
dependent: :destroy
,
class_name:
'GroupHook'
# rubocop:disable Cop/ActiveRecordDependent
...
...
ee/config/routes/group.rb
View file @
1b350d99
...
...
@@ -89,6 +89,8 @@ constraints(::Constraints::GroupUrlConstrainer.new) do
delete
:unlink
,
to:
'sso#unlink'
end
resource
:scim_oauth
,
only:
[
:show
,
:create
],
controller: :scim_oauth
resource
:roadmap
,
only:
[
:show
],
controller:
'roadmap'
legacy_ee_group_boards_redirect
=
redirect
do
|
params
,
request
|
...
...
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