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
Boxiang Sun
gitlab-ce
Commits
4726ff9d
Commit
4726ff9d
authored
Mar 31, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test example for invalid registry access request
parent
60cdd2bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
app/services/auth/container_registry_authentication_service.rb
...ervices/auth/container_registry_authentication_service.rb
+0
-2
spec/services/auth/container_registry_authentication_service_spec.rb
...es/auth/container_registry_authentication_service_spec.rb
+11
-2
No files found.
app/services/auth/container_registry_authentication_service.rb
View file @
4726ff9d
...
@@ -64,8 +64,6 @@ module Auth
...
@@ -64,8 +64,6 @@ module Auth
end
end
def
process_repository_access
(
type
,
path
,
actions
)
def
process_repository_access
(
type
,
path
,
actions
)
# TODO, add specs for invalid paths
#
return
unless
path
.
valid?
return
unless
path
.
valid?
requested_project
=
path
.
repository_project
requested_project
=
path
.
repository_project
...
...
spec/services/auth/container_registry_authentication_service_spec.rb
View file @
4726ff9d
...
@@ -81,13 +81,13 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
...
@@ -81,13 +81,13 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
end
end
shared_examples
'container repository factory'
do
shared_examples
'container repository factory'
do
it
'creates a new containe repository resource'
do
it
'creates a new containe
r
repository resource'
do
expect
{
subject
}
expect
{
subject
}
.
to
change
{
project
.
container_repositories
.
count
}.
by
(
1
)
.
to
change
{
project
.
container_repositories
.
count
}.
by
(
1
)
end
end
end
end
shared_examples
'container repository factory'
do
shared_examples
'
not a
container repository factory'
do
it
'does not create a new container repository resource'
do
it
'does not create a new container repository resource'
do
expect
{
subject
}.
not_to
change
{
ContainerRepository
.
count
}
expect
{
subject
}.
not_to
change
{
ContainerRepository
.
count
}
end
end
...
@@ -183,6 +183,15 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
...
@@ -183,6 +183,15 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
it_behaves_like
'an inaccessible'
it_behaves_like
'an inaccessible'
it_behaves_like
'not a container repository factory'
it_behaves_like
'not a container repository factory'
end
end
context
'when repository name is invalid'
do
let
(
:current_params
)
do
{
scope:
'repository:invalid:push'
}
end
it_behaves_like
'an inaccessible'
it_behaves_like
'not a container repository factory'
end
end
end
context
'for internal project'
do
context
'for internal project'
do
...
...
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