Skip to content

Add an export token for Wing#392

Merged
vicb merged 1 commit into
masterfrom
wing
Jun 22, 2026
Merged

Add an export token for Wing#392
vicb merged 1 commit into
masterfrom
wing

Conversation

@vicb

@vicb vicb commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary by Sourcery

New Features:

  • Introduce a WING_TOKEN secret for use in live tracking export functionality.

Summary by CodeRabbit

  • New Features
    • Added support for WING_TOKEN authentication in the live tracking system.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c4f94331-6953-4928-b207-db4f3be24697

📥 Commits

Reviewing files that changed from the base of the PR and between 4ebd453 and 82aee0c.

📒 Files selected for processing (3)
  • apps/fxc-server/src/app/routes/live-track.ts
  • secrets.d.ts
  • secrets.env

Walkthrough

A new WING_TOKEN secret is introduced across three files: it is declared as a string in the SECRETS TypeScript type, added as a placeholder in secrets.env, and wired into the /tracks.pbf token switch in the live-track route via a fall-through case into the existing ZIPLINE_TOKEN handling logic.

Changes

WING_TOKEN Secret and Route Integration

Layer / File(s) Summary
WING_TOKEN secret declaration and env template
secrets.d.ts, secrets.env
Adds WING_TOKEN: string to the SECRETS TypeScript declaration and inserts a WING_TOKEN placeholder entry in the environment template.
WING_TOKEN fall-through case in /tracks.pbf switch
apps/fxc-server/src/app/routes/live-track.ts
Inserts case SECRETS.WING_TOKEN: immediately before case SECRETS.ZIPLINE_TOKEN: in the token switch, causing WING_TOKEN requests to fall through and reuse the ZIPLINE_TOKEN response logic.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • vicb/flyXC#391: Introduced the SECRETS.ZIPLINE_TOKEN case in the /tracks.pbf switch — this PR adds WING_TOKEN as a fall-through into that same block.

Poem

🐇 A token for wings, a secret so small,
One line in the switch, it covers them all.
Fall through to Zipline, the logic is shared,
The .env placeholder carefully prepared.
Hop hop, little secret, now fly with the rest! 🪁

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a new WING_TOKEN export token across configuration and routing files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wing

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sourcery-ai

sourcery-ai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds support for authenticating live tracking requests using a new WING_TOKEN secret, treating it equivalently to the existing ZIPLINE_TOKEN flow, and declares the new secret in the shared secrets typings and environment configuration.

Sequence diagram for live tracking authentication with WING_TOKEN and ZIPLINE_TOKEN

sequenceDiagram
  actor Client
  participant TrackerRouter as getTrackerRouter
  participant Redis

  Client->>TrackerRouter: HTTP request with auth token
  alt [token matches SECRETS.WING_TOKEN]
    TrackerRouter->>Redis: getBuffer(Keys.fetcherFullProtoH12)
    Redis-->>TrackerRouter: liveGroupProto
    TrackerRouter-->>Client: 200 live tracking data
  else [token matches SECRETS.ZIPLINE_TOKEN]
    TrackerRouter->>Redis: getBuffer(Keys.fetcherFullProtoH12)
    Redis-->>TrackerRouter: liveGroupProto
    TrackerRouter-->>Client: 200 live tracking data
  else [token does not match]
    TrackerRouter-->>Client: 401 unauthorized
  end
Loading

File-Level Changes

Change Details Files
Enable live tracking authentication using the new WING_TOKEN secret alongside the existing ZIPLINE_TOKEN path.
  • Extend the token switch statement in the live tracking route handler to recognize WING_TOKEN and route it through the same logic currently used for ZIPLINE_TOKEN.
  • Ensure that requests authenticated with WING_TOKEN can fetch the liveGroupProto payload from Redis using the existing key.
apps/fxc-server/src/app/routes/live-track.ts
Declare the new WING_TOKEN secret in shared configuration so it can be used across the codebase.
  • Add WING_TOKEN to the SECRETS TypeScript declaration to type-check its usage.
  • Update secrets environment configuration to include a placeholder or actual value for WING_TOKEN so it can be provided at runtime.
secrets.d.ts
secrets.env

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Consider adding a short comment above the case SECRETS.WING_TOKEN: to clarify that the fall-through to the ZIPLINE_TOKEN logic is intentional, so future readers don’t assume a missing break.
  • Double-check that WING_TOKEN is wired through your configuration (e.g., secrets.env or equivalent) so it’s actually provided at runtime, since this diff only updates the type declaration and usage.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider adding a short comment above the `case SECRETS.WING_TOKEN:` to clarify that the fall-through to the `ZIPLINE_TOKEN` logic is intentional, so future readers don’t assume a missing `break`.
- Double-check that `WING_TOKEN` is wired through your configuration (e.g., `secrets.env` or equivalent) so it’s actually provided at runtime, since this diff only updates the type declaration and usage.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@vicb vicb merged commit 05e9ee2 into master Jun 22, 2026
6 checks passed
@vicb vicb deleted the wing branch June 22, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant