Share the RoomService transport and add DeleteRoom
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
調査の方向性
Start with the private post_room_service and livekit_room_service_request in src/livekit/rooms.rs (around lines 122 and 138), then the token helper livekit_room_admin_token in src/token.rs near line 111. The work moves the transport into a new src/livekit/room_service.rs, adds livekit_room_create_token and delete_room, and extends tests/unit/livekit/rooms.rs, tests/token.rs and a new tests/unit/livekit/room_service.rs. Done means the existing room tests pass unedited, the new axum-stub tests cover the DeleteRoom request, the 404 not_found case and the 500 error case, and ./scripts/test.sh passes.
索引モデルが issue の本文から書いたものです。
説明
Context
This issue separates P4 from #306 so it can be worked on independently. The peer sweeper (P11) has to delete a LiveKit room once a peer session ends, but the only RoomService client today lives in src/livekit/rooms.rs: post_room_service and livekit_room_service_request (src/livekit/rooms.rs:122, :138) are private to the agent's duplicate-participant handling, and livekit_room_service_request reads its credentials from AgentConfig, which codetrial web does not load.
Desired outcome
A RoomService client that any server-side caller can use with a LiveKit URL, API key and API secret, plus a delete_room call for cleanup. Agent behavior stays exactly as it is.
Proposed implementation
- Add
src/livekit/room_service.rsand movepost_room_serviceandlivekit_room_service_requestinto it. The request function takes(url, api_key, api_secret)instead of&AgentConfig. - Keep the duplicate-agent handling (
isolate_local_agent,remove_room_participant,is_participant_gone) andvalidate_livekit_credentialsinrooms.rs, calling the moved transport with the fields fromAgentConfig. - Add
livekit_room_create_tokenbesidelivekit_room_admin_token(src/token.rs:111). It grantsroomCreate: trueand nothing else, since LiveKit requiresroomCreatefor DeleteRoom. - Add
delete_room(url, api_key, api_secret, room, now_seconds), which posts{"room": room}to/twirp/livekit.RoomService/DeleteRoom. A 404 whose body carries the Twirpnot_foundcode returnsOk, because a room that is already gone is the outcome cleanup wants. Any other non-success status is an error that names the method, the status and the body.
Acceptance criteria
- The existing cases in
tests/unit/livekit/rooms.rspass unedited. - A new
tests/unit/livekit/room_service.rsruns a local axum stub and asserts thatdelete_roomposts to/twirp/livekit.RoomService/DeleteRoomwith a bearer token that holdsroomCreateand notroomAdmin. - The same file asserts that a
not_foundreply returnsOkand that another failure, such as a 500, returns an error. -
tests/token.rsasserts the claims oflivekit_room_create_token, including that it carries noroomAdmin,roomJoinorroomList, and adds it toevery_token_expires. -
./scripts/test.shpasses, with any skipped lanes reported in the pull request.
Scope
This adds the transport and DeleteRoom only. It does not call CreateRoom, does not add any peer caller (that is P11), and does not change the tokens or the RoomService calls the agent already makes.
Ownership
I will implement this issue and open the pull request.
Refs #306
- 主要言語
- Rust
- スター
- 160
- フォーク
- 64
- 平均マージ
- 1日 10時間
- マージ済み PR(30日)
- 116
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sysprog21/codetrial のほかの issue
-
Four problem loader browser tests fail on Windows対応中かも @Patriciaath999 が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
sysprog21/codetrial#322 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
sysprog21/codetrial#318 · コメント 2 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Show local time in past attempt labels対応中かも @jin11109 が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
sysprog21/codetrial#317 · コメント 2 件 · リアクション 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Highlight the active line in the code editor対応中かも @ArthurArthurArthur0817 が 10 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
sysprog21/codetrial#247 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Let the candidate undo Continue without camera in the preflight対応中かも @HALA1028 が 1 日前に担当しました。 オープン
sysprog21/codetrial#327 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
sysprog21/codetrial の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
pop-os/cosmic-comp#2956 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
libp2p/rust-libp2p#6694 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
EmbarkStudios/cargo-deny#910 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
tursodatabase/turso#10054 ·
メンテナーはふだん 1 日以内に返信
-
build: Update rust version対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンdependencies
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
ibm-granite-community/granite-cli#229 ·
メンテナーはふだん 1 日以内に返信