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
4474eab4
Commit
4474eab4
authored
May 20, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix container deletion permission issue
parent
ec866445
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
app/services/auth/container_registry_authentication_service.rb
...ervices/auth/container_registry_authentication_service.rb
+1
-1
app/views/projects/container_registry/index.html.haml
app/views/projects/container_registry/index.html.haml
+1
-1
spec/services/auth/container_registry_authentication_service_spec.rb
...es/auth/container_registry_authentication_service_spec.rb
+12
-1
No files found.
app/services/auth/container_registry_authentication_service.rb
View file @
4474eab4
...
@@ -20,7 +20,7 @@ module Auth
...
@@ -20,7 +20,7 @@ module Auth
token
.
issuer
=
registry
.
issuer
token
.
issuer
=
registry
.
issuer
token
.
audience
=
AUDIENCE
token
.
audience
=
AUDIENCE
token
[
:access
]
=
names
.
map
do
|
name
|
token
[
:access
]
=
names
.
map
do
|
name
|
{
type:
'repository'
,
name:
name
,
actions:
%w(
pull push
)
}
{
type:
'repository'
,
name:
name
,
actions:
%w(
*
)
}
end
end
token
.
encoded
token
.
encoded
end
end
...
...
app/views/projects/container_registry/index.html.haml
View file @
4474eab4
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
%hr
%hr
%ul
.content-list
%ul
.content-list
.light.prepend-top-default
%li
.light.prepend-top-default
%p
%p
A 'container image' is a snapshot of a container.
A 'container image' is a snapshot of a container.
You can host your container images with GitLab.
You can host your container images with GitLab.
...
...
spec/services/auth/container_registry_authentication_service_spec.rb
View file @
4474eab4
...
@@ -10,7 +10,7 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
...
@@ -10,7 +10,7 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
subject
{
described_class
.
new
(
current_project
,
current_user
,
current_params
).
execute
}
subject
{
described_class
.
new
(
current_project
,
current_user
,
current_params
).
execute
}
before
do
before
do
stub_container_registry_config
(
enabled:
true
,
issuer:
'rspec'
,
key:
nil
)
allow
(
Gitlab
.
config
.
registry
).
to
receive_messages
(
enabled:
true
,
issuer:
'rspec'
,
key:
nil
)
allow_any_instance_of
(
JSONWebToken
::
RSAToken
).
to
receive
(
:key
).
and_return
(
rsa_key
)
allow_any_instance_of
(
JSONWebToken
::
RSAToken
).
to
receive
(
:key
).
and_return
(
rsa_key
)
end
end
...
@@ -60,6 +60,17 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
...
@@ -60,6 +60,17 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
it
{
is_expected
.
to_not
include
(
:token
)
}
it
{
is_expected
.
to_not
include
(
:token
)
}
end
end
describe
'#full_access_token'
do
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:token
)
{
described_class
.
full_access_token
(
project
.
path_with_namespace
)
}
subject
{
{
token:
token
}
}
it_behaves_like
'a accessible'
do
let
(
:actions
)
{
[
'*'
]
}
end
end
context
'user authorization'
do
context
'user authorization'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:current_user
)
{
create
(
:user
)
}
let
(
:current_user
)
{
create
(
:user
)
}
...
...
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