getContainerElements can return urls outside of the container
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- typescript
调研方向
从 src/util/containerLogic.ts 中的 getContainerElements 开始,使用 issue 中的 Turtle 示例复现该行为。确保结果仅包含容器 URL 下的资源,然后验证外部 URL 会从返回的元素中排除,且不能被视为子元素。
由索引模型根据 Issue 内容生成。
描述
I think intuitively the getContainerElements function should only return elements that have this folder as a parent (e.g. for /folder/ only /folder/* and not /other/). The current implementation allows any urls to be returned if the turtle file specifies this.
As an implication, when creating a folder with additional containment triples, these folders:
- recursive deletion can delete arbitrary urls (not tested, but the code looks like it would simply fetch all "contained" resources and then delete them, even if they are on a different server)
- are displayed to have children that could be arbitrary urls (tested, see below for an example)
Creating folders with additional containment triples is currently possible with ESS. Also note that it's not forbidden by the spec to add additional data when POSTing new folders, so it's something we should consider in the applications. An example turtle is following, which will display the public folder inside of confusion/:
@prefix ldp: <http://www.w3.org/ns/ldp#> .
@prefix me: <https://storage.inrupt.com/ba39f662-260a-415e-aee1-3290e3974092/reviews/confusion/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
me: rdf:type ldp:Container , ldp:BasicContainer ;
ldp:contains <https://sheep.solidcommunity.net/public/> .
Currently you can test this here, not sure how long I'll keep the link (note that it shows a folder of inrupt.com, but contains a child from solidcommunity.net): https://solidos.github.io/mashlib/dist/browse.html?uri=https%3A%2F%2Fstorage.inrupt.com%2Fba39f662-260a-415e-aee1-3290e3974092%2Freviews%2Fconfusion%2F
As a fix, I'd suggest that getContainerElements filters out urls that do not start with the container url. eg for the container https://example.org/public/ it should have the filter urls.filter(url => url.startsWith("https://example.org/public/")) (not sure how this looks like with rdflib objects).
- 主要语言
- TypeScript
- 星标
- 12
- 派生
- 13
- 平均合并
- 15 小时 15 分钟
- 30 天内合并 PR
- 3
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
SolidOS/solid-logic 的其他 Issue
-
Migrate to Vite 未关闭
SolidOS/solid-logic#314 · 已指派 1 人 ·
-
enhancement
难度 5/5 一周以上 新手友好度 42/100
SolidOS/solid-logic#291 · 2 条评论 ·
-
bug
SolidOS/solid-logic#290 · 已指派 1 人 ·
-
enhancement
SolidOS/solid-logic#274 · 4 条评论 · 已指派 2 人 ·
-
难度 4/5 3-5 天 新手友好度 25/100
SolidOS/solid-logic#76 · 2 条评论 ·
查看 SolidOS/solid-logic 的全部 Issue
相似的 Issue
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
-
Crush 未关闭
难度 1/5 1 小时以内 新手友好度 85/100
catppuccin/catppuccin#3125 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
ElementsProject/cln-application#167 · 1 条评论 · 1 个 reaction ·
-
难度 2/5 1-3 小时 新手友好度 75/100
Quantco/pnpm-licenses#17 ·
-
难度 2/5 1-3 小时 新手友好度 75/100