Repository navigation
Description
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 loginand 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
- Address proof. Serve
GET /.well-known/propr-instanceand answer Connect's challenge asdocs/instance-auth-origins.mdin 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.
- 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_limitedwith backoff. - Surface verification failures in Settings and in
propr doctor, not just the logs.
- Handle
- 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_verifierto 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.
- Start enrollment with a PKCE S256
- 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
stateto 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.
- Renewal. Renew Connect-issued sign-ins through
POST /v1/instance-auth/renew(token-bound chains).- Handle
renewal_revoked,renewal_unavailableand rate limits. - Fall back to the sign-in page with a clear reason, reusing the [3879 by GPT-6.2 Sol] Stuck session when GitHub token renewal is temporarily unavailable: no way to sign out, refresh retried on every request #3880 backoff and notice for temporary failures.
- Handle
propr deploy fly. When no relay token exists, offer one-click enrollment instead of requiringpropr 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).- 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.
- fresh
- Docs: the Fly setup guide and the sign-in docs describe both paths and when each is used.
Activity