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

Abierto
#506 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
javascript

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
JavaScript
Estrellas
56
Forks
18
Merge medio
19 h 39 min
PR fusionados (30 d)
7

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de mitre-attack/attack-workbench-rest-api

Todos los issues de mitre-attack/attack-workbench-rest-api

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.