Casework: description validation accepts two request entities sharing one requestRoute
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
- 75/100
Hướng nghiên cứu
Vấn đề nằm trong crates/registry-casework-breg/src/config.rs, cụ thể là hàm validate_description. Hãy bắt đầu bằng cách kiểm tra bài kiểm tra duplicate-entity hiện có để hiểu mẫu xác thực. Sửa đổi hàm để theo dõi requestRoute ngoài requestEntity và thêm một bài kiểm tra đơn vị mới cho các route trùng lặp. Chạy các bài kiểm tra hiện có để đảm bảo bản sửa lỗi hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
validate_description in crates/registry-casework-breg/src/config.rs refuses a v1alpha2 source description that lists the same requestEntity twice, but it never compares requestRoute across entries. A description that gives two different request entities the same route therefore passes caseworkctl check, caseworkctl package, and runtime input validation (validate_description_input).
BregAdapter::new requires routes to be unique, so the same project is refused only when the runtime constructs the source adapter. An offline-approved package is undeployable.
caseworkctl source add does not produce this shape, since it copies each route from bregctl explain change-requests. It is reachable through a hand-edited or otherwise supplied description.
Expected
The description decoder refuses a repeated requestRoute in the same place it refuses a repeated requestEntity, so the offline checks and adapter construction agree.
Fix sketch
- Track the routes seen while building
by_entityinvalidate_description, and returnSourceAdapterError::Invalidon a repeat. - Add a unit test beside the existing duplicate-entity description test: two entries with distinct entities and one shared route are refused.
Found in review of #1355, after the related policy-level entity uniqueness check landed there.
- Ngôn ngữ chính
- Rust
- Star
- 2
- Fork
- 0
- Merge trung bình
- 9 giờ 19 phút
- Pull request đã merge (30 ngày)
- 275
Chuẩn bị môi trường
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 registrystack/registry-stack
-
test(breg): postgres_startup needs the tooling feature its required-features does not declareĐang mởarea:breg bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
registrystack/registry-stack#2307 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:breg area:docs documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
registrystack/registry-stack#2302 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:docs documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
registrystack/registry-stack#2253 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:coordinator bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
registrystack/registry-stack#2252 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:release bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
registrystack/registry-stack#2248 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của registrystack/registry-stack
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
farion1231/cc-switch#8696 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
C-bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
rust-lang/rust-analyzer#23547 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tech-debt
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
OpenZeppelin/guardian#570 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100