Extended Validation in Schemas
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- java
調査の方向性
まず、issue に記載されているリンク先の protovalidate 標準制約、PGV、および PBJ parser と code-generator のスコープを確認します。どのバリデーションルールと互換性アプローチが適切かを判断し、そのうえで parse-time のチェックとルールのドキュメントをどのようにカバーするかを定義します。プロジェクトに、文書化された制約とテストを備えた、合意済みで高性能なバリデーション設計があれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem
We would like the ability to provide extended validation rules for fields in the schema and then validate them at parse time in PBJ. The primary reason for this is security to limit the effects of badly written binary protobuf to cause the reader to spend more resources than absolutely necessary. The secondary reason is improved rigor in schemas so they are more precise and there is less scope for mistakes. The rules covered should include:
- Min/Max sizes for Strings, Bytes and Sub-Message fields
- Min/Max for repeated fields
- Number ranges for numeric types, accepted options.
- Max recursive message depth
- Message max size in bytes
The rules we choose should be very fast to check at parse time and not have a noticeable performance impact on parsing.
There is also the aim that this can be used for tightening the specification documentation for protobuf APIs. So ideally rules documentation will be supported for explaining these rules and what they exist etc.
Solution
We could define our own or choose to be compatible with an existing option. For example "protovalidate" library from Buf.
https://github.com/bufbuild/protovalidate
The full options are way too much with full Google Common Expression Language support but maybe the Standard Constraints subset is applicable.
https://github.com/bufbuild/protovalidate/blob/main/docs/standard-constraints.md
There is also an older version called "protoc-gen-validate (PGV)" https://github.com/bufbuild/protoc-gen-validate that seems more widely used and might be a better fit.
History blog on V1 and V2 https://buf.build/blog/protoc-gen-validate-v1-and-v2
Alternatives
No response
- 主要言語
- Java
- スター
- 44
- フォーク
- 16
- 平均マージ
- 1日 3時間
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
hashgraph/pbj のほかの issue
-
JSON writer mis-indents a map field inside a nested message再び着手できるかも @himanchalkaushale が 9 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンBug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
hashgraph/pbj#1012 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Generated hashCode() repeats earlier fields' code before a map field対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンBug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
hashgraph/pbj#877 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Document what the fast code generation work learned about performance対応中かも @jasperpotts が 6 日前に担当しました。 オープン
hashgraph/pbj#1036 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
MetricsHub/metricshub-community#1532 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
asciidoctor/asciidoctor-intellij-plugin#2157 ·
メンテナーはふだん 4 日以内に返信
-
account bug exercise lecture
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
rusefi/rusefi#10602 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信