Skip to content

Add shared GitHub App identities and scoped agent access - #331

Merged
gossion merged 10 commits into
mainfrom
feat/shared-github-app
Oct 28, 2026
Merged

gossion merged 10 commits into
mainfrom
feat/shared-github-app

Conversation

@gossion

@gossion gossion commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Add a shared GitHub App identity so each Agent can be limited to selected repositories and explicit Code, Pull requests, and Issues permissions. The Broker verifies the configuring user's authority and requests a narrowed installation token for each execution; GitHub records actions as the App bot, while provider credentials stay in the Broker/MCP boundary.

  • Separate owner-level Connections from per-Agent Identities, with a guided repository/permission flow and a distinct personal OAuth option.
  • Reuse canonical connections across repeated authorization and App renames, preserve existing Agent grants, and identify historical duplicates without deleting their bindings.
  • Recover interrupted installation selection and reauthentication, and serve the Connections SPA through exact page routes while preserving Agent route handling.
  • Add App configuration, registration instructions, permission/trust documentation, and regression coverage across Broker, MCP, Portal, and gateway rendering.

Related issue

Self-contained feature proposal; no separate tracking issue.

Validation

Offline checks passed using Go 1.27.3, Node.js 24.15.0, Helm 4.3.1, and Python 3.12.3. Go checks used GOPROXY=off GOTOOLCHAIN=local GOFLAGS=-mod=readonly after a separate dependency setup step.

Working directory Command Result
Each of app/internal, app/cetirun-agent-broker, app/cetirun-connections-mcp, app/cetirun-portal go test ./... -count=1 and go vet ./... Passed
app/cetirun-agent-broker go test -race ./internal/broker -run 'TestGitHub|TestConcurrentAccountLogin' -count=3 Passed
app/internal go test -race ./agenttools ./tlsreload -count=1 Passed
Repository root make portal-test portal-lint 459 frontend tests and 34 license tests passed; TypeScript check passed
Repository root npm --prefix app/cetirun-portal/web run build Passed; Vite reports a bundle-size warning
Repository root bash scripts/cetirun-agent-broker-helm-test.sh Passed
Repository root bash scripts/cetirun-istio-helm-test.sh Passed
Repository root make -C app/cetirun-connections-mcp test vet chart-lint Passed
Repository root python3 -B -m unittest scripts.tests.test_istio_gateway_isolation -v 6 tests passed
Repository root make docs-check 106 tests, license-header checks, site build, and validation of 37 HTML pages passed
Repository root git diff --check origin/main and gofmt -l on changed Go files Passed

The new interrupted-reauthentication and App-rename regressions were also run against the pre-fix implementation and reproduced both failures before passing with the fixes.

Not run for this PR head: full repository make check/make test/make lint, Operator envtest, or live GitHub/Kubernetes acceptance tests. Local validation was scoped to the affected components. The final review fixes have not been deployed.

Compatibility and operational impact

  • Shared App support is opt-in through providers.github.app and a referenced Kubernetes Secret. Existing personal OAuth connections remain supported; incomplete App configuration is rejected.
  • Each Agent binding selects repository IDs and permissions. Personal repositories require ownership; organization repositories currently require repository Admin authority, in addition to GitHub installation/approval policy. Unavailable or revoked authorization blocks issuance, with no personal OAuth fallback.
  • The platform operator retains the ability to use the App's full installation grant. Per-Agent limits do not remove that trust requirement; the guide explains credential custody, rotation, and revocation behavior.
  • Broker and Connections MCP must both be updated for installation-mode execution. Each issuance rechecks GitHub authority and creates a fresh token, adding GitHub API calls. There is no installation-token cache or webhook dependency.
  • Existing connection IDs and bindings remain valid. Stable installation indexes are rebuilt lazily when selected; historical records are retained. The API adds installation metadata, grant fields, and canonical connection references.
  • The Portal adds /connections and renames the relevant navigation/actions. Gateway rendering distinguishes the exact SPA page paths from Agent paths.
  • No CRD, generated source, or dependency changes relative to current main.

Checklist

  • The change is focused and preserves unrelated work.
  • Tests cover the changed behavior, or I explained why no new test is needed.
  • Documentation and examples match any public behavior changes.
  • Generated artifacts were updated from source, or none are affected.
  • Dependency changes include lockfiles, source attribution, and license information, or none are affected.
  • I checked the diff and attachments for secrets, private endpoints or identifiers, customer data, agent conversations, and internal information.
  • I followed the applicable CLA instructions, or asked a maintainer about an unclear check.
  • I identified checks that need credentials or a live environment and did not run them without authorization.

@gossion gossion mentioned this pull request Oct 27, 2026
8 tasks done

@feiskyer Pengfei Ni (feiskyer) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@gossion
gossion merged commit 822b638 into main Oct 28, 2026
33 checks passed
@gossion
gossion deleted the feat/shared-github-app branch October 28, 2026 00:47
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.

2 participants