Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Technique/tactic association pagination reports page length as total

Đang mở
#511 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript
Lĩnh vực
api

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
JavaScript
Star
57
Fork
18
Merge trung bình
1 ngày 26 phút
Pull request đã merge (30 ngày)
7

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của mitre-attack/attack-workbench-rest-api

Tất cả issue của mitre-attack/attack-workbench-rest-api

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.