Based on existing tuleap REST api
Update GET /v1/projects/:id
Add in "resources":
{
"type": "git",
"uri": "projects/:id/git"
}
Add OPTIONS /v1/projects/:id/git
Add GET /v1/projects/:id/git
{
"repositories": [
{
"id": 123,
"uri": "/v1/git/123",
"name": "/projectname/repo/path.git",
"description": "bla"
},
...
]
}
GET /v1/projects/:id/git?full
{
"repositories": [
{
"id": :id,
"uri": "/v1/git/:id",
"name": "/projectname/repo/path.git",
"description": "bla",
"permissions": {
"read": [ <user_group_def> ],
"write": [ <user_group_def> ],
"rewind": [ <user_group_def> ]
}
},
...
]
}
Important => those 2 GET route must manage pagination
Add OPTIONS /v1/git/:id
Add GET /v1/git/:id
{
"id": :id,
"uri": "/v1/git/:id",
"name": "/projectname/repo/path.git",
"description": "bla",
"permissions": {
"read": [ <user_group_def> ],
"write": [ <user_group_def> ],
"rewind": [ <user_group_def> ]
}
}
<user group def> (for reference, already existing)
{
"id": "101_3",
"uri": "user_groups/101_3",
"label": "project_members",
"users_uri": "user_groups/101_3/users"
}
Permissions:
-
id, uri, name, description are accessible as long as the user has access to the repo
-
permissions are accessible only to git administrators