Skip to content

docs(proposal): GitHub authentication for the hosted tunnel-hub - #42

Merged
ako merged 1 commit into
mainfrom
docs/hub-auth-proposal
Jul 26, 2026
Merged

docs(proposal): GitHub authentication for the hosted tunnel-hub#42
ako merged 1 commit into
mainfrom
docs/hub-auth-proposal

Conversation

@ako

@ako ako commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

Design proposal (slice 6 of the warm-loop hub work) for adding owner-only GitHub authentication to the multi-tenant tunnel-hub, so a hosted hub.mxcli.org can show each user only their own app previews and gate who may register a runtime. Self-hosted hubs stay fully open — everything is opt-in via config.

Per the design discussion, the locked decisions are:

  • Access model: owner-only (you see only previews your GitHub login registered).
  • Identity: a single GitHub OAuth App (web flow for browsers, device flow for the headless CLI/agent) — no GitHub App install, no repo-access checks.

What it covers

  • Two planes, both keyed to GitHub:
    • Viewer — GitHub OAuth web flow → signed session cookie scoped to .mxcli.org (SSO across preview subdomains); cookie.login == backend.Owner or 403.
    • Registrationmxcli auth hub login device-flow bootstrap mints a hub API key bound to the login; run --hub sends X-Hub-Key → hub stamps Backend.Owner. The GitHub token never lands in the cookie/registry.
  • Data model: Backend.Owner, owner in identity(), List(sort, viewer) filtering (empty viewer = open mode).
  • HTTP + flag surface, security considerations (cookie scope, token containment, key theft, fail-closed), five implementation slices, testing plan, and open questions (key persistence, Claude Code web bootstrap via MXCLI_HUB_KEY, OAuth App ownership).
  • Future work: repo/team sharing (needs a GitHub App), per-user tunnel auth, per-owner quotas.

Docs-only; no code changes. Continues the slice numbering in PROPOSAL_mxcli_dev_warm_loop.md.

🤖 Generated with Claude Code


Generated by Claude Code

Slice 6 of the warm-loop hub work: add owner-only GitHub authentication so a
hosted hub.mxcli.org shows each user only their own previews and gates who may
register a runtime, while self-hosted hubs stay fully open (opt-in via config).

Two planes, both keyed to a single GitHub OAuth App: a browser web flow with a
.mxcli.org session cookie for SSO across preview subdomains (viewer.login ==
preview.Owner), and a headless device-flow bootstrap that mints a hub API key
bound to the GitHub login for run --hub registration (X-Hub-Key → stamp Owner).
Adds Backend.Owner + filtered listing, the HTTP/flag surface, security notes,
five implementation slices, and open questions (key persistence, web bootstrap,
OAuth App ownership). Repo/team sharing and GitHub App installs are future work.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
@ako
ako merged commit d084ff7 into main Jul 26, 2026
3 checks passed
ako pushed a commit that referenced this pull request Jul 29, 2026
Two check gaps confirmed with mx check on Mendix 11.12.1 — both pass mxcli check
but fail the build:

- MDL048 (#42): `retrieve … where [id = $Var]` → CE0161. Mendix XPath has no id
  operator reachable from a microflow expression. Regex a word-boundaried `id`
  before a comparison (a user attribute can't be named `id`). Hint points at a
  GUID marketplace action OR exposing the id as a String on a view entity via
  `cast(id as string)` and constraining on that column.
- MDL049 (#43/#44): a call argument bound to an association-object path
  (`B = $Edit/M.Edit_Budget`) → CE0117. An association path isn't a value; it must
  be retrieved first. Flags an AttributePathExpr whose final segment is
  module-qualified (an association → object); an attribute value over the same
  association (`…/Name`) is not flagged.

Tests: TestValidateMicroflow_XPathIdConstraint, _AssociationObjectArg. Repros +
symptom table.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
ako pushed a commit that referenced this pull request Jul 29, 2026
…ll gaps (FINDINGS #42/#36/#23/#48/#47)

- #42 DESCRIBE WORKFLOW dropped the `with (...)` param mappings: the modelsdk read
  path built a CallMicroflowTask with only Microflow+Outcomes and never populated
  ParameterMappings, so describe→drop→exec silently lost the mapping (which nothing
  then reports). Added microflowParamMappingsFromGen and wired it into both the
  CallMicroflowTask and CallMicroflowActivity read cases; the legacy sdk/mpr parser
  already read them. Round-trip test added; verified `describe workflow` now emits
  `call microflow M.ACT_Do with (Item = '$workflowContext')`.
- #36 SEC005 lint suggested `ALTER PROJECT SECURITY STRICT MODE ON`, a statement the
  parser doesn't implement. Strict mode is Studio Pro-only — the suggestion now says
  so instead of naming an unrunnable command.
- #23 documented `create or modify association` (the idempotent form) in the
  domain-model skill: plain `create association` is not idempotent and its failure
  aborts the rest of the script.
- #48 documented `set task outcome $Task '<Outcome>'` (there is no `complete task`)
  and the other workflow task statements in write-workflows.
- #47 documented that System-module enumerations are read from the runtime, not the
  .mpr, so mxcli can't resolve them — constrain on an attribute instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JXnEgoc2NQP1Y2TWMCMXC4
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