Skip to content

native: T3 Connect sign-in and relay environments, first slice (CN-RELAY) #93

Closed

Description

@rynfar

First slice of ledger row CN-RELAY: sign in to T3 Connect without Clerk JS (the CLI's OAuth PKCE + loopback flow, apps/server/src/cli/auth.ts, apps/server/src/cloud/CliTokenManager.ts, packages/shared/src/connectAuth.ts), list the account's cloud environments, and connect to one through the managed relay. Web sources: apps/web/src/cloud/, apps/web/src/components/cloud/, packages/client-runtime/src/relay/. Trevor approved live sign-in with his account (he approves the browser step).

Intake 30724e2..a07be97

  • pingdotgg/t3code#30474: Implementation-library refactor preserves JWT/DPoP contract. Native Rust cannot adopt effect/jose; relay remains partial93 with existing DPoP gap. Close239 as no additional standalone task.
  • pingdotgg/t3code#30540: Shared TS DPoP signer retains ES256/rfc9449 claims and key-cache behavior; no wire delta. Existing native93 owns missing DPoP exchange; close240 duplicate follow-up.

Tracking digest #214. Ledger Issue-column audit links incomplete rows to open remaining-work trackers; those are not completion claims.

Activity

  1. added this to the M2 Parity core milestone on Nov 3, 2026
  2. added
    parity
    native:feature
    status:in-progress
    status:review
    and removed
    status:in-progress
    on Nov 3, 2026
  3. rynfar commented on Nov 3, 2026

    @rynfar
    OwnerAuthor

    Review PR: #97

    First CN-RELAY slice is ready for review. Live sign-in and an actual managed-relay environment connection remain pending Trevor's browser step; no real window has been launched.

    The ledger remains partial. Remaining gaps: onboarding and host linking/unlinking; multiple routes/fallback per environment (adding relay currently replaces a direct/SSH route); seamless socket renewal and automatic recovery after failed relay preparation; web wakeup/polling and progressive discovery publication.

    All 1,009 Rust workspace tests passed serially, as did Clippy, the snapshot build, theme/parity/conformance checks, and the read-only smoke probe. Local PNG evidence: /tmp/t3-93-baseline.png, /tmp/t3-93-after.png, /tmp/t3-93-cloud-final.png.

  4. rynfar commented on Nov 3, 2026

    @rynfar
    OwnerAuthor

    PR #97 now keeps OAuth sign-in and account listing but explicitly disables relay connections/health checks. Live Clerk sign-in/listing remain pending Trevor's manual browser step; no real window has been launched.

    The review's authentication finding is confirmed: infra/relay/src/http/Api.ts:1069 verifies only a relay-audience Clerk JWT for the DPoP exchange. Bearer listing uses verifyRelayClientBearerToken, whose OAuth fallback is covered in infra/relay/src/http/Api.test.ts:416-439. No alternate OAuth-authorized relay-session endpoint exists; CLI t3 connect links/publishes the local server rather than connecting a remote client.

    Required upstream change: make layerTokenApi.exchangeDpopAccessToken in infra/relay/src/http/Api.ts verify an OAuth subject token using its verified user identity, retaining resource/client/scope/DPoP/replay checks. Accept an appropriate OAuth access-token subject type in packages/contracts/src/relay.ts; add endpoint-level OAuth acceptance and rejection tests while retaining the JWT path. No relay/server files were edited here.

    Cloud Add now refuses without mutating saved direct/local/SSH routes. The unsupported DPoP bootstrap/session path was removed, eliminating the stale discovery-endpoint pin. Refreshed listings accept changed endpoint metadata. Both original bugs were reproduced with failing tests before the fixes.

    CN-RELAY stays partial: upstream OAuth exchange support, onboarding/host linking, route fallback, socket renewal, and discovery wakeup/polling remain gaps.

    Local PNGs: /tmp/t3-93-review-signed-out.png, /tmp/t3-93-review-listing.png (previous state: /tmp/t3-93-cloud-final.png).

  5. rynfar commented on Nov 3, 2026

    @rynfar
    OwnerAuthor

    PR #97 cleanup at 5ae8e410de2777dc6b73335a13a8b3a3bcde3f32, rebased on the latest fork/native:

    • Deleted the saved relay-record kind and its startup, onboarding, and account-lifecycle consumers. Unknown/malformed saved records are skipped individually, preserving valid paired records. No relay migration was added.
    • Removed the unused health model/validation/presentation/tests, disabled button handler, and always-error upsert. Only OAuth sign-in, account listing, listing errors, and the disabled explanation remain.
    • The catalog regression failed before the fix. All 1,013 workspace tests and required checks pass; the offscreen listing capture is /tmp/t3-93-cleanup-listing.png.

    The upstream OAuth-aware DPoP exchange requirement in infra/relay/src/http/Api.ts remains unchanged and documented in the PR. Live Clerk sign-in/listing remain pending coordination; no real window or browser has been launched.

  6. rynfar commented on Nov 3, 2026

    @rynfar
    OwnerAuthor

    First slice merged in #97 (CN-RELAY stays partial): OAuth PKCE loopback sign-in, owner-only token storage with refresh and sign-out, account environment listing, entry from Settings → Environments. Connecting through the relay is disabled with an explanation: the relay's DPoP token exchange (infra/relay/src/http/Api.ts) accepts only Clerk relay-audience JWTs, not the CLI OAuth token, so native needs an upstream OAuth-aware exchange first. The first design's DPoP/socket transport is preserved in the PR history (6615486). Other gaps: onboarding, host linking, route fallback, socket renewal. Live sign-in against real Clerk not yet run.

  7. removed
    status:review
    on Nov 3, 2026
  8. rynfar commented on Nov 20, 2026

    @rynfar
    OwnerAuthor

    Completed #93 (CN-RELAY) purely client-side inside apps/native/** (PR #472, no upstream relay/contract changes): fixed GET /v1/environments, implemented Clerk Native Frontend API (_is_native=1) authentication via macOS ASWebAuthenticationSession social OAuth + inline email code/password & TOTP/backup 2FA, t3-relay JWT minting, full RFC 9449 DPoP exchange (/v1/client/dpop-token), environment /status & /connect credential registration + supervisor Prepare auto-refresh/relocation, and updated CN-RELAY to done in LEDGER.md.

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

    native:featureparity

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions