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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
1cdc76f4
Commit
1cdc76f4
authored
May 23, 2017
by
Maxime Visonneau
Committed by
Lin Jen-Shin
Aug 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented star auth capabilities on docker registry to enable deletion of images
parent
a210ddaa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
6 deletions
+28
-6
spec/services/auth/container_registry_authentication_service_spec.rb
...es/auth/container_registry_authentication_service_spec.rb
+28
-6
No files found.
spec/services/auth/container_registry_authentication_service_spec.rb
View file @
1cdc76f4
...
...
@@ -163,7 +163,9 @@ describe Auth::ContainerRegistryAuthenticationService do
end
context
'disallow reporter to delete images'
do
before
{
project
.
team
<<
[
current_user
,
:reporter
]
}
before
do
project
.
add_reporter
(
current_user
)
end
let
(
:current_params
)
do
{
scope:
"repository:
#{
project
.
path_with_namespace
}
:*"
}
...
...
@@ -230,6 +232,14 @@ describe Auth::ContainerRegistryAuthenticationService do
it_behaves_like
'not a container repository factory'
end
context
'disallow anyone to delete images'
do
let
(
:current_params
)
do
{
scope:
"repository:
#{
project
.
path_with_namespace
}
:*"
}
end
it_behaves_like
'an inaccessible'
end
context
'when repository name is invalid'
do
let
(
:current_params
)
do
{
scope:
'repository:invalid:push'
}
...
...
@@ -280,13 +290,25 @@ describe Auth::ContainerRegistryAuthenticationService do
end
context
'for external user'
do
let
(
:current_user
)
{
create
(
:user
,
external:
true
)
}
let
(
:current_params
)
do
{
scope:
"repository:
#{
project
.
full_path
}
:pull,push,*"
}
context
'disallow anyone to pull or push images'
do
let
(
:current_user
)
{
create
(
:user
,
external:
true
)
}
let
(
:current_params
)
do
{
scope:
"repository:
#{
project
.
path_with_namespace
}
:pull,push"
}
end
it_behaves_like
'an inaccessible'
it_behaves_like
'not a container repository factory'
end
it_behaves_like
'an inaccessible'
it_behaves_like
'not a container repository factory'
context
'disallow anyone to delete images'
do
let
(
:current_user
)
{
create
(
:user
,
external:
true
)
}
let
(
:current_params
)
do
{
scope:
"repository:
#{
project
.
path_with_namespace
}
:*"
}
end
it_behaves_like
'an inaccessible'
it_behaves_like
'not a container repository factory'
end
end
end
end
...
...
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