background-agents icon indicating copy to clipboard operation
background-agents copied to clipboard

Feature request: single-tenant multi-GitHub-or repo access with platform auth gate

Open rubenlangeweg opened this issue 5 months ago • 2 comments

Why

A single instance deployment should be able to work across selected repositories in multiple Github orgs without becoming full multi-tenant.

This matters for agencies, internal platform teams and delivery teams that do not own every repo they work in.

Concrete example: you own a own GitHub org, but the client projects often live in client-owned GitHub orgs. The team using Open-Inspect is still trusted staff. The problem is not client-users access. The problem is that the repos are spread across multiple GitHub App installations.

Today, the system assumes one deployment-wide GitHub App installation. That works when all repos live under one org. It breaks down when a trusted team needs one Open-Inspect setup, one agent setup, and one automation surface.

Target shape

Keep single-tenant.

Only trusted members of the deployment should be able to sign in. GitHub should become the SCM access layer, not the main trust boundary.

The platform auth layer can be Better Auth or an equiv. setup. Its job is to ansewr:

  • Is this person allowed to use this Open-Inspect deployment?

Github App installs answer a different question:

  • Which repos can this deployment access, and which installation token should be used for this app?

Usecases

  • An agency runs one Open-Inspect deployment for its team, but client repos live in several client GitHub orgs.
  • A delivery leads wants to start sessions agains selected repos from multiple orgs without Switching deployments
  • A scheduled automation needs to run agains curated repo set across orgs, with each child to run using the correct repo creds.
  • A GitHub webhook from a client repo should create a session using hat repo's installation context, not a global installation ID.

Proposed scope

  • Support multiple GitHub App installations in one single-tenant deployment.
  • Store GitHub App installation_id on repository catalog entries.
  • Persist the repo's installation context on sessions.
  • Use the session's installation context for repo lookup, branch listing, push auth, PR creation fallback, credential-helper tokens, webhooks, repo images, and automation matching.
  • Replace global repo caching with installation-aware or catalog-aware caching.
  • Gate product access through platform auth, for example Better Auth with Google or GitHub login plus rb2 membership checks.
  • Keep GitHub user OAuth as optional SCM identity for PR attribution, not as the only product identity model.

Out of scope

  • No full multi-tentant client workspace model
  • No client users logging into the same deployment
  • No mixed-provider deployment support beyond what is needed for this GitHub multi-installation path.

Security direction

The trusted-user assumption remains: admitted users are allowed to use the deployment.

The repo access boundary should still get tighter. Prefer repo-scoped install tokens for sandbox creds where possible. If the setup hooks or submodules need sibling private repos, modat that explicitly instead of giving every session broad installation access by default.

Why platform auth matters

GitHub should not be the only wayt to decide who can use the deployment.

For the first version, access can stay simple: trusted members only. But the platform still could benefit its own identity layer, beccause not every usefull actor is a GitHub user sitting in the web UI.

Better Auth (or equivalent) would make this cleaner:

  • member access through Google, Github or SSO
  • API keys for programmatic access
  • service accounts for automations and integrations
  • clearer roles, for example admin and member
  • future SSO support without trying the product identity model to GitHub.
  • linked GithHub identity only where SCM attribution is needed, for example PR authorship.

The key split is:

  • platform auth decides who or what may use Open-Inspect
  • GitHub App installations decide which reopos Open-Inspect can access
  • GitHub user OAuth optional SCM identity, not the whole product auth model.

rubenlangeweg avatar Jun 29 '26 13:06 rubenlangeweg

Adding some colour for the conversation on why the "deploy one instance per org" suggestion from #346 doesn't hold up for the agency case.

We're an agency: our own code lives in our GitHub org, client projects live in client-owned orgs, and team members typically work on 2-3 client projects at the time. With one deployment per GH org: say 7, that becomes:

  1. 7 slack bots and 7 linear agents in the same workspace. Slack and Linear don't shard along the gh org. The agency shares on workspace. Everyone has to remember which agent belongs to which client.
  2. 7 of everything operationally. 7 control planes. 7 TF states etc etc. And every upgrade or migration performed 7 times.
  3. no unified views, session history, and etc.

rubenlangeweg avatar Jul 02 '26 16:07 rubenlangeweg

closing as outside the systems intended use-case

ColeMurray avatar Oct 31 '26 17:10 ColeMurray