Skip to content

feat(hub): add installation membership administration - #121

Open
Copilot wants to merge 6 commits into
copilot/hub-identity-behaviorfrom
copilot/hub-identity-api
Open

Copilot wants to merge 6 commits into
copilot/hub-identity-behaviorfrom
copilot/hub-identity-api

Conversation

Copilot AI commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Why

GitHub authentication proves who a person is, but it should not decide whether that person may enter a Hub installation. Hub needs its own durable membership boundary so installation access and administration remain stable when repository permissions change.

What changes

Hub now admits a signed-in identity only when it has an active membership, matches a usable invitation, or completes authorized bootstrap or recovery enrollment. Administrators can invite immutable provider identities, assign member or administrator roles, move memberships through active, suspended, and removed states, and page through retained membership and invitation history.

Suspending or removing a member ends that person's Hub sessions. Hub prevents concurrent changes from removing the final active administrator, supports one-use bootstrap and no-administrator recovery, and records successful and denied administration outcomes as structured security audits. State-changing APIs enforce the Hub origin, CSRF protection, membership checks, and private no-store responses.

The minimal interface adds first-administrator enrollment, recovery, invitation management, and membership administration. This layer does not add prototype authorization, GitHub membership synchronization, artifact ingestion, or production OIDC.

Storybook screenshots

Hub/Pages/Identity/Membership administration / Default — dark theme, 1280 × 720

Hub membership administration default in dark theme at 1280 by 720

Hub/Pages/Identity/Membership administration / More Records Available — dark theme, 1280 × 720

Hub membership administration pagination controls in dark theme at 1280 by 720

Hub/Pages/Identity/Membership administration / Invitation History — dark theme, 1280 × 720

Hub membership invitation history states in dark theme at 1280 by 720

Hub/Pages/Identity/Sign in / Signed Out — enrollment and recovery expanded, dark theme, 1280 × 720

Hub sign-in signed-out state with enrollment and recovery expanded in dark theme at 1280 by 720

Hub/Pages/Identity/Sign in / Signed In — dark theme, 1280 × 720

Hub sign-in signed-in state in dark theme at 1280 by 720

Hub/Pages/Identity/Sign in / Unconfigured — dark theme, 1280 × 720

Hub sign-in unconfigured state in dark theme at 1280 by 720

Copilot AI requested review from a team and nshki as code owners October 26, 2026 23:31
Copilot AI max review requested due to automatic review settings October 26, 2026 23:31

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.

Copilot was unable to review this pull request because there is no eligible user to bill.

An enterprise owner can allow the organization to be billed for reviews like this by enabling Copilot code review for users without a license.

Copilot AI added this pull request to stack #122 October 26, 2026 23:31
@alliscode
alliscode force-pushed the copilot/hub-identity-api branch from 1a04887 to c3e12ce Compare October 28, 2026 18:34
@alliscode alliscode changed the title feat(hub): expose the GitHub identity API feat(hub): add installation membership administration Oct 28, 2026
@alliscode
alliscode requested a max review from Copilot October 28, 2026 21:59

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.

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

Administrative mutations can exceed session-freshness limits, invitation replacement can fail at expiry boundaries, and critical enrollment and membership behaviors lack test coverage.

11 open issues
17 resolved since last review

Review effort: Max

Ben Thomas and others added 5 commits October 29, 2026 09:06
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 copilot/hub-identity-api branch from 575ad86 to b8e0ad8 Compare October 29, 2026 16:12
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 on lines +326 to +327
if (nextStatus !== "active") {
await records.deleteUserSessions(target.userId)
Comment on lines 70 to +77
const providerRevision = configuration
? await ensureGitHubProviderRevision(store, configuration)
: null
const bootstrapSecret = readHostSecret(environment, "HUB_BOOTSTRAP_SECRET")
const recoverySecret = readHostSecret(environment, "HUB_ADMIN_RECOVERY_SECRET")
if (bootstrapSecret && recoverySecret && bootstrapSecret === recoverySecret) {
throw new Error("HUB_BOOTSTRAP_SECRET and HUB_ADMIN_RECOVERY_SECRET must be different.")
}
issuer: "https://github.com",
subject: "42",
role: "member",
expiresAt: "2026-11-05T18:00:00.000Z",
Comment on lines +139 to +140
return {
async list(sessionToken, cursors = {}) {

@nshki nshki 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.

Thanks for adding this layer, @alliscode! Just based on screenshots alone, this PR would benefit a lot from visual cleanup. Buttons aren't aligned in some places and I believe there are more standard patterns we can be using for the actual user management views.

Happy to discuss if needed.

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