Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
before_action :disable_strong_params
before_action :confirm_settings
skip_before_action :authorize
before_action :token_request_type_check, only: [:token]
before_action :optional_authorize, only: [:token, :catalog]
before_action :registry_authorize, except: [:token, :v1_search, :catalog, :static_index]
before_action :authorize_repository_read, only: [:pull_manifest, :tags_list, :check_blob, :pull_blob]
before_action :container_push_prop_validation, only: [:start_upload_blob, :upload_blob, :finish_upload_blob, :push_manifest]
before_action :create_container_repo_if_needed, only: [:start_upload_blob, :upload_blob, :finish_upload_blob, :push_manifest]
skip_before_action :check_media_type, only: [:start_upload_blob, :upload_blob, :finish_upload_blob,
skip_before_action :check_media_type, only: [:start_upload_blob, :token, :upload_blob, :finish_upload_blob,
:push_manifest]

wrap_parameters false
Expand Down Expand Up @@ -56,6 +57,12 @@
end
end

def token_request_type_check
if request.post?

Check failure on line 61 in app/controllers/katello/api/registry/registry_proxies_controller.rb

View workflow job for this annotation

GitHub Actions / Rubocop / Rubocop

Layout/IndentationWidth: Use 2 (not 3) spaces for indentation.
head :not_found and return
end
end

def redirect_authorization_headers
response.headers['Docker-Distribution-API-Version'] = 'registry/2.0'
response.headers['Www-Authenticate'] = "Bearer realm=\"#{request_url}/v2/token\"," \
Expand Down
Loading