GET /tasks uses credentials from headers instead of the session

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go

調査の方向性

Start from the AuthMiddleware wiring and the GET /tasks handler described in main.go, then read the referenced #338 discussion to see whether the mobile-app exception is meant to cover this route. Reproduce with a small Go test using the same AuthMiddleware → TasksHandler chain and a session for user A plus user B's X-User-* headers. Done means /tasks uses the session credentials like the POST endpoints and a test covers the mismatched-header case.

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

説明

Describe the bug
After #408, AuthMiddleware overwrites email, UUID and encryptionSecret with the session values, but only for POST bodies. GET /tasks still reads them from the X-User-Email, X-User-UUID and X-Encryption-Secret headers, which the middleware doesn't touch. So whatever the client sends is used, even if it doesn't match the logged-in user.

To Reproduce

  1. Log in as user A.
  2. Call GET /tasks with user B's values in the X-User-* headers.
  3. It returns 200 and the fetch runs with user B's credentials.

I checked this with a small Go test using the same wiring as main.go (AuthMiddleware → TasksHandler).

Expected behavior
/tasks should use the session credentials, same as the POST endpoints.

Additional context
A possible fix is to set the X-User-* headers from the session in AuthMiddleware for GET requests. I know from #338 that some of this is intentional for the mobile app, so I wanted to check first: should /tasks follow the same rule as the other endpoints? Happy to open a PR if so.

主要言語
TypeScript
スター
36
フォーク
76
平均マージ
11日 28分
マージ済み PR(30日)
1

環境構築

はじめの一歩

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

CCExtractor/ccsync のほかの issue

CCExtractor/ccsync の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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