Bucket DELETE ignores ?force=1: aw-server-rust deletes without it (Python refuses with 401)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 aw-server/src/endpoints/bucket.rs 中的 bucket_delete 开始,它不接受 force 参数,然后将其与 Python 版 aw-server 的守卫进行比较,后者在非测试模式且没有 ?force=1 时返回 401。对两个服务器运行 curl 复现,以确认差异。完成标准是:在非测试模式下,不带 ?force=1 的 DELETE 会被拒绝,并且确认 aw-webui 和 aw-client-js 会发送 force=1。
由索引模型根据 Issue 内容生成。
描述
DELETE /api/0/buckets/<id> on aw-server-rust deletes the bucket and all its events without ?force=1. The Python aw-server refuses the same request outside testing mode, and the docs say force=1 is required (REST reference, "Delete").
This matters because clients rely on the guard. aw-client's delete_bucket(bucket_id, force=False) sends ?force=1 only when you pass force=True. On aw-server-rust, the default call is irreversible.
Repro (v0.14.3 linux release, normal mode, isolated XDG_* dirs):
aw-server-rust --port 5651 & # and the bundled Python aw-server on 5652
for p in 5651 5652; do
curl -s -o /dev/null -X POST -H Content-Type:application/json \
-d '{"client":"t","type":"t","hostname":"h"}' http://127.0.0.1:$p/api/0/buckets/vb
curl -s -w " <- DELETE without force: %{http_code}\n" -X DELETE http://127.0.0.1:$p/api/0/buckets/vb
curl -s -o /dev/null -w "GET after: %{http_code}\n" http://127.0.0.1:$p/api/0/buckets/vb
done
<- DELETE without force: 200 # aw-server-rust
GET after: 404 # bucket and events are gone
{"message": "Deleting buckets is only permitted if aw-server is running in testing mode or if ?force=1"}
<- DELETE without force: 401 # Python aw-server
GET after: 200
?force=0 also deletes on aw-server-rust. bucket_delete in aw-server/src/endpoints/bucket.rs takes no force parameter at all.
Expected: the same guard as Python: refuse without ?force=1 unless the server runs with --testing.
One compatibility point to check first: whether aw-webui and aw-client-js send force=1 when deleting a bucket from the UI. If they don't, they need the parameter in the same change.
Found during a docs-vs-reality pass of the REST API docs (ActivityWatch/docs#224).
- 主要语言
- Rust
- 星标
- 322
- 派生
- 107
- 平均合并
- 2 天 16 小时
- 30 天内合并 PR
- 25
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ActivityWatch/aw-server-rust 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 80/100
ActivityWatch/aw-server-rust#872 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
ActivityWatch/aw-server-rust#798 · 1 条评论 ·
维护者通常 1 天内回复
-
query: categorize rules can pin unbounded memory in the regex cache and run past query_timeout可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 4/5 3-5 天 新手友好度 22/100
ActivityWatch/aw-server-rust#893 · 1 条评论 ·
维护者通常 1 天内回复
-
aw-client CLI ignores aw-client.toml host/port可能已有人在做 @TimeToBuildBob 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
ActivityWatch/aw-server-rust#888 ·
维护者通常 1 天内回复
-
aw-sync status calls the daemon's live staging db orphaned and safe to delete可能已有人在做 @TimeToBuildBob 今天认领。 未关闭
难度 3/5 1-2 天 新手友好度 30/100
ActivityWatch/aw-server-rust#887 ·
维护者通常 1 天内回复
查看 ActivityWatch/aw-server-rust 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 69/100
维护者通常 1 天内回复
-
test_a_503_raises_unavailable_error fails on macOS about one run in six可能已有人在做 @naman-modi 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug ui
难度 2/5 1-3 小时 新手友好度 72/100
userFRM/egui-charts#4168 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复