Skip to content

feat(hub): store a login as a tenant-owned credential - #43

Merged
TheGreatAxios merged 1 commit into
mainfrom
feat/tenant-owned-login
Oct 29, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
feat/tenant-owned-login

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Closes #42

What changed

  • OAuthCredentialOwner ("principal" | "tenant") on mountOAuthLogin, persistOAuthCredential and checkOAuthCredentialTarget; default principal.
  • tenant stores principalId null and writes no creator grant, matching the stock POST /credentials organizational credential.
  • A tenant-owned login never replaces an existing name (409, like stock POST), so a login cannot overwrite an organizational credential that only the stock PATCH and its manage grant may change. Personal re-login is unchanged.
  • The mount's caller helper is renamed so it no longer reads like the new option.
  • README documents the option and that a tenant mount needs an administrative grant.

Verification

  • bun run check (typecheck, lint, format, 89 unit tests) passes.
  • bun run test:e2e against Postgres 16 passes 18/18, twice. New e2e tests: a tenant-owned login stores no principal and no grant; neither a tenant nor a personal login replaces an existing org credential; a tenant mount's full login (start, loopback callback, exchange) stores the credential with no principal.
  • Independent review: a takeover of org credentials through in-place replacement was reproduced and is fixed by the no-replace rule.

owner: "tenant" on mountOAuthLogin and persistOAuthCredential stores principalId null and no creator grant, the organizational credential Interchange lets a catalog model provider use. A tenant-owned login never replaces an existing credential: changing an organizational one stays with the stock PATCH and its manage grant. The default stays principal-owned.
@TheGreatAxios
TheGreatAxios force-pushed the feat/tenant-owned-login branch from 0072b4c to 04f5a2c Compare October 29, 2026 19:37
@TheGreatAxios
TheGreatAxios marked this pull request as ready for review October 29, 2026 19:41
@TheGreatAxios
TheGreatAxios merged commit 2c3e867 into main Oct 29, 2026
2 checks passed
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.

Store a login as a tenant-owned credential

1 participant