Test aggregator proxy failures and response forwarding

オープン
#53 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
74/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
next.js, typescript

調査の方向性

Read app/api/aggregator/[...path]/route.ts and tests/api-client.test.ts, then follow CONTRIBUTING.md for the pinned pnpm setup. Add deterministic route-handler tests with mocked upstream fetches for the allowlist, methods, environment selection, forwarding, rejection and error mapping cases in the acceptance criteria. Run lint, typecheck, unit tests and build; done when the tests pass without credentials or external requests.

索引モデルが issue の本文から書いたものです。

説明

enhancement help wanted

Problem

The frontend routes browser requests through app/api/aggregator/[...path]/route.ts. Regression coverage must exercise this server boundary, rather than only mocking the browser API client. Related historical issue: #10.

Scope

Add deterministic route-handler tests using mocked upstream fetches. Cover the current endpoint allowlist, method restrictions, environment selection and error mapping. No live network or backend is required.

Acceptance criteria

  • Allowed GET requests and POST quotes/prepare requests forward to the expected /api/v1 path with query/body preserved.
  • Unknown paths, wrong methods, credential-bearing/invalid origins and oversized POST bodies are rejected without an upstream request.
  • Missing production configuration returns NOT_CONFIGURED; upstream failure/non-JSON/redirect responses produce the documented errors.
  • Upstream status and optional request ID survive forwarding; all responses use Cache-Control: no-store.
  • Browser cookies and Authorization headers are not forwarded to the aggregator.
  • Tests run in CI without credentials or external requests.

Contributor guidance

Estimated difficulty: medium. Start with the route handler and tests/api-client.test.ts. Follow CONTRIBUTING.md and use Node 22+ with the pinned pnpm version. Submit test results for lint, typecheck, unit tests and build. Keep this PR focused on the proxy boundary.

主要言語
TypeScript
スター
0
フォーク
3
平均マージ
19時間 38分
マージ済み PR(30日)
36

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

VELTRIXAE/frontend のほかの issue

VELTRIXAE/frontend の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。