Forge connections
Forge connections link Jaah and its users to GitHub, GitLab, Bitbucket and Azure DevOps. See which GitHub organizations your connection reaches, manage each user's per-forge connection, and list, create and initialize the repositories those connections reach.
Get GitHub organization access
Reports, for each GitHub owner behind the projects the current user can view, whether their connected GitHub account reaches it: `ok`, `approval_required` (the organization restricts OAuth app access until an owner approves Jaah) or `sso_required` (the user must authorize Jaah for the organization's single sign-on), with `approve_url`, where the user requests that approval or authorization. `state` is `unknown` when this cannot be determined, and an owner whose answer is unclear is left out.
List repositories your git connections reach
Lists every repository the current user's own git connections reach, across every connected forge and every organization or workspace in it, with its URL, owner and name. Each connected forge is reported in `sources`: `failed` or `truncated` means its list is incomplete.
Create a repository
Creates a private repository under an owner the current user's own git connection reaches, with `main` and `develop`, and returns its URL. The owner is one the owner list offers: an account, organization, group, workspace, or Azure DevOps `organization/project`.
Get a repository's default branch
Returns a repository's default branch as its forge reports it, and whether it has no branch at all (`empty`), read through the current user's own git connection for that forge. Each is null when the URL is not a repository URL, the forge is not connected, or the forge cannot be read.
Initialize an empty repository
Gives an empty repository (no branch, zero commits) a `main` branch, whose first commit adds README.md and .gitignore, and a `develop` branch from it, through the current user's own git connection. A repository that has any branch is left alone and answers `initialized: false`.
List owners you can create a repository in
Lists every owner the current user's own git connections may create a repository in, with or without repositories: their own account, and each organization, group, workspace or Azure DevOps `organization/project` they may create in. Each connected forge is reported in `sources`: `failed` or `truncated` means the list is incomplete.
List git connections
Lists the current user's git connections for each forge plus each self-managed GitLab they connected: one entry per connected account, the forge's default account first, each with its state: `connected`, `needs_reconnect` or `not_connected`. Only the caller's own user id is accepted; any other returns 404.
Delete git connection
Disconnects one account, or with no `credential_id` every account, of the caller's git connections on one forge host; the host's next account becomes its default. Other connections and the credential itself stay in place. Returns 204 with no body.
Set git connection
Connects an existing git credential as one more account on the forge host named in the path for the caller, or with `make_default` makes it that host's default account; only the caller's own user id is accepted (404 otherwise). The credential must be one the caller may use, of a git type and for that host, or it returns 422. Returns the updated connection.
Save a pasted git connection
Connects a forge host with a pasted personal access credential after testing it against the forge; a rejected one returns 422 with the forge's reason. Stores it as the caller's own credential, replacing an earlier paste for the same host, and returns 201 with the connection.
List a user's git connections by forge
Lists the git credentials a given user may use, with id, name and type, for choosing their git access. Pass `root` to keep only credentials for one forge host. Requires permission to view users.