Harthelm Docs

Register a Git provider for the organization

Organization owners (`org.manage`). Members of the organization then connect their account to it (`/auth/git/{ref}/start`) and the workspaces of its teams use it. Register an OAuth2 application at the provider first, with the redirect URI `https://<console>/auth/git/<ref>/callback`. The URL must be `https://`; loopback and link-local addresses (cloud metadata), names inside the cluster (`*.svc`, `*.<cluster domain>`), single-label names and IP literals of private ranges are refused with 422 `git-provider-url-refused`, whose `detail` says why. 409 `name-taken` when the organization has a provider with this id or URL, or the installation has a provider with this id. Registering a retired id again brings it back with the new fields. At most 20 active providers per organization (422).

Generated from openapi/harthelm.yaml at v1.6.1
POST
/orgs/{org}/git-providers

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

org*string
Formatuuid

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
id*OrgGitProviderID

A provider's id within its organization; its ref is <id>-<ref suffix>.

Match^[a-z][a-z0-9-]{0,21}$
kind?"gitea"

Gitea; Forgejo speaks the same API.

Default"gitea"
Value in"gitea"
name*string
Length1 <= length <= 64
url*string

https://host[:port][/path], no query.

Length9 <= length <= 255
client_id*string
Length1 <= length <= 255
client_secret*string
Formatpassword
Length1 <= length <= 4096
ca_pem?string

PEM certificates of a private CA.

Lengthlength <= 65536

Response Body

The provider.

application/json
  1. response
id*OrgGitProviderID

A provider's id within its organization; its ref is <id>-<ref suffix>.

Match^[a-z][a-z0-9-]{0,21}$
ref*string

The provider id everywhere else (/auth/git/{ref}, GET /git/providers, git access, the proxy path).

Match^[a-z][a-z0-9-]{0,30}$
org_id*string
Formatuuid
kind*"gitea"
Value in"gitea"
name*string
url*string

Web URL of the provider (https).

client_id*string
client_secret_set*boolean

The OAuth client secret is stored (it is never returned).

ca_set*boolean

A CA (PEM) for the provider's HTTPS is stored.

redirect_uri*string

Register this at the provider's OAuth2 application.

created_by?

A user as member lists show them.

created_at*string
Formatdate-time
updated_at*string
Formatdate-time
retired_at?string

Only with include_retired, on a retired provider.

Formatdate-time
curl -X POST 'https://console.example.com/api/v1/orgs/497f6eca-6276-4993-bfeb-53cbbbba6f08/git-providers' \  -H 'Content-Type: application/json' \  -d '{  "id": "string",  "name": "string",  "url": "stringstr",  "client_id": "string",  "client_secret": "pa$$word"}'
{  "id": "string",  "ref": "string",  "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b",  "kind": "gitea",  "name": "string",  "url": "string",  "client_id": "string",  "client_secret_set": true,  "ca_set": true,  "redirect_uri": "string",  "created_by": {    "id": 1,    "name": "string",    "email": "string",    "picture_url": "string"  },  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "retired_at": "2019-08-24T14:15:22Z"}