Commit b321324e authored by Jaime Martinez's avatar Jaime Martinez

Add feature flag allow_archive_as_web_access_format

parent 31fd5496
---
name: allow_archive_as_web_access_format
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64471
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/334944
milestone: '14.1'
type: development
group: group::release
default_enabled: false
...@@ -272,7 +272,7 @@ module Gitlab ...@@ -272,7 +272,7 @@ module Gitlab
when :api when :api
api_request? api_request?
when :archive when :archive
archive_request? archive_request? if Feature.enabled?(:allow_archive_as_web_access_format, default_enabled: :yaml)
end end
end end
......
...@@ -496,6 +496,18 @@ RSpec.describe Gitlab::Auth::AuthFinders do ...@@ -496,6 +496,18 @@ RSpec.describe Gitlab::Auth::AuthFinders do
expect(find_user_from_web_access_token(:archive)).to eq(user) expect(find_user_from_web_access_token(:archive)).to eq(user)
end end
context 'when allow_archive_as_web_access_format feature flag is disabled' do
before do
stub_feature_flags(allow_archive_as_web_access_format: false)
end
it 'returns nil for ARCHIVE requests' do
set_header('SCRIPT_NAME', '/-/archive/main.zip')
expect(find_user_from_web_access_token(:archive)).to be_nil
end
end
context 'for API requests' do context 'for API requests' do
it 'returns the user' do it 'returns the user' do
set_header('SCRIPT_NAME', '/api/endpoint') set_header('SCRIPT_NAME', '/api/endpoint')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment