the WriteApi does not check whether a tag value cotains unauthorized characters ("\n","\r"...)
还没有人认领这个 Issue。
评估
调研方向
首先跟踪将标签值序列化为 InfluxDB line protocol 的 WriteApi 路径。验证包含换行和回车的值是如何处理的,然后添加验证,以确保不安全的值不会产生部分写入或错误写入;如果已有 WriteApi 测试,请使用它们覆盖这两个字符。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Java
- 星标
- 1.2k
- 派生
- 468
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
influxdata/influxdb-java 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 38/100
influxdata/influxdb-java#1012 ·
-
难度 5/5 一周以上 新手友好度 30/100
influxdata/influxdb-java#1006 · 1 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 25/100
influxdata/influxdb-java#1005 · 3 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
influxdata/influxdb-java#999 ·
-
难度 4/5 3-5 天 新手友好度 35/100
influxdata/influxdb-java#970 ·
查看 influxdata/influxdb-java 的全部 Issue
相似的 Issue
-
Use GHA setup gradle action可能已有人在做 @bric3 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
openhab/openhab-addons#21921 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
jellyfin/jellyfin-androidtv#5885 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
priority:P2 product:orazaka type:bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复