Web UI: ApiSchema.ts doesn't match the server's HTTP routes for logout and user updates

オープン
#4,214 コメント 2 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@princecherry9905 がすでに取り組んでいます。

2026年10月19日 から。

評価

この issue はまだ評価されていません。

説明

good first issue web
Bug description

web/src/lib/api/ApiSchema.ts is a hand-written list of the HTTP routes the Web UI calls, and three entries don't match the server's HTTP API (core/server/src/http.rs and core/server/src/http/handlers.rs):

  • Logout is declared as POST /users/logout. The server route is DELETE /users/logout.
  • There is a GET /users/{id} entry with a request body of username, status and permissions. The server's update route is PUT /users/{id}, and its body (UpdateUser) takes username, status and options. permissions is ignored; permissions are changed with PUT /users/{id}/permissions.
  • The PUT /users/{id}/permissions entry makes permissions required. The server accepts it as null or missing, which removes all of the user's permissions.

The logout route moved from POST to DELETE in #889 (April 2024), a year before the Web UI was brought into this repo in #1739, and the type list was never updated. None of these entries is used yet: the Edit user modal is a placeholder, and nothing calls logout or the permissions route. They would fail once user editing is built on them.

Separately, the Web UI's logout (authStore.logout() in web/src/lib/auth/authStore.svelte.ts) only clears the token cookie and never calls the server, so the server-side session stays open. The server's logout ends the session but doesn't revoke the token, which stays valid until it expires. Is calling DELETE /users/logout on logout wanted?

This should wait until #4212 is merged. It adds core/server/openapi.json, a description of every HTTP route that is kept in step with the server by a test, so the fix can check the Web UI's entries against it, or generate them from it, rather than reading the Rust code.

Affected area / component

Web UI

Deployment

Not applicable

Versions

The current default branch.

Reproduction

Compare the entries in web/src/lib/api/ApiSchema.ts with the routes in core/server/src/http.rs and the request types in core/common/src/http/users/.

Contribution
  • I'm willing to submit a pull request to fix this bug
Good first issue
  • I think this could be a good first issue for a new contributor
主要言語
Rust
スター
5.3k
フォーク
548
平均マージ
2日 20時間
マージ済み PR(30日)
194

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/iggy のほかの issue

apache/iggy の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。