Control permission to read source
A repository connection does not automatically permit i2x to read its source. A source-read consent names one run and one exact commit. It is short-lived, can be used once, and can be revoked.
Grant and revoke operations manage permission only. If the server has a source-transfer runtime configured, a separate read operation can consume the permission and hold the exact snapshot temporarily in memory. It never returns file contents or starts execution. Inspect sourceFetchEndpointAvailable to see whether that operation is configured.
Before granting permission
The run must have a current access selection and source digest, and its project must have a selected GitHub connection. An owner or maintainer must sign in as a human and complete fresh step-up authentication. The requested lifetime must fit within that authentication window.
Grant permission
POST /api/runs/{runId}/source-consents
Send exactly these fields:
commitSha: the full 40-character lowercase commit SHA.ttlSeconds: an integer from 1 to 300.idempotencyKey: 16–128 letters, digits, underscores or hyphens. Reusing the same request does not create another consent.acknowledgement: the exact valueALLOW_I2X_TO_READ_THIS_RUN_SOURCE.
The server binds the run, current source, repository and authenticated customer. Do not send a customer ID, session ID, repository token, password or source code.
Inspect permission
GET /api/runs/{runId}/source-consents
Current project members can inspect the commit, source digest, granting customer, expiry, revocation and use status. Session identifiers and credentials are excluded. A started status does not prove completion; a used or interrupted permission cannot be silently reused. Source-read completion does not establish independent verification.
New completed records can include a source-free snapshot receipt with package digest, file count, byte count and exclusion categories. These are runtime observations. Older records that retained only a digest explicitly report digest_only; missing details are not reconstructed.
The run's “Source-read permissions” section shows these details and provides grant, revoke and refresh controls. Grant availability and the maximum lifetime come from the server. The consent box starts unchecked, and users without fresh management authority can still inspect the permitted history.
Read the approved snapshot into memory
When enabled, send an empty JSON object to POST /api/runs/{runId}/source-consents/{consentDigest}/read. Use the same fresh authenticated human session that granted consent. In the run page, the server enables the separate ?Read approved snapshot into memory? button only for that session and a current unused permission. The response contains source-free snapshot metadata and a memory expiry. It contains no repository credential or source bytes. Repeating the request while that memory snapshot is available does not download it again.
Memory expires within the read permission window and is cleared on shutdown, source revocation or completion of a storage hand-off. After expiry or restart, grant a new read permission; an old one-use permission cannot silently download the source again. Reading into memory does not authorize persistent storage. To retain the snapshot, use the separate storage consent and staging operations.
Revoke permission
POST /api/runs/{runId}/source-consents/{consentDigest}/revoke with an empty JSON object.
An owner or maintainer with fresh step-up authentication can revoke it. Repeating revocation is safe. Revocation blocks further source requests and release of the downloaded result; credential cleanup remains allowed.
Responses
Unauthenticated requests return 401. Missing membership hides the run with 404. Insufficient authority returns 403; malformed input returns 400. Expired, changed or inconsistent scope returns 409. These routes accept no query parameters.
Download the OpenAPI specification · Repository connection guide