Harthelm Docs

Allow a repository

Editors and admins may add repositories they can read at the provider (checked through the provider API with the caller's connection); `write` needs push permission there. Adding an existing entry again changes its access.

Generated from openapi/harthelm.yaml at v1.5.0
POST
/workspaces/{ws}/git-access

Authorization

cookie__Host-harthelm_session<token>

Browser session of the UI (12 h idle, 7 days absolute). State-changing requests also need the header Harthelm-CSRF: 1 and a matching Origin.

Path Parameters

ws*integer

Numeric resource id.

Formatint64
Range1 <= value

Header Parameters

Idempotency-Key?string

Client-chosen key (at most 255 characters); a repeated key returns the first result for 24 h.

Length1 <= length <= 255

Request Body

application/json
  1. body
provider*GitProviderIDValue
Match^[a-z][a-z0-9-]{0,30}$
repo*string
Match^[A-Za-z0-9][A-Za-z0-9._-]{0,99}/[A-Za-z0-9][A-Za-z0-9._-]{0,99}$
access*GitAccessLevel

write also allows git push (receive-pack).

Value in"read""write"

Response Body

The entry.

application/json
  1. response
provider*string
repo*string

owner/name, lower case (the proxy compares case-insensitively).

access*GitAccessLevel

write also allows git push (receive-pack).

Value in"read""write"
origin*boolean

The repository the workspace was cloned from.

added_by?ID

Numeric resource id.

Formatint64
Range1 <= value
created_at*string
Formatdate-time
curl -X POST 'https://console.example.com/api/v1/workspaces/1/git-access' \  -H 'Content-Type: application/json' \  -d '{  "provider": "string",  "repo": "string",  "access": "read"}'
{  "provider": "string",  "repo": "string",  "access": "read",  "origin": true,  "added_by": 1,  "created_at": "2019-08-24T14:15:22Z"}