diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-21 00:07:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-21 00:07:30 +0300 |
commit | 5d7e5a8902382caaffa616e1b496b684ba72d148 (patch) | |
tree | 30d755b056cdd521071b0b23ce8c5823ad18e355 /lib/gitlab/auth | |
parent | cc4e1c884cd6b8782fb6a247d840a2d1c7f4603e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/auth')
-rw-r--r-- | lib/gitlab/auth/auth_finders.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/gitlab/auth/auth_finders.rb b/lib/gitlab/auth/auth_finders.rb index 16bee187c87..edcde55974c 100644 --- a/lib/gitlab/auth/auth_finders.rb +++ b/lib/gitlab/auth/auth_finders.rb @@ -121,6 +121,7 @@ module Gitlab # It is also used by GraphQL/API requests. # And to allow accessing /archive programatically as it was a big pain point # for users https://gitlab.com/gitlab-org/gitlab/-/issues/28978. + # Used for release downloading as well def find_user_from_web_access_token(request_format, scopes: [:api]) return unless access_token && valid_web_access_format?(request_format) @@ -301,6 +302,8 @@ module Gitlab api_request? when :archive archive_request? + when :download + download_request? end end @@ -352,6 +355,10 @@ module Gitlab current_request.path.include?('/-/archive/') end + def download_request? + current_request.path.include?('/downloads/') + end + def blob_request? current_request.path.include?('/raw/') end |