Skip to content

Expose personal account controls from connector templates - #245

Merged
tnkuehne merged 2 commits into
mainfrom
feat/user-connection-entrypoint
Nov 20, 2026
Merged

tnkuehne merged 2 commits into
mainfrom
feat/user-connection-entrypoint

Conversation

@tnkuehne

@tnkuehne tnkuehne commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

First layer of the personal connections stack, which replaces #188.

What changes

The GitHub, Gmail and OneDrive templates export a UserConnection entrypoint, so Widefleet can show and manage a user's own connector account outside the connector's page.

Method Result
status() { setup, connection, account }: setup state and the caller's saved account, without starting authorization
prepare({ completionUrl }) { url, expiresAt }: a single-use launch link on the connector's origin
disconnect() { disconnected: true }
  • Launch links. Opening the link starts the same provider authorization as the connector page, then returns to completionUrl; cancelled or failed authorization adds connectionError=1.
    • Launch tickets (4 minutes, enough for the app's own sign-in when the member has no app session yet) and return tickets (15 minutes) are stored in the existing verification table.
    • They are consumed atomically and only by the user they were issued for. Another user, a second use or an expired ticket gets 410.
  • One disconnection. The page and the entrypoint share disconnect(), which revokes a managed grant before deleting the saved tokens.
  • Redirects to the provider and back send Referrer-Policy: no-referrer, so tickets do not leak through referrers.

Existing accounts, the connector page and the OAuth callbacks are unchanged.

Tests

template-oauth.test.ts runs both new cases for all three templates, with managed and with custom credentials:

  • launch, provider round trip and return, including single use and another user's tickets
  • expired tickets and cancelled authorization
  • setup state, disconnection isolation between users, and revocation through the shared disconnection

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable defects remain in the reviewed changes.

Summary

Adds personal account controls to the GitHub, Gmail, and OneDrive templates.

  • Widefleet can manage each person’s connector account outside its page.
  • Prepared connection links return people to Widefleet after provider sign-in.

No new actionable issues were found. PR #246’s caller matches the new entrypoint contract.

Reviews (3) · Last reviewed commit: "Keep connector launch links valid throug..." · Reviewed by Greptile

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
widefleet-docs b576706 Nov 20 2026, 06:20 PM

GitHub, Gmail and OneDrive export a `UserConnection` entrypoint with
`status`, `prepare` and `disconnect`. Widefleet calls it with the
caller's verified identity to show and manage that user's own account.

`prepare` returns a single-use launch link on the connector's origin.
Opening it starts the same provider authorization as the connector page
and returns to the given completion URL afterwards. Launch and return
tickets live in the existing verification table, expire after two and
fifteen minutes, are consumed atomically and only by the user they were
issued for.

The page and the entrypoint share one disconnection, which revokes a
managed grant before deleting the saved tokens.
A member without an app session first signs in to the app, which can take
longer than two minutes with multi-factor sign-in or consent. Launch links
now stay valid for four minutes, within the five minutes Widefleet accepts.
@tnkuehne
tnkuehne force-pushed the feat/user-connection-entrypoint branch from 2612e5c to b576706 Compare November 20, 2026 18:19
@tnkuehne
tnkuehne merged commit abd0f26 into main Nov 20, 2026
12 of 15 checks passed
@tnkuehne
tnkuehne deleted the feat/user-connection-entrypoint branch November 20, 2026 18:19
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.

1 participant