Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Technique/tactic association pagination reports page length as total

未关闭
#511 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
javascript
领域
api

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
JavaScript
星标
57
派生
18
平均合并
1 天 26 分钟
30 天内合并 PR
7

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

mitre-attack/attack-workbench-rest-api 的其他 Issue

查看 mitre-attack/attack-workbench-rest-api 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。