Skip to content

fix(api-rs): authorize githubbot for all its session key families - #22

Closed
oponder wants to merge 2 commits into
mainfrom
fix-githubbot-session-prefixes
Closed

fix(api-rs): authorize githubbot for all its session key families#22
oponder wants to merge 2 commits into
mainfrom
fix-githubbot-session-prefixes

Conversation

@oponder

@oponder oponder commented Aug 18, 2026

Copy link
Copy Markdown

Hotfix for PR reviews breaking after the upstream sync (#19): upstream's api-rs route authentication (paradigmxyz#1374, Aug 13) scopes each ingress key to one thread-key prefix — github: for githubbot — but githubbot also mints github-issue: (issue work), github-manage: (owned-PR management) and github-review: (review runs). Those now 403 ("ingress caller denied for another platform's session"), e.g. the review on splits#3592.

Fix: callers carry every prefix their ingress mints; the session guard accepts any of them. Unlisted github-* strings stay denied; other bots each mint a single family and keep a single prefix. Thread keys are NOT renamed — existing sessions keep working.

Both ends of the contract are now pinned so they can't drift apart silently: the api-rs test asserts the shipped ingress spec rather than a hand-written list, and githubbot pins the prefix each of its thread-key helpers produces.

Upstream is broken the same way — offered there as paradigmxyz#1435. This branch is code-identical to it, so the sync that picks it up is a no-op here.

Validation

  • cargo fmt --check / clippy --workspace --all-targets -D warnings / test -p centaur-api-server --lib in a rust:1 container
  • bun test test + bun tsgo --noEmit in services/githubbot
  • Live pass pending: deploy api-rs from this branch, re-request the review on splits#3592

🤖 Generated with Claude Code

The platform scoping added in paradigmxyz#1374 pins each ingress key to a single
thread-key prefix, but githubbot mints three families: github: (chat),
github-manage: (owned-PR management), github-review: (review runs).
Only the first matched, so api-rs 403'd the bot's own review and
management sessions ("ingress caller denied for another platform's
session") and PR reviews stopped working.

Callers now carry the full list of prefixes their ingress mints, and
the session guard accepts any of them. Other bots keep their single
prefix; unlisted github-* strings stay denied.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@oponder
oponder marked this pull request as ready for review August 18, 2026 18:49
@oponder
oponder requested a review from 0xdiid August 18, 2026 18:49
0xdiid
0xdiid previously approved these changes Aug 19, 2026
Auditing every thread-key literal githubbot mints turned up a fourth
family the first pass missed: github-issue: (issue assigned to the bot,
issue-manager.ts). It 403s exactly like the management and review
families did, so the hotfix was incomplete.

Pin both ends of the contract so they cannot drift apart silently: the
ingress table moves to a module-level const, letting the api-rs test
assert the shipped spec rather than a hand-written list, and githubbot
gains a test fixing the prefix each of its thread-key helpers produces.

Code-identical to the upstream offering, paradigmxyz#1435.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@oponder

oponder commented Aug 20, 2026

Copy link
Copy Markdown
Author

closing this one. it's merged upstream and I'll pull it down instead

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