i2x
← Return to i2x
Repository connection guide

GitLab.com, Bitbucket Cloud and self-hosted Git

For a selected GitHub repository, see the separate source-read consent API. Managing consent does not itself fetch source or start execution.

i2x stores a governed repository identity, not your repository credential. The customer-side runtime supplies an authorized credential only to the selected provider when a read is allowed.

  1. Select one exact repositoryRecord its provider, HTTPS origin, namespace, name and immutable provider ID in authenticated project settings.
  2. Keep authentication in your runtimeNever paste an access token, password, SSH key or model credential into the browser. Configure HTTPS credentials in the customer-side runtime, or select its existing SSH agent together with an exact known-hosts file.
  3. Choose the remote sourceSave the project connection as read-only. This grants no repository administration, release or recovery authority.
  4. Run bounded workThe runtime presents the credential only to the exact provider origin. Returned source must match the expected canonical digest before it is accepted.
  5. Revoke when finishedRevocation blocks future reads immediately while retaining the non-secret governance history.
Verified boundaryLocal automated acceptance covers GitLab branch, complete paginated root-tree and bounded gzip archive reads; Bitbucket branch, shallow-tree and bounded gzip archive reads; and self-hosted Git HTTPS and SSH-agent fetch. SSH requires non-interactive mode, strict host-key checking and a customer-runtime known-hosts file. Live-provider acceptance is not yet claimed.

What disconnecting stops

Each read stays bound to the repository connection you selected. Supplying another repository profile cannot override that selection. If you disconnect or replace the connection while credentials are being retrieved, i2x refuses to start the request. It checks the connection again before each HTTP request, including the next page of a paginated result.

If access changes while a response is arriving, i2x refuses to hand the result to the source consumer. It checks again after consumption and before saving a successful acceptance receipt. A replacement connection cannot inherit a read started under the previous connection.

Disconnecting does not recall a request already sent, erase information already consumed, or revoke the credential at its provider. Revoke or rotate that credential with the provider when needed. SSH authentication uses the selected customer agent and pinned known-hosts file; it does not use the HTTP credential flow.

Authenticated API

GET /api/projects/{id}/git-connection
Read current non-secret identity and revocation history.
POST /api/projects/{id}/git-connection
Save provider, base URL, namespace, name, immutable provider ID and customer-runtime authentication mode. Unknown fields and credentials are rejected.
POST /api/projects/{id}/git-connection-revoke
Revoke the current connection with an explicit reason and idempotency key.

These endpoints do not accept or return repository credentials. Coding-agent subscription credentials remain separate and customer-held.

GitLab.com uses one immutable numeric project ID and supports nested group namespaces. For this REST workflow, create a token with read_api, not the write-capable api scope. Prefer a project access token because it is limited to one project; on GitLab.com that token type requires Premium or Ultimate, so Free customers can instead use a personal token or OAuth bearer with read-only API access. i2x can prove that the requested reads succeeded, but it cannot independently prove an opaque token's configured scopes. Project/personal access tokens are sent only as GitLab's PRIVATE-TOKEN request header; OAuth uses Authorization: Bearer. Archive reads explicitly exclude resolved LFS blobs and require an independently supplied canonical source digest.

Self-hosted Git supports slash-separated nested namespaces such as platform/payments. Each segment is validated and encoded separately; traversal, empty segments and cross-origin repository URLs are rejected.