Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b321324e
Commit
b321324e
authored
Jul 01, 2021
by
Jaime Martinez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature flag allow_archive_as_web_access_format
parent
31fd5496
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
config/feature_flags/development/allow_archive_as_web_access_format.yml
..._flags/development/allow_archive_as_web_access_format.yml
+8
-0
lib/gitlab/auth/auth_finders.rb
lib/gitlab/auth/auth_finders.rb
+1
-1
spec/lib/gitlab/auth/auth_finders_spec.rb
spec/lib/gitlab/auth/auth_finders_spec.rb
+12
-0
No files found.
config/feature_flags/development/allow_archive_as_web_access_format.yml
0 → 100644
View file @
b321324e
---
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
lib/gitlab/auth/auth_finders.rb
View file @
b321324e
...
@@ -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
...
...
spec/lib/gitlab/auth/auth_finders_spec.rb
View file @
b321324e
...
@@ -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'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment