Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2018-06-12 18:54:37 +0300
committerJan Provaznik <jprovaznik@gitlab.com>2018-06-18 10:11:02 +0300
commit656d4ebf67b597e012f97edd04432e402d26fbc2 (patch)
tree47f64eb022598a158cece229d18b0450f0121573 /app/controllers/projects/uploads_controller.rb
parent937c1b5be91be4b500fa7cc1faf5d1aabbd16d41 (diff)
Add workhorse authorize method for project/group uploads
This method can be used by workhorse to get presigned URLs used for direct upload of files.
Diffstat (limited to 'app/controllers/projects/uploads_controller.rb')
-rw-r--r--app/controllers/projects/uploads_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/projects/uploads_controller.rb b/app/controllers/projects/uploads_controller.rb
index f5cf089ad98..7a85046164c 100644
--- a/app/controllers/projects/uploads_controller.rb
+++ b/app/controllers/projects/uploads_controller.rb
@@ -1,11 +1,13 @@
class Projects::UploadsController < Projects::ApplicationController
include UploadsActions
+ include WorkhorseRequest
# These will kick you out if you don't have access.
skip_before_action :project, :repository,
if: -> { action_name == 'show' && image_or_video? }
- before_action :authorize_upload_file!, only: [:create]
+ before_action :authorize_upload_file!, only: [:create, :authorize]
+ before_action :verify_workhorse_api!, only: [:authorize]
private