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).
openapi/harthelm.yaml at v1.6.1__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.
org*stringuuidIdempotency-Key?stringClient-chosen key (at most 255 characters); a repeated key returns the first result for 24 h.
1 <= length <= 255application/json- body
id*OrgGitProviderIDA provider's id within its organization; its ref is <id>-<ref suffix>.
^[a-z][a-z0-9-]{0,21}$kind?"gitea"Gitea; Forgejo speaks the same API.
"gitea""gitea"name*string1 <= length <= 64url*stringhttps://host[:port][/path], no query.
9 <= length <= 255client_id*string1 <= length <= 255client_secret*stringpassword1 <= length <= 4096ca_pem?stringPEM certificates of a private CA.
length <= 65536The provider.
application/json- response
id*OrgGitProviderIDA provider's id within its organization; its ref is <id>-<ref suffix>.
^[a-z][a-z0-9-]{0,21}$ref*stringThe provider id everywhere else (/auth/git/{ref}, GET /git/providers, git access, the proxy path).
^[a-z][a-z0-9-]{0,30}$org_id*stringuuidkind*"gitea""gitea"name*stringurl*stringWeb URL of the provider (https).
client_id*stringclient_secret_set*booleanThe OAuth client secret is stored (it is never returned).
ca_set*booleanA CA (PEM) for the provider's HTTPS is stored.
redirect_uri*stringRegister this at the provider's OAuth2 application.
created_by?A user as member lists show them.
created_at*stringdate-timeupdated_at*stringdate-timeretired_at?stringOnly with include_retired, on a retired provider.
date-timecurl -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"}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.
Disconnect a Git provider
Deletes the caller's stored tokens for the provider. Workspaces the caller owns can no longer clone or push through the git proxy until the caller connects again.