INT-1678 Update Flashpoint integration to a new V2 endpoint #22
INT-1678 Update Flashpoint integration to a new V2 endpoint #22
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Pull request overview
Updates the Flashpoint integration to use the new Technical Intelligence v2 indicators endpoints and enhances the UI to display richer indicator details consistent with the Flashpoint UI.
Changes:
- Migrated indicator search and details calls from v1 to v2 endpoints, adding a new “indicator details” query path.
- Expanded the client block UI to support fetching + toggling indicator details (sightings, related IOCs, MITRE ATT&CK).
- Removed legacy config/config.js usage, added lodash dependency, and updated the GitHub Actions workflow Node setup.
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| server/request.js | Replaces importing config/config.js with an inline config stub for request defaults |
| server/queries/index.js | Exposes new getIndicatorDetails query |
| server/queries/getIndicators.js | Switches indicator search to v2 endpoint and updates query construction/filtering |
| server/queries/getIndicatorDetails.js | Adds v2 indicator details fetch by indicatorId |
| server/dataTransformations.js | Renames exported blocklist filter helper |
| server/assembleLookupResults.js | Ensures empty arrays when entity has no indicator/vuln results |
| integration.js | Adds startup wrapper and new onMessage action for indicator details |
| package.json | Bumps version, adds lodash dependency, and pins a transitive dependency via overrides |
| config/config.js | Removes legacy integration config definition file |
| client/styles.less | Adds styles for related IOCs table and indicator details UI |
| client/block.js | Adds client-side actions/helpers to fetch and display indicator details |
| client/block.hbs | Reworks indicator rendering + adds sections for sightings/related IOCs/MITRE data |
| .github/workflows/run-int-dev-checklist.yml | Updates GH Actions versions and pins Node 18 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| case 'GET_INDICATOR_DETAILS': | ||
| try { | ||
| const indicatorDetails = await getIndicatorDetails( | ||
| payload.indicatorId, | ||
| options | ||
| ); | ||
| cb(null, indicatorDetails); | ||
| } catch (error) { | ||
| const err = parseErrorToReadableJson(error); | ||
|
|
||
| Logger.error( | ||
| { error, formattedError: err }, | ||
| 'GET_INDICATOR_DETAILS Failed' | ||
| ); | ||
| cb(err); | ||
| } |
There was a problem hiding this comment.
onMessage relies on a module-scoped Logger that is only set by startup(). If onMessage is invoked before startup (or if startup isn’t wired as expected), Logger.error(...) will throw and prevent the callback from being called. Prefer retrieving a logger via getLogger() inside onMessage (as is done in doLookup) or guard against an unset logger to ensure error handling always works.
server/request.js
Outdated
| logging: { setLogger, getLogger } | ||
| } = require('polarity-integration-utils'); | ||
| const config = require('../config/config'); | ||
| const config = { |
There was a problem hiding this comment.
Usually, we can also remove the config usage.
client/styles.less
Outdated
| } | ||
| } | ||
|
|
||
| .related-iocs-table { |
There was a problem hiding this comment.
In order to ensure styling consistencies across integrations, I do recommend using predefined classes like:
.w-100 for width: 100%, .mb-1 for margin-bottom: 5px
client/styles.less
Outdated
| } | ||
| } | ||
|
|
||
| .indicator-title { |
There was a problem hiding this comment.
Is it possible to use either h1 element or .p-title class instead of defining custom title styling?
Requests updates from v1 endpoint to v2:
Template changes in order to replicate Flashpoint UI
Removed old config.js
.gitignore update