breg: serve each profile's writable inputs in the Action metadata
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 54/100
- Loại issue
- Tính năng
- Độ 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
- api, backend-api-design
Hướng nghiên cứu
Start with the proposals.actions[] inventory in crates/registry-breg/src/api/mod.rs:761 and the per-profile metadata entry in crates/registry-breg/src/artifacts.rs:1304; trace how compiled permissions supply readable inputs and writable inputs. Then inspect the Rust client metadata, crates/registry-breg-client-node/client.d.ts, the Python binding, and the Proposals docs and metadata schema. Done means the acceptance cases pass for explicit, default, and empty writable input lists, and all three clients expose the field with type tests.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
A Proposal grant can restrict a profile to a list of writableInputs. The engine compiles the list and enforces it: an Edit, Revise, Rebase or Start that changes any other input is refused. The metadata never serves the list. A client cannot tell a fixed input from an editable one, so a form lets people change fields the server will then refuse. The person finds out only after submitting.
Evidence
All line numbers are on origin/main at 36d25ef652.
crates/registry-breg/src/contract.rs:715:writable_inputs: Option<UniqueSet<String>>on the grant source. Absent means every declared input is writable.crates/registry-breg/src/model.rs:578: the compiledwritable_inputs: Option<BTreeSet<String>>onCompiledProposalPermission.crates/registry-breg/src/immediate_actions.rs:2912to:2939: package validation of the list.crates/registry-breg/src/mutation/proposal.rs:130to:156(validate_input_write_authority) refuses a value outside the list. It is called at:1180(Start) and:1489.crates/registry-breg/src/mutation/proposal.rs:590: the list is part of the request digest contract, so it is already treated as part of the public response contract.crates/registry-breg/src/api/mod.rs:761to:780: theproposals.actions[]inventory servesactionId,accessProfile,operations,readableInputsandreadableContextFields. It has no writable member.crates/registry-breg-client-node/client.d.ts:497to:503(BRegProposalActionDescriptor) andcrates/registry-breg-client/src/metadata.rs:966to:981carryreadableInputsonly. The Python binding follows the Rust client (crates/registry-breg-client-py/src/lib.rs:1527).- Documented behaviour:
docs/site/src/content/docs/configure/breg-proposals.mdx:133to:172says a grant withoutwritableInputsleaves every input writable.
Proposed change
- Add
writableInputsto eachproposals.actions[]entry, for profiles whose operations include Start, Edit, Revise or Rebase. Absent grant list serves the full set of declared inputs, so the member is always present and a client does not need to know the default rule. Serve an empty list for profiles that cannot write. - Also serve it in the per-profile Action description (
public_action_metadata_entry,crates/registry-breg/src/artifacts.rs:1304) where a profile can start the Action. - Add the member to the Rust client, the Node client types and the Python binding. This is an additive response member, so it relies on the client tolerance work in #1945.
- Update the Proposals configuration page and the metadata schema.
Acceptance
- A test shows a grant with
writableInputs: [a]serves["a"], and a grant without the key serves every declared input. - A test shows a reader serves an empty list.
- The Rust, Node and Python clients expose the member, with type tests.
- A client form built from the metadata cannot offer an input that the server refuses.
- Ngôn ngữ chính
- Rust
- Star
- 2
- Fork
- 0
- Merge trung bình
- 9 giờ 48 phút
- Pull request đã merge (30 ngày)
- 151
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
-
area:breg enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
registrystack/registry-stack#2765 ·
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 62/100
registrystack/registry-stack#2761 ·
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 70/100
registrystack/registry-stack#2743 ·
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 76/100
registrystack/registry-stack#2706 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
macOS contributor gates: Messaging config tests fail under the symlinked macOS temporary directoryĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
registrystack/registry-stack#2704 ·
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ự
-
[Bug] 建议把黑白主题设置同步到启动页面Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
AstrBotDevs/AstrBot-desktop#197 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/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 68/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
stackabletech/airflow-operator#898 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
2 advisory ignore entries no longer match anything (`bytes`, `time` already patched in `Cargo.lock`)Có thể đã có người làm @zyl71 đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100