summaryrefslogtreecommitdiff
path: root/app/controllers/groups/dependency_proxy
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-06 15:10:05 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-06 15:10:05 +0000
commit07e0fae35c51cff088d6b2cbc6d844f421e16617 (patch)
treed0da7fe202abac1b1919673d1b40bb4597da8dac /app/controllers/groups/dependency_proxy
parent14b5bf2629cf6cd77fe9bb6108d4a6dc0963f6c1 (diff)
downloadgitlab-ce-07e0fae35c51cff088d6b2cbc6d844f421e16617.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/groups/dependency_proxy')
-rw-r--r--app/controllers/groups/dependency_proxy/application_controller.rb24
1 files changed, 7 insertions, 17 deletions
diff --git a/app/controllers/groups/dependency_proxy/application_controller.rb b/app/controllers/groups/dependency_proxy/application_controller.rb
index c6484ffb5f1..fd9db41f748 100644
--- a/app/controllers/groups/dependency_proxy/application_controller.rb
+++ b/app/controllers/groups/dependency_proxy/application_controller.rb
@@ -18,23 +18,14 @@ module Groups
def authenticate_user_from_jwt_token!
return unless dependency_proxy_for_private_groups?
- if Feature.enabled?(:dependency_proxy_deploy_tokens)
- authenticate_with_http_token do |token, _|
- @authentication_result = EMPTY_AUTH_RESULT
-
- found_user = user_from_token(token)
- sign_in(found_user) if found_user.is_a?(User)
- end
-
- request_bearer_token! unless authenticated_user
- else
- authenticate_with_http_token do |token, _|
- user = user_from_token(token)
- sign_in(user) if user
- end
-
- request_bearer_token! unless current_user
+ authenticate_with_http_token do |token, _|
+ @authentication_result = EMPTY_AUTH_RESULT
+
+ found_user = user_from_token(token)
+ sign_in(found_user) if found_user.is_a?(User)
end
+
+ request_bearer_token! unless authenticated_user
end
private
@@ -51,7 +42,6 @@ module Groups
def user_from_token(token)
token_payload = ::DependencyProxy::AuthTokenService.decoded_token_payload(token)
- return User.find(token_payload['user_id']) unless Feature.enabled?(:dependency_proxy_deploy_tokens)
if token_payload['user_id']
token_user = User.find(token_payload['user_id'])