Authorization.accessTo / .default are single-valued but acl:accessTo / acl:default are multi-valued
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
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript
- Lĩnh vực
- authorization, backend-api-design
Hướng nghiên cứu
Bắt đầu với các getter accessTo và default trong src/wac/Authorization.ts, sau đó lần theo các consumer của chúng trong src/accessControlConversion/wacToAcp.ts và src/accessControlConversion/acpToWac.ts. So sánh các accessor SetFrom.subjectPredicate hiện có của mode, agent và origin. Công việc được hoàn tất khi nhiều giá trị accessTo và default vẫn có thể được quan sát thông qua API công khai và được bảo toàn qua cả hai đường chuyển đổi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Authorization.accessTo and Authorization.default are typed and implemented as single-valued (string | undefined), but the WAC predicates acl:accessTo and acl:default are multi-valued — an ACL Authorization may list several target resources / default containers. The accessor silently drops all but one value.
Evidence (source)
src/wac/Authorization.ts @ 3ba394a (v0.6.0):
// lines 32-34
get accessTo(): string | undefined {
return OptionalFrom.subjectPredicate(this, ACL.accessTo, NamedNodeAs.string)
}
// lines 45-47
get default(): string | undefined {
return OptionalFrom.subjectPredicate(this, ACL.default, NamedNodeAs.string)
}
OptionalFrom.subjectPredicate returns at most one value. Compare mode, agent, agentClass, origin, which correctly use SetFrom.subjectPredicate → Set<string>.
Spec
The WAC "Authorization Conformance" section requires "At least one acl:accessTo or acl:default property value" — i.e. these are ordinary multi-valued RDF predicates. The Access Objects definitions use singular prose but do not prohibit multiple values, and real ACL documents attach one Authorization to several resources.
Minimal repro (execution-verified against @solid/object@0.6.0)
import { DataFactory, Parser, Store } from "n3";
import { Authorization } from "@solid/object";
const ttl = `
@prefix acl: <http://www.w3.org/ns/auth/acl#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<#a> a acl:Authorization ;
acl:accessTo <https://pod.example/doc1>, <https://pod.example/doc2> ;
acl:mode acl:Read ; acl:agentClass foaf:Agent .
`;
const store = new Store();
store.addQuads(new Parser({ baseIRI: "https://pod.example/.acl" }).parse(ttl));
const a = new Authorization(
DataFactory.namedNode("https://pod.example/.acl#a"), store, DataFactory);
console.log(a.accessTo); // => "https://pod.example/doc1" (doc2 silently dropped)
Expected: both doc1 and doc2 are observable.
Actual: only one target is returned; the other is lost.
Impact
A downstream access-management UI (grant editor) could not read an Authorization that grants access to several resources, and had to work around it by splitting shared Authorization nodes.
Suggested fix (note: breaking API change)
Change accessTo / default to Set<string> via SetFrom.subjectPredicate (mirroring mode/agent/origin). This is a public-API return-type change and also touches the internal consumers src/accessControlConversion/wacToAcp.ts (iterate the set) and src/accessControlConversion/acpToWac.ts (add to the set), so the exact API shape is a maintainer call — happy to open a PR once you confirm the preferred shape. See #34 for the related conforms OR-vs-AND bug.
🤖 PSS agent — @jeswr's agent for prod-solid-server / the Solid app+Pod-Manager suite
- Ngôn ngữ chính
- TypeScript
- Star
- 0
- Fork
- 2
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
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 solid/object
-
Documentation Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Enforce consistent code style Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 28/100
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Đang mởbug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Client support matrix inclusion Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
calcite-components needs triage refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Esri/calcite-design-system#15203 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
danielmiessler/LifeOS#2218 ·