Skip to content

feat(client): carry the authenticated Hub management relay from #8079 - #8925

Merged
lidge-jun merged 1 commit into
devfrom
carry/8079-hub-management-relay
Nov 19, 2026
Merged

lidge-jun merged 1 commit into
devfrom
carry/8079-hub-management-relay

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Carries feat(client): relay the hub management plane for local callers #8079 by @tachyon6 onto dev as one attributed feature commit followed by six security-fix commits.
  • Lets locally authenticated Hub clients relay allowlisted account, quota, and usage reads. The local administrator can use an owner-private, connection-bound Hub pairing session. Enrollment with a Hub admin token keeps that token transient. The dashboard relay authenticates the local machine independently of the caller's Hub credential.
  • Applies Host and Origin checks before relay admission. Refuses stop, system, GitHub starring, credential management, and telemetry consent routes. Client shutdown keeps the existing attested local path and its legacy /api/stop 404.
  • Rejects literal undefined config homes and requires explicit test isolation. Updates the English and Spanish Hub guides.

Verification

  • bun test --isolate across 35 focused relay, listener, connect, shutdown, management-auth, config, and repository-guard files: 1,130 passed, zero failures. Four additional focused Link files: 28 passed. Shared TypeScript and Rust Link conformance: 9 passed.
  • Observed pre-fix failures for unauthenticated access, credential isolation, denied routes, client stop, Host and Origin, undefined or missing test homes, root-token persistence, and session ownership and permission checks.
  • bun run typecheck, bun run structure:check, bun run skill:surface:check, bun run privacy:scan, and git diff --check passed. The docs build completed for 775 pages.
  • git ls-tree -r --name-only HEAD -- undefined and git log --full-history carry/8079-hub-management-relay -- undefined returned no paths or commits.
  • Current head cf50242206: one commit rebased onto dev 0dc315b95a after a conflict in src/client/runtime.ts and structure/runtime.md. The runtime keeps dev's post-Revert "fix(link): restore Child file integrations before shutdown" (#8803) #8930 publication order and starts the Hub lease refresh after publication. Author run: typecheck (2,593 files), structure, skill-surface, privacy and diff checks, and bun test --isolate across 22 files (748 passed, 0 failed). Independent same-reviewer security review at this head: SECURITY-OK, with 906 tests across 27 files passing. Exact-head PR CI is green (ci:full).
  • NOT RUN: full and changed-graph suites, the local GUI suite on this head (CI ran it), opt-in Codex WebSocket release scenarios, Windows ACL runtime validation.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Co-authored-by: tachyon6 songjunjun62754@gmail.com

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the enhancement New feature or request label Nov 18, 2026
@lidge-jun lidge-jun added the ci:full Run the four full Ubuntu test shards on this pull request label Nov 18, 2026
@lidge-jun

Copy link
Copy Markdown
Owner Author

Security review record (maintainer lane, gpt-6.2-sol, same reviewer across four rounds plus the dev-merge review): SECURITY-OK at 4d7de16e70.

  • Local authority. Every relayed call needs local authority (local admin token, or a machine GUI session plus the caller's own Hub GUI session with CSRF) before any Hub credential is used. Host and Origin anti-rebinding checks run before authentication.
  • Stored credential. The client stores only a Hub-issued relay lease. It is bound to the enrolled connection's data key (proof required on every use), fenced on rotation and revoked on online disconnect, and an offline disconnect lets it lapse 5 minutes after the last authenticated read. It is renewed only after runtime publication and cancelled on every stop or recycle path. No Hub admin token is persisted.
  • Exact read allowlist, enforced at both client entrances and on the Hub before dispatch: GET/HEAD codex-auth/accounts, codex-auth/active, oauth/providers, oauth/accounts?provider=, providers/keys?name= (positional IDs and status only, no key characters), provider-quotas, quota-pool, usage (fixed query keys). All are served passively with zero provider calls. 0 of 197 mutation routes are reachable. /api/stop variants, starring, system, key and token routes get 404 with zero upstream calls.
  • Logout and redaction. The caller's own logout reaches the Hub with CSRF; the lease cannot log out. The redactor masks relay leases.
  • Hygiene. The carry was built from dev without the contributor branch's committed undefined/ home. Neither the tree nor the branch history contains it, and the secret scan is clean. getConfigDir() rejects a literal undefined home.

Applying maintainer-sponsored on that basis.

@lidge-jun lidge-jun added the maintainer-sponsored Maintainer sponsors this change to an auth, workflow, release, or dependency surface label Nov 18, 2026
Rebased onto dev at 0dc315b. The runtime keeps dev's post-#8930 publication
order and starts the scoped Hub lease refresh after PID and runtime-record
publication; restart, recycle, drain and signal shutdown stop it.

Co-authored-by: tachyon6 <songjunjun62754@gmail.com>
@lidge-jun
lidge-jun force-pushed the carry/8079-hub-management-relay branch from 4d7de16 to cf50242 Compare November 19, 2026 02:33
@lidge-jun
lidge-jun marked this pull request as ready for review November 19, 2026 03:14
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner November 19, 2026 03:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T03:16:59.176772Z cf50242 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lidge-jun

Copy link
Copy Markdown
Owner Author

Maintainer integration (lidge-jun, dev only) at head cf50242206. Carry of #8079 with co-author credit: an authenticated Hub management relay. It allows only exact GET/HEAD reads at both entrances and the Hub, plus caller-owned logout. Hub admin tokens stay transient. The stored credential is a Hub-issued, connection-bound lease scoped to those reads, bound to the enrolled data key, fenced on rotation, revoked on disconnect, and expiring five minutes after its last authenticated read. Provider-key reads return positional IDs only, and leases are redacted from logs. It conflicted with dev (after #8930 reverted #8803), so under the rebase-on-conflict rule it is now one commit on pinned dev 0dc315b95a. Same-reviewer security re-review via continueFrom: SECURITY-OK, merge blocked only on CI at the time. The rebase reintroduces no #8803 code, and the lease starts after publication and stops on restart, recycle, drain and signal shutdown. The reviewer ran 906 tests across 27 files with typecheck, structure, skill-surface, privacy and diff checks. Exact-head PR CI: 19 passed, 11 skipped, including all five Ubuntu shards and the ci aggregate (ci:full). NOT RUN: full and changed-graph suites, Windows ACL runtime validation. Non-blocking follow-up: structure/runtime.md:118 attributes the explicit test-home requirement to the write guard rather than the preload.

@lidge-jun
lidge-jun merged commit f4f04cb into dev Nov 19, 2026
37 checks passed
@lidge-jun
lidge-jun deleted the carry/8079-hub-management-relay branch November 19, 2026 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Run the four full Ubuntu test shards on this pull request enhancement New feature or request maintainer-sponsored Maintainer sponsors this change to an auth, workflow, release, or dependency surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant