Technique/tactic association pagination reports page length as total
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
- Ambito
- api
Direzione di ricerca
Start with the pagination logic in app/services/stix/techniques-service.js around line 488 and app/services/stix/tactics-service.js around line 155, then compare it with Workbench's shared pagination behavior. Inspect the schemas for both endpoints and add regression tests for the listed pagination cases in both directions. Done means totals count all filtered associations and stay correct on empty beyond-end pages, with the pagination envelope documented.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Verified on REST API 4.24.0, commit 69b37fe769e6abe7675d413451a8361aecc36bea.
Reproduction and impact
Create three tactics and three techniques whose kill-chain phases associate every technique with all three tactics. Unpaged reads return three matches in each direction:
GET /api/techniques/TECHNIQUE_ID/modified/MODIFIED/tactics
GET /api/tactics/TACTIC_ID/modified/MODIFIED/techniques
Request each endpoint with limit=1&includePagination=true at successive offsets:
| Offset | Returned items | Actual total | Expected total |
|---|---|---|---|
| 0–2 | 1 distinct item per page | 1 | 3 |
| 3 | 0 | 0 | 3 |
Direct HTTP requests reproduce this with stable unpaged baselines. Filtering and slicing work, but the reported total incorrectly indicates that only one match exists when three are available.
Root cause and expected fix
Both techniques-service.js and tactics-service.js calculate total: pagedResults.length.
Count all filtered associations before slicing, consistent with Workbench's shared pagination behavior. Total should remain three across every page, including an empty beyond-end page. Document the pagination envelope in both endpoint schemas, which currently describe only array responses.
Add regression tests for both directions, page identities, invariant totals, zero matches, nonzero/beyond-end offsets, and limit=0. Related historical pagination feature: closed issue #221.
- Lingua principale
- JavaScript
- Stelle
- 57
- Fork
- 18
- Merge medio
- 1g 26m
- PR unite (30g)
- 7
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di mitre-attack/attack-workbench-rest-api
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 74/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
Tutte le issue di mitre-attack/attack-workbench-rest-api
Issue simili
-
macOS
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
beyondcode/herd-community#1761 ·
-
Make a dry lesson funApertacontent good first issue hacktoberfest
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
vieanderes/understory#19 ·
-
automated issue report
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
lirantal/discoprint#37 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
tauri-apps/tauri#16219 ·
I maintainer di solito rispondono entro 2 giorni
-
[aw] Upgrade availableApertaagentic-workflows
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
githubnext/gh-aw-cao#16599 ·
I maintainer di solito rispondono entro 1 giorno