Reject a news link that points back at the participant portal
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 63/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
阅读 SettingsController.ts:37-44 和 SettingsController.ts:86-101,追踪 newsLink 的验证,然后检查 SettingsController.test.ts 中现有的 URL 验证测试。为 origin 与 HOSTNAME 匹配的 newsLink 添加测试覆盖,并验证请求返回 422。issue 指出这项工作依赖于 #937,且可能与 #973 合并,因此开始前请检查它们的状态。
由索引模型根据 Issue 内容生成。
描述
PATCH /settings accepts a newsLink on the participant portal's own host, and the admin gets no sign anything is wrong. updateSettings in SettingsController.ts:86-101 only runs sanitiseAndValidateUrl (SettingsController.ts:37-44), which checks the URL's shape, not where it points.
Before #986, a link like that made the portal load itself inside the news page (#861). Since #986, the participant portal treats it as no link (isUsableNewsLink in application/user-client/src/App.tsx), so News quietly drops out of the menu. The admin sees a successful save and has no way to tell why News is gone.
The backend already knows the portal's address. HOSTNAME is the participant portal URL used to build the register and reset-password links (ParticipantsController.ts:1006, UsersController.ts:405).
Proposal: reject a newsLink whose origin matches HOSTNAME's with a 422, the same way the existing URL check fails, and add a test in SettingsController.test.ts.
#937 and #973 both change sanitiseAndValidateUrl, so this is easiest once #937 lands, and could go in with #973.
Related: #861, #986, #598, #956.
- 主要语言
- TypeScript
- 星标
- 4
- 派生
- 0
- 平均合并
- 8 小时 37 分钟
- 30 天内合并 PR
- 3
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Garvan-Data-Science-Platform/ctrl 的其他 Issue
-
难度 1/5 1-3 小时 新手友好度 82/100
-
admin-client backend bug
难度 2/5 1-3 小时 新手友好度 76/100
-
backend bug
难度 2/5 1-3 小时 新手友好度 68/100
Garvan-Data-Science-Platform/ctrl#970 · 1 条评论 ·
-
backend bug
难度 2/5 1-3 小时 新手友好度 72/100
-
backend bug
难度 2/5 1-3 小时 新手友好度 78/100
查看 Garvan-Data-Science-Platform/ctrl 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
simkimsia/netlify-axi#19 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
subhranshudash13-dotcom/Contribo#74 ·
维护者通常 1 天内回复
-
enhancement frontend good first issue Stellar Wave trivial
难度 2/5 1-3 小时 新手友好度 76/100
Godgift-care/sci-healthcare-frontend#166 · 1 条评论 ·
维护者通常 1 天内回复
-
backend good first issue security Stellar Wave trivial
难度 2/5 1-3 小时 新手友好度 82/100
Godgift-care/sci-healthcare-backend#171 · 1 条评论 ·
维护者通常 1 天内回复