mitre-attack / mitre-attack/attack-workbench-rest-api

Extract collection bundle validation code into a callable function

Open
#267 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
57
Forks
18
Avg merge
6m
Merged PRs (30d)
2

Description

Currently there is a significant set of collection bundle validation code included directly in the collectionBundlesController.importBundles() function. This makes is difficult for other parts of the system to call collectionBundlesService.importBundles() without duplicating the validation code.

This issue is to extract that validation logic and move it to a function in the collectionBundlesService to facilitate other code calling the service's importBundle() function.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating collectionBundlesController.importBundles() and collectionBundlesService.importBundles()/importBundle(). Trace the collection bundle validation currently embedded in the controller and determine the service function's expected inputs and callers. Done means the validation is callable from collectionBundlesService and the controller no longer duplicates it, with existing behavior preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.