Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Casework: description validation accepts two request entities sharing one requestRoute

Đã đóng Phù hợp với người mới
#1,383 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
backend

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ả

agent-ready area:casework bug criticality:p2 triage:needs-implementation

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_entity in validate_description, and return SourceAdapterError::Invalid on 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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của registrystack/registry-stack

Tất cả issue của registrystack/registry-stack

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.