Bucket DELETE ignores ?force=1: aw-server-rust deletes without it (Python refuses with 401)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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時間
- マージ済み PR(30日)
- 25
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 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
kashsuks/Pinel#172 · コメント 1 件 ·
メンテナーはふだん 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 日以内に返信