[Bug]: content-length-guardrail policy schema accepts a configuration with neither request nor response
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 83/100
調査の方向性
content-length-guardrailポリシーのpolicy-definition.yamlを見つけ、そのスキーマをword-count-guardrail、sentence-count-guardrail、regex-guardrail、url-guardrailの各スキーマと比較してください。issueに記載されたrequestまたはresponseの要件を追加し、スキーマが空のparamsを拒否し、requestまたはresponseのいずれかを含む設定を受け入れることを確認してください。issueでは、wso2/gateway-controllers#415の統合アサーションも参照されています。
索引モデルが issue の本文から書いたものです。
説明
Please select the area the issue is related to
Gateway
Please select the aspect the issue is related to
Aspect/API (API backends, definitions, contracts, interfaces, OpenAPI), Aspect/Configuration (Config files, settings, env vars, defaults)
Description
The content-length-guardrail documentation says: "At least one of request or response must be provided." The policy refuses a configuration with neither. Its schema does not enforce the rule, so such a configuration passes API creation and fails at runtime instead.
The API is created, and every request to the operation then gets HTTP 500. A mistake that should fail the deployment breaks the operation.
Other guardrails in the repository enforce this rule in their schema, for example word-count-guardrail, sentence-count-guardrail, regex-guardrail and url-guardrail:
anyOf:
- required: [ request ]
- required: [ response ]
A fix could add the same rule to the policy's policy-definition.yaml.
The integration suite in wso2/gateway-controllers#415 asserts this behaviour.
Steps to Reproduce
- Create a REST API with an operation that attaches the policy with empty parameters:
{"name":"content-length-guardrail","version":"v1","params":{}} - The API is created.
- Every request to that operation gets HTTP 500. An operation on the same API with a valid configuration still works.
Severity Level of the Issue
Severity/Minor (Non-critical functionality. Can be fixed in future releases)
Environment Details (with versions)
- Policy:
content-length-guardrailv1.1.0, wso2/gateway-controllers main (4f1520a8) - Gateway versions: 1.1.0 (patched), 1.2.0 and latest (
main-59dcd51)
- 主要言語
- Go
- スター
- 85
- フォーク
- 137
- 平均マージ
- 1日 12時間
- マージ済み PR(30日)
- 247
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
wso2/api-platform のほかの issue
-
Area/DeveloperPortal Aspect/UI Severity/Minor Type/Bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
wso2/api-platform#4369 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: host-rewrite policy documentation lists fewer allowed host characters than the policy acceptsオープンArea/Policies Aspect/Other Severity/Trivial Type/Bug
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
wso2/api-platform#4355 ·
メンテナーはふだん 1 日以内に返信
-
Area/Gateway Aspect/API Severity/Minor Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
wso2/api-platform#4348 ·
メンテナーはふだん 1 日以内に返信
-
Aspect/AI Aspect/API. Severity/Major
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
wso2/api-platform#4343 ·
メンテナーはふだん 1 日以内に返信
-
Area/Policies Aspect/Configuration Severity/Minor Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
wso2/api-platform#4330 ·
メンテナーはふだん 1 日以内に返信
wso2/api-platform の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
security
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
keyxmakerx/Chronicle#2285 ·
メンテナーはふだん 1 日以内に返信