Capture all repeated `Cookie` and `Set-Cookie` header values

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
java, kotlin
領域
api, security, testing

調査の方向性

まず、OkHttp、Ktor、Apollo 3、Apollo 4 の統合における既存の Cookie 抽出およびヘッダーアクセスの経路を調査し、次に他の SDK が繰り返されるヘッダーをどのように処理しているかを比較します。統合テストを実行する前に、共有されている Cookie ポリシーと、Data-Collection が存在しない場合の動作を追跡します。完了の条件は、安全でないカンマ処理を行わずに繰り返される Cookie と Set-Cookie の値がカバーされ、フィルタリングが引き続き有効で、形式不正な値が fail closed することです。

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

説明

Feature Java Platform: Java

Problem

The OkHttp, Ktor, and Apollo integrations capture only one Cookie or Set-Cookie header value when creating request and response contexts. Their current header accessors select a single value, so additional cookie fields are omitted from Sentry telemetry.

This is valid HTTP behavior. In particular, HTTP/2 allows clients to split the Cookie field into multiple header fields for compression. Responses also commonly contain multiple Set-Cookie fields.

This is follow-up completeness work from #5811 and supports #5666.

Check what other SDKs are doing before implementing.

Proposed solution

Make cookie extraction list-aware across OkHttp, Ktor, Apollo 3, and Apollo 4:

  • Combine repeated request Cookie fields with ; before applying the effective cookie policy.
  • Process each response Set-Cookie field independently because each field represents one cookie and its attributes.
  • Do not comma-join or comma-split Set-Cookie values. A valid Expires attribute contains a comma.
  • Add shared core helpers or integration-specific adapters that apply the effective cookie policy to every value.
  • Preserve valid Set-Cookie attributes and fail closed for malformed input.

Preserve the existing absent-Data-Collection compatibility behavior for each integration.

Acceptance criteria

  • OkHttp, Ktor, Apollo 3, and Apollo 4 capture all repeated cookie header values supported by their header APIs.
  • Multiple request Cookie fields are combined with ; and filtered as one cookie string.
  • Multiple response Set-Cookie fields are filtered independently without comma splitting or joining.
  • Built-in sensitive-cookie filtering and configured allow-list, deny-list, and off behavior apply to every cookie value.
  • Malformed cookie values never bypass filtering.
  • Integration tests cover at least two request Cookie fields and two response Set-Cookie fields where the underlying header API supports repeated values.
主要言語
Kotlin
スター
1.4k
フォーク
483
平均マージ
2日 2時間
マージ済み PR(30日)
202

環境構築

はじめの一歩

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

getsentry/sentry-java のほかの issue

getsentry/sentry-java の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

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

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