Collection-index refresh returns HTTP 500 because the service method is missing

オープン
#506 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
javascript
領域
api, backend, databases

調査の方向性

Start with app/controllers/collection-indexes-controller.js around line 120, then read app/services/stix/collection-indexes-service.js and its base classes to trace the missing refresh entry point. Add regression coverage for newer and unchanged remote content, unknown IDs, missing URLs, and remote failures; done means POST /api/collection-indexes/{id}/refresh no longer returns this TypeError and updates the database only when appropriate.

索引モデルが issue の本文から書いたものです。

説明

Summary

POST /api/collection-indexes/{id}/refresh calls collectionIndexService.refresh(id), but neither CollectionIndexesService nor its base classes implement refresh. The endpoint returns HTTP 500 before looking up the index or fetching its remote URL.

Observed on REST API 4.24.0, commit 69b37fe769e6abe7675d413451a8361aecc36bea.

Reproduction
  1. Authenticate with an editor or administrator session.
  2. Create a collection index.
  3. Send POST /api/collection-indexes/{id}/refresh.

Server logs:

[ERROR] Failed with error: TypeError: collectionIndexService.refresh is not a function
[HTTP] POST /api/collection-indexes/bc94bee0-f775-47cb-b93a-cb6171ba58a5/refresh 500

The controller catches the exception; the API continued serving requests afterward.

Expected behavior

Retrieve the index from workspace.remote_url and update the database when the remote index is newer. Handle unknown IDs, missing URLs, and remote failures explicitly.

Relevant implementation

Implement single-index refresh and add regression coverage for newer/unchanged remote content and error cases.

主要言語
JavaScript
スター
56
フォーク
18
平均マージ
19時間 39分
マージ済み PR(30日)
7

環境構築

はじめの一歩

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

mitre-attack/attack-workbench-rest-api のほかの issue

mitre-attack/attack-workbench-rest-api の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

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

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