influxdata / influxdata/influxdb-java
the WriteApi does not check whether a tag value cotains unauthorized characters ("\n","\r"...)
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 1.2k
- フォーク
- 469
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
InfluxDB has some restrictions on tag values : they cannot contain some characters such as: line feed (\n), carriage return (\r). Currently, the Java client library does not check whether values of tags are safe (free of unauthorized characters) before writing them into InfluxDB.
For example, I have a measurement classe called `Temperature`, and it contains a tag field `location`. When I put `location="mad\nrid"` and I write it using `WriteApi`, it will throw the following exception: `partial write: unable to parse 'temperature,location=mad': missing fields dropped=0`. So a partial write will be done in the influxDB database: a new measurement `rid` will be mistakenly created, and it will contain only a part of the write.
If a tag value contains '\r', the java client will not even throw an exception, and it will perform an incorrect write into the database.
I think it would be really useful to add a method that ensures that tag values are correct before sending them to InfluxDB through the line protocol, in order to avoid incorrect writes and anomalous behaviors.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、タグ値をInfluxDB line protocolにシリアライズするWriteApiのパスを追跡します。改行と復帰を含む値がどのように処理されるかを確認し、安全でない値によって部分的または不正な書き込みが発生しないようにバリデーションを追加します。既存のWriteApiテストがあれば、それを使って両方の文字をカバーします。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- databases
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100