[Bug]: content-length-guardrail policy accepts a non-string streamingJsonPath at API creation
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 74/100
Hướng nghiên cứu
Tìm lược đồ chính sách content-length-guardrail và so sánh các tham số phản hồi của lược đồ với tham số chuỗi streamingJsonPath được ghi lại trong tài liệu và ví dụ word-count-guardrail. Kiểm tra bộ kiểm thử tích hợp được nhắc đến trong wso2/gateway-controllers#415 để hiểu hành vi tạo API hiện tại. Hoàn tất khi quá trình tạo API từ chối giá trị streamingJsonPath không phải chuỗi bằng HTTP 400, nhất quán với jsonPath.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Please select the area the issue is related to
Gateway
Please select the aspect the issue is related to
Aspect/Configuration (Config files, settings, env vars, defaults)
Description
The content-length-guardrail documentation lists streamingJsonPath as a string parameter of the response configuration. The policy reads it and refuses a value that is not a string. Its schema does not declare the parameter, so a wrong value passes API creation and fails at runtime instead.
The API is created, and every request to the operation then gets HTTP 500. A typo in this parameter breaks the operation instead of failing the deployment. jsonPath is declared as a string, and a non-string jsonPath is rejected at creation as expected.
The other seven policies in the repository that read streamingJsonPath all declare it in their schema, for example word-count-guardrail:
streamingJsonPath:
type: string
The integration suite in wso2/gateway-controllers#415 asserts the current behaviour.
Steps to Reproduce
- Create a REST API with an operation that attaches the policy with a non-string
streamingJsonPath:{"name":"content-length-guardrail","version":"v1","params":{"response":{"enabled":true,"min":1,"max":10,"streamingJsonPath":5}}} - The API is created.
- Every request to that operation gets HTTP 500. An operation on the same API with a valid configuration still works.
- Repeat with
"jsonPath": 5. API creation fails with HTTP 400, as expected.
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)
- Ngôn ngữ chính
- Go
- Star
- 85
- Fork
- 137
- Merge trung bình
- 1 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 247
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của wso2/api-platform
-
Area/DeveloperPortal Aspect/UI Severity/Minor Type/Bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
wso2/api-platform#4369 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: host-rewrite policy documentation lists fewer allowed host characters than the policy acceptsĐang mởArea/Policies Aspect/Other Severity/Trivial Type/Bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
wso2/api-platform#4355 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Area/Gateway Aspect/API Severity/Minor Type/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
wso2/api-platform#4348 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Aspect/AI Aspect/API. Severity/Major
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
wso2/api-platform#4343 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Area/Policies Aspect/API Aspect/Configuration Severity/Minor Type/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
wso2/api-platform#4329 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của wso2/api-platform
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
keyxmakerx/Chronicle#2285 ·
Maintainer thường phản hồi trong vòng 1 ngày