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
fad0be39
Commit
fad0be39
authored
Jan 14, 2021
by
David Fernandez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the nuget group level API url prefix
We need to have `-/` right before `packages/nuget`
parent
72d1f74c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
21 deletions
+21
-21
app/presenters/packages/nuget/service_index_presenter.rb
app/presenters/packages/nuget/service_index_presenter.rb
+2
-2
doc/user/packages/nuget_repository/index.md
doc/user/packages/nuget_repository/index.md
+4
-4
lib/api/nuget_group_packages.rb
lib/api/nuget_group_packages.rb
+1
-1
spec/requests/api/nuget_group_packages_spec.rb
spec/requests/api/nuget_group_packages_spec.rb
+14
-14
No files found.
app/presenters/packages/nuget/service_index_presenter.rb
View file @
fad0be39
...
...
@@ -100,7 +100,7 @@ module Packages
case
scope
when
:group
api_v4_groups_packages_nuget_metadata_package_name_package_version_path
(
api_v4_groups_
__
packages_nuget_metadata_package_name_package_version_path
(
params
,
true
)
...
...
@@ -115,7 +115,7 @@ module Packages
def
search_service_url
case
scope
when
:group
api_v4_groups_packages_nuget_query_path
(
id:
@project_or_group
.
id
)
api_v4_groups_
__
packages_nuget_query_path
(
id:
@project_or_group
.
id
)
when
:project
api_v4_projects_packages_nuget_query_path
(
id:
@project_or_group
.
id
)
end
...
...
doc/user/packages/nuget_repository/index.md
View file @
fad0be39
...
...
@@ -123,7 +123,7 @@ nuget source Add -Name "GitLab" -Source "https://gitlab.example.com/api/v4/proje
To use the
[
group-level
](
#use-the-gitlab-endpoint-for-nuget-packages
)
NuGet endpoint, add the Package Registry as a source with
`nuget`
:
```
shell
nuget
source
Add
-Name
<source_name>
-Source
"https://gitlab.example.com/api/v4/groups/<your_group_id>/packages/nuget/index.json"
-UserName
<gitlab_username or deploy_token_username>
-Password
<gitlab_personal_access_token or deploy_token>
nuget
source
Add
-Name
<source_name>
-Source
"https://gitlab.example.com/api/v4/groups/<your_group_id>/
-/
packages/nuget/index.json"
-UserName
<gitlab_username or deploy_token_username>
-Password
<gitlab_personal_access_token or deploy_token>
```
-
`<source_name>`
is the desired source name.
...
...
@@ -131,7 +131,7 @@ nuget source Add -Name <source_name> -Source "https://gitlab.example.com/api/v4/
For example:
```
shell
nuget
source
Add
-Name
"GitLab"
-Source
"https://gitlab.example.com/api/v4/groups/23/packages/nuget/index.json"
-UserName
carol
-Password
12345678asdf
nuget
source
Add
-Name
"GitLab"
-Source
"https://gitlab.example.com/api/v4/groups/23/
-/
packages/nuget/index.json"
-UserName
carol
-Password
12345678asdf
```
### Add a source with Visual Studio
...
...
@@ -173,7 +173,7 @@ To use the [group-level](#use-the-gitlab-endpoint-for-nuget-packages) NuGet endp
1.
Select
**Add**
.
1.
Complete the following fields:
-
**Name**
: Name for the source.
-
**Location**
:
`https://gitlab.example.com/api/v4/group
/<your_group_id>
/packages/nuget/index.json`
,
-
**Location**
:
`https://gitlab.example.com/api/v4/group
s/<your_group_id>/-
/packages/nuget/index.json`
,
where
`<your_group_id>`
is your group ID, and
`gitlab.example.com`
is
your domain name.
-
**Username**
: Your GitLab username or deploy token username.
...
...
@@ -227,7 +227,7 @@ To use the [group-level](#use-the-gitlab-endpoint-for-nuget-packages) Package Re
<configuration>
<packageSources>
<clear
/>
<add
key=
"gitlab"
value=
"https://gitlab.example.com/api/v4/group
/<your_group_id>
/packages/nuget/index.json"
/>
<add
key=
"gitlab"
value=
"https://gitlab.example.com/api/v4/group
s/<your_group_id>/-
/packages/nuget/index.json"
/>
</packageSources>
<packageSourceCredentials>
<gitlab>
...
...
lib/api/nuget_group_packages.rb
View file @
fad0be39
...
...
@@ -45,7 +45,7 @@ module API
end
resource
:groups
,
requirements:
API
::
NAMESPACE_OR_PROJECT_REQUIREMENTS
do
namespace
':id/packages/nuget'
do
namespace
':id/
-/
packages/nuget'
do
after_validation
do
# This API can't be accessed anonymously
require_authenticated!
...
...
spec/requests/api/nuget_group_packages_spec.rb
View file @
fad0be39
...
...
@@ -15,27 +15,27 @@ RSpec.describe API::NugetGroupPackages do
let
(
:target_type
)
{
'groups'
}
shared_examples
'handling all endpoints'
do
describe
'GET /api/v4/groups/:id/packages/nuget'
do
describe
'GET /api/v4/groups/:id/
-/
packages/nuget'
do
it_behaves_like
'handling nuget service requests'
,
anonymous_requests_example_name:
'rejects nuget packages access'
,
anonymous_requests_status: :unauthorized
do
let
(
:url
)
{
"/groups/
#{
target
.
id
}
/packages/nuget/index.json"
}
let
(
:url
)
{
"/groups/
#{
target
.
id
}
/
-/
packages/nuget/index.json"
}
end
end
describe
'GET /api/v4/groups/:id/packages/nuget/metadata/*package_name/index'
do
describe
'GET /api/v4/groups/:id/
-/
packages/nuget/metadata/*package_name/index'
do
it_behaves_like
'handling nuget metadata requests with package name'
,
anonymous_requests_example_name:
'rejects nuget packages access'
,
anonymous_requests_status: :unauthorized
do
let
(
:url
)
{
"/groups/
#{
target
.
id
}
/packages/nuget/metadata/
#{
package_name
}
/index.json"
}
let
(
:url
)
{
"/groups/
#{
target
.
id
}
/
-/
packages/nuget/metadata/
#{
package_name
}
/index.json"
}
end
end
describe
'GET /api/v4/groups/:id/packages/nuget/metadata/*package_name/*package_version'
do
describe
'GET /api/v4/groups/:id/
-/
packages/nuget/metadata/*package_name/*package_version'
do
it_behaves_like
'handling nuget metadata requests with package name and package version'
,
anonymous_requests_example_name:
'rejects nuget packages access'
,
anonymous_requests_status: :unauthorized
do
let
(
:url
)
{
"/groups/
#{
target
.
id
}
/packages/nuget/metadata/
#{
package_name
}
/
#{
package
.
version
}
.json"
}
let
(
:url
)
{
"/groups/
#{
target
.
id
}
/
-/
packages/nuget/metadata/
#{
package_name
}
/
#{
package
.
version
}
.json"
}
end
end
describe
'GET /api/v4/groups/:id/packages/nuget/query'
do
describe
'GET /api/v4/groups/:id/
-/
packages/nuget/query'
do
it_behaves_like
'handling nuget search requests'
,
anonymous_requests_example_name:
'rejects nuget packages access'
,
anonymous_requests_status: :unauthorized
do
let
(
:url
)
{
"/groups/
#{
target
.
id
}
/packages/nuget/query?
#{
query_parameters
.
to_query
}
"
}
let
(
:url
)
{
"/groups/
#{
target
.
id
}
/
-/
packages/nuget/query?
#{
query_parameters
.
to_query
}
"
}
end
end
end
...
...
@@ -94,21 +94,21 @@ RSpec.describe API::NugetGroupPackages do
end
end
describe
'GET /api/v4/groups/:id/packages/nuget/metadata/*package_name/index'
do
describe
'GET /api/v4/groups/:id/
-/
packages/nuget/metadata/*package_name/index'
do
it_behaves_like
'handling mixed visibilities'
do
let
(
:url
)
{
"/groups/
#{
target
.
id
}
/packages/nuget/metadata/
#{
package_name
}
/index.json"
}
let
(
:url
)
{
"/groups/
#{
target
.
id
}
/
-/
packages/nuget/metadata/
#{
package_name
}
/index.json"
}
end
end
describe
'GET /api/v4/groups/:id/packages/nuget/metadata/*package_name/*package_version'
do
describe
'GET /api/v4/groups/:id/
-/
packages/nuget/metadata/*package_name/*package_version'
do
it_behaves_like
'handling mixed visibilities'
do
let
(
:url
)
{
"/groups/
#{
target
.
id
}
/packages/nuget/metadata/
#{
package_name
}
/
#{
packages
.
first
.
version
}
.json"
}
let
(
:url
)
{
"/groups/
#{
target
.
id
}
/
-/
packages/nuget/metadata/
#{
package_name
}
/
#{
packages
.
first
.
version
}
.json"
}
end
end
describe
'GET /api/v4/groups/:id/packages/nuget/query'
do
describe
'GET /api/v4/groups/:id/
-/
packages/nuget/query'
do
it_behaves_like
'handling mixed visibilities'
do
let
(
:url
)
{
"/groups/
#{
target
.
id
}
/packages/nuget/query?
#{
query_parameters
.
to_query
}
"
}
let
(
:url
)
{
"/groups/
#{
target
.
id
}
/
-/
packages/nuget/query?
#{
query_parameters
.
to_query
}
"
}
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