Skip to content

feat(hub): add organization Copilot authentication - #227

Merged
alliscode merged 7 commits into
build/hub/newfrom
alliscode-github-app-copilot-auth
Nov 16, 2026
Merged

alliscode merged 7 commits into
build/hub/newfrom
alliscode-github-app-copilot-auth

Conversation

@alliscode

@alliscode alliscode commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Why

Hub needs a production Copilot credential that is billed to the organization instead of a personal administrator. The connection must keep GitHub App identity, organization policy, budget, and revocation authoritative without storing installation tokens.

What changes

Hub can now select an explicit github-app-installation provider. It verifies the configured App, organization, installation, and read-only Copilot Requests permission, signs through a replaceable boundary, and mints a fresh installation token for each learning command. Removed installations and denied permissions fail closed without falling back to a personal credential, while transient GitHub failures remain retryable.

flowchart LR
  Hub[Hub command] --> Signer[App JWT signer]
  Signer --> Installation[Verify organization installation]
  Installation --> Token[Fresh read-only installation token]
  Token --> Learning[replica-learning command]
  Learning --> Copilot[Copilot requests billed to organization]
Loading

The organization provider plugs into Hub's existing fresh-authorization and connection lifecycle. Connection status, security audits, and administrator wording identify the billed organization and GitHub App. The Copilot SDK is upgraded to the newest stable release outside the seven-day cooldown, 1.0.28, in Hub and the packaged learning command.

Storybook screenshots

Hub/Pages/Security/Copilot / Organization Installation — dark theme, 1280×720

Integrated organization installation story, dark theme, 1280 by 720

Hub/Pages/Security/Copilot / Connected Organization Installation — dark theme, 1280×720

Integrated connected organization installation story, dark theme, 1280 by 720

Hub/Pages/Security/Copilot / No Token — dark theme, 1280×720

Integrated no credential provider story, dark theme, 1280 by 720

@alliscode
alliscode requested review from a team and nshki as code owners November 12, 2026 18:49
Copilot AI adaptive review requested due to automatic review settings November 12, 2026 18:49
@alliscode
alliscode added this pull request to stack #228 November 12, 2026 18:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

An incorrect GitHub permission key blocks valid installations, transient failures can trigger terminal refusals, and disconnect can throw when no credential provider is present.

11 open issues
2 files not reviewed
  • hub/package-lock.json: Generated file
  • packages/learning/package-lock.json: Generated file
What changed in this PR

This PR adds a GitHub App installation credential provider for organization-billed Copilot access in Hub’s learning commands, alongside the existing explicit local providers.

Changes:

  • Adds App JWT signing, installation verification, fresh token acquisition, and credential-failure classification.
  • Exposes organization and App identity through connection status, security audits, administrator copy, and stories.
  • Documents configuration and upgrades the Copilot SDK to 1.0.28 in Hub and the learning package.
File Description
packages/​learning/​package.json Updates the optional Copilot SDK pin.
packages/​learning/​package-lock.json Locks the updated SDK and platform packages.
hub/​server/​routes/​api/​security-audits/​present-security-audit/​index.ts Presents App and billed-organization audit fields.
hub/​server/​routes/​api/​security-audits/​present-security-audit/​index.test.ts Adds identity projection coverage.
hub/​server/​routes/​api/​copilot-connection/​types.ts Adds credential identity to route dependencies.
hub/​server/​routes/​api/​copilot-connection/​create-copilot-connection-route-dependencies/​index.ts Passes provider identity into disconnection.
hub/​server/​routes/​api/​copilot-connection/​contract.ts Defines the credential-identity response shape.
hub/​server/​routes/​api/​copilot-connection/​connect/​post/​index.ts Maps new credential refusals to HTTP responses.
hub/​server/​repositories/​security-audits/​parse-security-audit-event/​index.ts Accepts organization credential audit fields.
hub/​server/​repositories/​security-audits/​get-security-audit-data/​index.ts Includes credential identity in stored audit context.
hub/​server/​repositories/​security-audits/​create-security-audit/​types.ts Extends typed Copilot audit events.
hub/​server/​integrations/​github/​create-installation-access-token/​types.ts Defines token-acquisition dependencies.
hub/​server/​integrations/​github/​create-installation-access-token/​index.ts Verifies installations and requests fresh tokens.
hub/​server/​integrations/​github/​create-installation-access-token/​index.test.ts Covers token acquisition and failure handling.
hub/​server/​integrations/​github/​create-installation-access-token/​errors.ts Defines classified credential errors.
hub/​server/​integrations/​github/​create-github-app-jwt-signer/​types.ts Defines the replaceable JWT signing boundary.
hub/​server/​integrations/​github/​create-github-app-jwt-signer/​index.ts Implements private-key App JWT signing.
hub/​server/​domains/​learning/​read-learning-configuration/​index.ts Forwards the optional signer dependency.
hub/​server/​domains/​copilot-credentials/​types.ts Adds installation identity and credential expiry.
hub/​server/​domains/​copilot-credentials/​create-github-app-installation-copilot-credential-provider/​index.ts Configures the installation credential provider.
hub/​server/​domains/​copilot-credentials/​create-github-app-installation-copilot-credential-provider/​index.test.ts Covers stable identity digests and signing.
hub/​server/​domains/​copilot-credentials/​create-environment-copilot-credential-provider/​index.ts Marks environment credentials as lacking App identity.
hub/​server/​domains/​copilot-credentials/​create-copilot-credential-provider/​index.ts Adds explicit installation-provider selection.
hub/​server/​domains/​copilot-credentials/​create-copilot-credential-provider/​index.test.ts Covers selection and conflicting configuration.
hub/​server/​domains/​copilot-connection/​types.ts Extends connection audit inputs with identity.
hub/​server/​domains/​copilot-connection/​record-copilot-connection-refusal/​index.ts Records App identity and specific refusal reasons.
hub/​server/​domains/​copilot-connection/​record-copilot-connection-failure/​index.ts Attributes failed checks to the configured identity.
hub/​server/​domains/​copilot-connection/​get-copilot-connection-status/​index.ts Returns configured installation identity.
hub/​server/​domains/​copilot-connection/​get-copilot-connection-status/​index.test.ts Covers identity reporting in connection status.
hub/​server/​domains/​copilot-connection/​errors.ts Adds revocation and permission-denial codes.
hub/​server/​domains/​copilot-connection/​disconnect-copilot/​index.ts Adds matching provider identity to disconnect audits.
hub/​server/​domains/​copilot-connection/​connect-copilot/​index.ts Handles installation failures and identity-aware audits.
hub/​server/​domains/​copilot-connection/​connect-copilot/​index.test.ts Covers terminal refusals and transient failures.
hub/​script/​check-image/​index.ts Checks the packaged SDK version.
hub/​package.json Updates Hub’s Copilot SDK pin.
hub/​package-lock.json Locks Hub’s updated SDK dependencies.
hub/​docs/​learning-foundation.md Documents installation credentials and signer behavior.
hub/​docs/​deployment.md Lists organization credential configuration.
hub/​client/​pages/​copilot-connection-page/​stories.tsx Adds organization installation presentation data.
hub/​client/​application/​hub/​view-models/​security-audit-page-data/​index.ts Labels credential identity in audit displays.
hub/​client/​application/​hub/​view-models/​security-audit-page-data/​index.test.ts Covers identity labels in audit data.
hub/​client/​application/​hub/​view-models/​copilot-connection-page-data/​index.ts Adds organization billing and confirmation copy.
hub/​client/​application/​hub/​view-models/​copilot-connection-page-data/​index.test.ts Covers organization-specific connection copy.
hub/​client/​application/​hub/​security-audit-contracts/​index.ts Allows the non-secret credential-provider field.
hub/​client/​application/​hub/​copilot-connection-contracts/​index.ts Parses installation identity in status responses.
hub/​.env.example Shows organization installation configuration variables.

Review effort: Max (auto)

Comment thread hub/docs/learning-foundation.md Resolved
@alliscode
alliscode force-pushed the alliscode-github-app-copilot-auth branch 2 times, most recently from e5e2eb2 to da5c4fa Compare November 12, 2026 21:38
@alliscode
alliscode force-pushed the alliscode-github-app-copilot-auth branch from 353c366 to 62e9241 Compare November 12, 2026 23:48
@alliscode
alliscode force-pushed the alliscode-github-app-copilot-auth branch from 62e9241 to 9cbbc70 Compare November 13, 2026 17:20
Base automatically changed from alliscode-hub-learning-foundation to build/hub/new November 13, 2026 17:54
@alliscode
alliscode force-pushed the alliscode-github-app-copilot-auth branch from 9cbbc70 to d16fa08 Compare November 13, 2026 17:54
Ben Thomas and others added 5 commits November 13, 2026 13:29
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@alliscode
alliscode force-pushed the alliscode-github-app-copilot-auth branch from d16fa08 to 66bec9e Compare November 13, 2026 22:01
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread hub/docs/learning-foundation.md Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@alliscode
alliscode merged commit 59ad41d into build/hub/new Nov 16, 2026
49 checks passed
@alliscode
alliscode deleted the alliscode-github-app-copilot-auth branch November 16, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants