Skip to content

refactor: consolidate loopback OAuth-callback pattern (altimate.ts + browser-handoff.ts) #1143

Description

@anandgupta42

Found during v0.9.7 release review (Tech Lead persona), referencing the deliberate duplication called out in eb1124e (#1100)'s own commit message ('shared-helper refactor is a follow-up ticket once both flows have prod experience').

packages/opencode/src/altimate/workspace/browser-handoff.ts duplicates the loopback-listener pattern from altimate.ts's gateway sign-in flow. In the process, browser-handoff.ts added a DNS-rebinding Host-header guard that altimate.ts does NOT have (confirmed via git log v0.9.6..HEAD -- .../altimate.ts = empty, i.e. altimate.ts is unchanged this release).

Scope this refactor to:

  1. Extract a shared loopback-listener helper both flows call.
  2. Backport the Host-header DNS-rebinding check into altimate.ts's sign-in flow so it gets the same hardening.

Not urgent — both flows currently work correctly on their own, this is a maintainability/consistency cleanup.

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