Skip to content

Connect one-click setup and sign-in on the instance (client side of propr-routing#339) #3890

Backlog

Description

@integry

Summary

Add ProPR (instance) support for the Connect one-click setup and sign-in that integry/propr-routing#339 adds on the Connect side (design: integry/propr-routing#338, "Client side (integry/propr, a separate issue…)").

When this lands, a ProPR instance at https://<app>.fly.dev that uses the shared ProPR App with a relay token can:

  • enroll its relay token in one click, instead of propr login and relay enrollment from the CLI;
  • sign browsers in through Connect by redirect, instead of a GitHub device code.

GitHub device sign-in (#3867) stays as the fallback for every other host.

Depends on: integry/propr-routing#339 being merged and deployed. Build against its final API, which still changed late (PKCE enrollment, challenge rate limit). Also land after the runtime epic (#3758) merges to main, because steps 6 and 7 touch propr deploy fly and the dashboard launch wizard from #3852.

What the instance needs

  1. Address proof. Serve GET /.well-known/propr-instance and answer Connect's challenge as docs/instance-auth-origins.md in propr-routing specifies: an HMAC keyed by a key derived from the relay token, over prefix|origin|nonce. Requirements:
    • Return a strict base64url 32-byte proof, with no redirects.
    • Never expose the relay token or the derived key.
    • Answer within Connect's 5 s limit and 4 KB cap.
  2. Origin registration. On boot, and whenever the public URL changes, register the instance's own origin with PUT /v1/instance-origin, then verify it.
    • Handle 429 instance_origin_rate_limited with backoff.
    • Surface verification failures in Settings and in propr doctor, not just the logs.
  3. One-click enrollment.
    • Start enrollment with a PKCE S256 code_challenge, keeping the verifier server-side and short-lived.
    • Handle the callback, then redeem the code with the code_verifier to receive the relay token.
    • Store the token as the existing relay token secret or setting, and never log it or put it in a URL.
    • Activate it before the 10-minute pending deadline.
  4. Sign-in by redirect. Add a "Sign in with ProPR Connect" option on the login page when the instance has a verified origin.
    • The callback route must be the exact registered path, with no query.
    • Create and check state to prevent login CSRF. Connect passes it through and doesn't check it.
    • Redeem the single-use code server-side with the relay token, then create the session the same way device sign-in does today.
    • Keep the expired and re-sign-in messages (Dashboard sign-in via GitHub device flow for relay-enrolled instances on any host #3867) working for this path.
  5. Renewal. Renew Connect-issued sign-ins through POST /v1/instance-auth/renew (token-bound chains).
  6. propr deploy fly. When no relay token exists, offer one-click enrollment instead of requiring propr login. Reuse a relay token that is already stored as a Fly secret on redeploy (see propr deploy fly: secrets added after the first deploy never reach the app container (explicit per-container secrets list) #3887 and [3887 by GPT-6.2 Sol] propr deploy fly: secrets added after the first deploy never reach the app container (explicit per-container secrets list) #3888).
  7. Dashboard launch wizard ([3827 by Claude Opus 5.5] Deploy ProPR from the Fly.io dashboard (Launch an App → From GitHub), with first-visit setup #3852). Offer "Use ProPR Connect" as an alternative to creating the instance's own GitHub App.

Acceptance

  • Unit and integration tests for the proof endpoint, registration with retry and rate limits, enrollment start and redeem including a wrong verifier, the sign-in callback including a bad or missing state, and renewal error paths.
  • A live test on a Fly instance against Connect production after propr-routing#339 is deployed:
    • fresh propr deploy fly → one-click enroll → browser sign-in by redirect → a token renewal → revoke from Connect settings → the instance shows the re-sign-in message;
    • the same instance still offers device sign-in as a fallback.
  • Docs: the Fly setup guide and the sign-in docs describe both paths and when each is used.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions