Skip to content

feat(abom): App-only production credentials and role-checked ownership claims - #69

Draft
data-douser wants to merge 4 commits into
mainfrom
abom/app-credentials/1
Draft

data-douser wants to merge 4 commits into
mainfrom
abom/app-credentials/1

Conversation

@data-douser

@data-douser data-douser commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Let a production ABOM instance run on its GitHub App's credentials alone, with no person's token, and record the role that supports every ownership declaration.

This implements production-credentials.md and retires plans/api/ownership-claims.md.

Important changes

Credentials

  • Scoped tokens. Each kind of call gets an installation token carrying only the permissions it needs (ghapp.PermissionSet, TokenWith). A permission the installation hasn't approved is refused before GitHub is asked.

  • The App instead of a person. With an App configured, these use the installation:

    • crawl reads
    • lock verification
    • the property picker
    • Copilot sessions

    gh and GITHUB_TOKEN are never read, and token variables are stripped from child processes.

  • Read-only App. The manifest asks for reads only, plus organization_copilot_requests: read, the one new permission. A test ties every grant to the call or webhook handler that needs it.

  • No writes through the App. A server reading as the App refuses --submit-targets, --enable-targets and --enable-accounts at startup, and Settings says why.

  • Copilot sessions. Each one gets a fresh client-level installation token and ends before it expires. Where the configured model isn't offered to that credential, the session runs auto, and the model each call ran on is recorded.

Ownership claims

  • Who may declare an account: an owner or admin, a security manager (organization roles API; needs admin:org), or the App's installation.
  • Who may declare a repository include: a repository admin or maintainer.
  • What is recorded:
    • the role check, beside each declaration (abom_repository_role);
    • the installer, from the installation's created event (abom_app_installer);
    • which includes the installation doesn't cover.
  • Settings shows the check. It never changes a declaration.

Docs: architecture, configuration, vocabulary and the architecture instructions describe the credential and eligibility rules.

Notes

…p claims

A production instance now runs on its GitHub App's credentials alone,
and every ownership declaration carries the role that supports it.
Implements plans/api/production-credentials.md and retires
plans/api/ownership-claims.md, as one change, as #66 planned.

Production credentials
- Each installation token is minted with only the permissions its kind
  of call needs (ghapp.PermissionSet, TokenWith), cached per
  installation and set; a permission the installation has not approved
  refuses the call before GitHub is asked.
- With an App configured, crawl reads, lock verification, the property
  picker and Copilot sessions use the installation; gh and GITHUB_TOKEN
  are never read, and token variables are stripped from child processes.
- With an App, the identity on record is the App's bot and the accounts
  it is installed on; nobody's gh session is read.
- The manifest requests reads only, plus organization Copilot requests;
  its trace test ties every grant to a call or an event handler.
- A server reading as the App refuses to start with --submit-targets,
  --enable-targets or --enable-accounts, and Settings says why.
- Copilot sessions authenticate with a client-level installation token
  minted fresh per session, and end before it expires. Where the runtime
  does not offer the configured model to the credential, the session
  runs `auto`, and the model each call actually ran on is recorded.
- Readiness names the credential sessions use.

Ownership claims
- An account is eligible through an owner or admin role, a security
  manager role (organization roles API, legacy fallback; needs
  admin:org), or the App's installation; a repository admin or
  maintainer may declare an include.
- The role check is recorded beside each declaration
  (abom_repository_role), the installer from the installation's created
  delivery (abom_app_installer), and includes the installation does not
  cover are marked. Settings shows the check; it never changes a
  declaration.

Docs, plans and the architecture instructions describe the eligibility
and credential rules.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
data-douser and others added 3 commits November 22, 2026 17:31
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The C# self-audit started failing on unchanged code in mid-November with
three findings in Razor components: identical values compared at
ActionVersions.razor:115 and two fields "missing" readonly in
DiscoveryControls.razor that are reassigned elsewhere.

Both are artifacts of the database, not of the code. Build-mode none
fetches every referenced package that has no compile assets again, at
its newest version, and takes the assemblies inside as references.
DevServer is such a package; its newest release now carries ASP.NET
Core 11 assemblies, which outranked the 10.0 ones the app and MudBlazor
build against. Template contexts went untyped, so `onLines.Analyzed`
and `onLines.Commits` both became accesses to an unknown member.

- Drop the DevServer reference. Nothing runs `dotnet run` or
  `dotnet watch`; `abom serve` hosts the published interface.
- State `@namespace Abom.WebAssembly` in _Imports.razor. CodeQL runs
  the Razor generator without the project file, so components landed in
  ASP.Shared and every `@using Abom.WebAssembly.*` failed; the real
  build's generated code is unchanged.

Reproduced with CodeQL 2.27.3 on Linux: 1,882 compiler errors and the
false positive before, 30 errors and no findings after.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit 7e8b656)
With the interface's own references fixed, the C# self-audit still
reported two missed readonly modifiers in DiscoveryControls.razor that
the code does not have. The 2026-11-16 runner image carries .NET SDK
11.0.100 beside 10.0.404, and build-mode none generates Razor components
with the newest SDK it finds. .NET 11's generator writes a
<Component>_razor.decl.g.cs beside each component holding the whole
@code block; the extractor compiles every file the generator wrote, so
each field is declared twice and the copy nothing binds to reads as
assigned only by its initializer.

setup-dotnet now installs into a directory of its own, holding only the
SDK the interface builds with. Reproduced on Linux with CodeQL 2.27.3:
10.0.404 and 11.0.100 together give the two findings; 10.0.404 alone
gives none. CodeQL 2.27.4 and 2.27.5 note no change here.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit 93a7dd2)
@data-douser data-douser self-assigned this Nov 23, 2026
@data-douser data-douser added enhancement New feature or request ui Related to UI plans and implementation changes go Pull requests that update go code labels Nov 23, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code ui Related to UI plans and implementation changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant