Skip to content

Add secure desktop pairing tokens and compatibility discovery to the API #1955

Closed

Description

@propr-dev

Objective

Give packaged desktop clients a secure, instance-scoped way to discover compatibility and authenticate without placing GitHub access tokens in renderer storage.

Scope

  • Add a minimal rate-limited discovery endpoint that reveals only product/API compatibility metadata and supported desktop authentication capabilities before login.
  • Implement a short-lived, single-use browser pairing flow: the desktop starts a pairing request, opens the instance login/approval page in the system browser, polls with a high-entropy device secret, and receives an opaque instance API token only after an authenticated authorized user approves it.
  • Store only hashed opaque tokens server-side, with owner, creation, last-used, optional expiry, revocation, and instance role/permission resolution. Never put a GitHub token in pairing URLs or responses.
  • Authenticate normal REST and Socket.IO traffic with the instance token while preserving existing browser sessions and optional GitHub bearer behavior.
  • Add authenticated token listing/revocation endpoints and cleanup of expired pairing records.
  • Add database migrations, strict redirect/origin handling, rate limits, audit logging without secrets, and thorough authorization/security tests.
  • Document the protocol contract for the shared client and Electron integration tasks.

Non-goals

  • Do not build Electron UI.
  • Do not weaken existing instance authorization or make privileged setup remotely callable.

Epic integration contract

  • Target the ProPR-managed epic base branch selected by the base-1953-epic-desktop-transport-api label; do not target main.
  • Preserve existing Web UI, CLI, API, and self-hosted deployment behavior.
  • Add focused automated tests for new behavior and run relevant typecheck/build/test commands.
  • Do not merge this PR. It must receive Ultrafix and independent review before integration.
  • Report exact verification commands and any cross-platform behavior that could not be exercised locally.

Part of #1950 and #1953.

Activity

  1. propr-dev commented on Aug 29, 2026

    @propr-dev
    ContributorAuthor

    🤖 AI processing has started for this issue using codex agent with gpt-5.6-sol model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: codex
    • Model: gpt-5.6-sol
    • Branch: 1955/gpt-5.6-sol-add-secure-desktop-pairin-20260829-1408-o5i
    • Base Branch: main
    • Worktree: issue-1955-20260829-1408-gpt-5.6-sol-o5i

    🔍 Track Task Execution

  2. added a commit that references this issue on Aug 29, 2026
  3. integry commented on Sep 4, 2026

    @integry
    Owner

    Implemented by #1966, merged into 1953-epic-desktop-transport-api (788c4b1). Closing the completed child issue during epic issue/PR reconciliation. Final desktop integration and delivery remain tracked by #1950 / #1970; this does not claim a main-branch release.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions