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
d34aaa8c
Commit
d34aaa8c
authored
Feb 24, 2020
by
Giorgenes Gelatti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor scim to improve code quality
parent
2b3ac7af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
ee/lib/api/scim.rb
ee/lib/api/scim.rb
+7
-5
No files found.
ee/lib/api/scim.rb
View file @
d34aaa8c
...
...
@@ -45,16 +45,18 @@ module API
render_scim_error
(
EE
::
Gitlab
::
Scim
::
Conflict
,
message
)
end
def
check_access_to_group!
(
group
)
token
=
Doorkeeper
::
OAuth
::
Token
.
from_request
(
current_request
,
*
Doorkeeper
.
configuration
.
access_token_methods
)
unauthorized!
unless
token
&&
ScimOauthAccessToken
.
token_matches_for_group?
(
token
,
group
)
end
def
find_and_authenticate_group!
(
group_path
)
group
=
find_group
(
group_path
)
scim_not_found!
(
message:
"Group
#{
group_path
}
not found"
)
unless
group
token
=
Doorkeeper
::
OAuth
::
Token
.
from_request
(
current_request
,
*
Doorkeeper
.
configuration
.
access_token_methods
)
unauthorized!
unless
token
scim_token
=
ScimOauthAccessToken
.
token_matches_for_group?
(
token
,
group
)
unauthorized!
unless
scim_token
check_access_to_group!
(
group
)
group
end
...
...
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