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
9c83df70
Commit
9c83df70
authored
Dec 07, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix job token authentication in EE
parent
2ed6b736
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
ee/lib/ee/gitlab/auth/user_auth_finders.rb
ee/lib/ee/gitlab/auth/user_auth_finders.rb
+1
-3
No files found.
ee/lib/ee/gitlab/auth/user_auth_finders.rb
View file @
9c83df70
...
...
@@ -7,21 +7,19 @@ module EE
JOB_TOKEN_HEADER
=
"HTTP_JOB_TOKEN"
.
freeze
JOB_TOKEN_PARAM
=
:job_token
# rubocop: disable CodeReuse/ActiveRecord
def
find_user_from_job_token
return
unless
route_authentication_setting
[
:job_token_allowed
]
token
=
(
params
[
JOB_TOKEN_PARAM
]
||
env
[
JOB_TOKEN_HEADER
]).
to_s
return
unless
token
.
present?
job
=
::
Ci
::
Build
.
find_by
(
token:
token
)
job
=
::
Ci
::
Build
.
find_by
_token
(
token
)
raise
::
Gitlab
::
Auth
::
UnauthorizedError
unless
job
@job_token_authentication
=
true
# rubocop:disable Gitlab/ModuleWithInstanceVariables
job
.
user
end
# rubocop: enable CodeReuse/ActiveRecord
end
end
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