PILOT / CENTRAL
Engineering brief · 15 Oct 2026
Proposed · Read-only access

GitHub App authentication

Central approves repository access and issues temporary credentials. Pilot clones and fetches directly from GitHub.

01

One App. Central owns access.

Keep the App private key in Central. Give Pilot a token for one approved repository.

Central issues credentials; Pilot fetches code directlyPilot requests a token from Central. Central mints a GitHub installation token restricted to one repository. It returns the token and expiry to Pilot. Pilot clones and fetches directly from GitHub. PilotWorker + Git client CentralApp key + repository grants GitHubRepository source Request tokenMint token Token + expiryScoped · 1 hour Clone / fetch directly over HTTPS
Repository-scoped installation token · Contents: read · GitHub credentials stay out of the browser.
Central

App settings, team and server grants, selected repository IDs.

Pilot

Connection reference. Temporary token in a private process cache.

GitHub

App installation, repository permissions, token expiry.

02

Connect an account

Authenticate the person in Central, then approve the GitHub repositories.

Account connection sequenceThe browser starts in Pilot. Pilot creates a Central attempt. The browser signs in to Central and authorizes GitHub. Central verifies the callback and repository administration rights. The person confirms the selection. Pilot reads the saved connection status. BrowserPilotCentralGitHub Connect GitHub Create attempt Sign in; verify server access Authorize user¹ Code + state Verify repo rights Confirm repositories; save grant Read connection status
¹ Authorization uses browser redirects. Token exchange happens on Central’s backend. On small screens, scroll diagrams horizontally.
Central permissionserver:console

Reuse the existing IAM check on the exact target server. A Pilot admin session does not identify the Central user.

GitHub permissionRepository administrator

Verify the user’s right to grant ongoing deployment access. Read access alone is insufficient.

Already installed?

Choose an existing installation. Otherwise install the App and resume discovery. Organization approval may be required.

After confirmation

Save a team deployment grant. It continues after sign-out until an administrator or installation change removes access.

03

Endpoint contract

Proposed names. Machine calls use the verified Pilot credential; browser writes use the Central session.

Pilot Admin API

/api/v1
EndpointPurpose
POST /git/connection-attemptsReturn the Central authorization URL.
GET /git/connectionSafe connection status, account, and authentication method.
GET /git/repositories
GET /git/branches
Browse approved sources and branches. Return no credentials.
DELETE /git/connectionDisable the App grant in Central, then clear local state.

Keep the existing PAT request shape on PUT /git/connection. Records without auth_type remain PAT records.

Central GitHub API

/api/method/central.api.github.
Method + functionAuthenticationResult
POST start_connectionPilot credentialShort-lived attempt + connection URL. Derive team and server.
POST begin_authorizationCentral sessionCheck server:console; start state-bound authorization with PKCE.
GET oauth_callback
GET installation_setup
Bound session + stateExchange the code or resume installation discovery. Neither creates a deployment grant.
POST complete_connectionCentral sessionVerify repository rights. Save the selected repository grant once.
GET connections
GET repositories
Pilot credentialSafe summaries scoped to that credential.
POST repository_tokenPilot credentialOne repository token + expires_at. Backend only; no-store response.
POST disconnect_pilot
POST disconnect_connection
Pilot / Central sessionPilot removes its own grants. A Central user needs server:console.
POST webhookGitHub HMAC signatureProcess installation and repository access changes. Reconcile missed events.

Do not add token issuance to the existing site-scoped Central proxy. Only explicit backend methods on CentralClient can request GitHub credentials.

04

Data and access rules

Bind every grant to Central’s verified identity, not a supplied team ID or local bench path.

StateEssential fields
Central Settings
New GitHub tab
App ID, client ID, slug, private key, client secret, webhook secret. Secrets use Password fields.
GitHub Connection
New DocType + repository child rows
Team, server, Pilot Credential, installation ID, status, version, selected repository IDs. Unique on credential + installation.
Connection attempt
Expiring, site-scoped Redis
Target identity, user/session binding, state, PKCE verifier, encrypted temporary user token. Proposed expiry: 15 minutes.

Check both identities

The person needs server:console and verified GitHub administration rights. Token issuance checks the credential, current server/team ownership, active grant, and selected repository.

Limit the token

Use contents: read and an explicit repository ID. Recheck the grant version after the GitHub call. Reject stale results. Do not hold a database lock over that call.

Handle an outage

Running apps stay up. A valid cached token may still serve Git requests. New credentials need Central. Report unavailable separately from revoked access or rate limits.

Disconnect precisely

Block new issuance first. Clear reachable caches and revoke known tokens. Previously issued credentials can remain valid until revoked or expired. Keep other server grants intact.

Token issuance · essential pseudocode
grant = require_active_grant(credential, connection, repository_id)
token = github.create_installation_token(
    grant.installation_id,
    repository_ids=[repository_id],
    permissions={"contents": "read"},
)
if not grant_is_still_authorized(grant, credential):
    github.revoke_token(token)
    raise ConnectionChanged()
return token, token.expires_at
05

Implementation order

Approve the contract, then deliver one complete private-repository journey.

01 / CENTRAL

Authorize and issue

Add the settings, connection record, server-scoped permissions, and expiring attempts. Build GitHub calls under central/integrations/github.py and routes under central/api/github.py.

02 / PILOT

Resolve credentials once

Extend CentralClient. Use one Git credential resolver for API requests, CLI, and workers. Update settings/Git.vue and regenerate connection types. Preserve PAT and public-repository behavior.

03 / VERIFY

Prove recovery and isolation

Test cross-team denial, callback replay, expiry, disconnect races, missed webhooks, and Central outages. Verify a private clone and later fetch, including required private dependencies.