@jupiterone/integration-sdk-http-client
This package contains the default HTTP Client used to interact with API
providers.
HTTP Client Features
The following checked items are implemented. Future features are listed but
unchecked.
Installation
npm install @jupiterone/integration-sdk-http-client
# or
yarn add @jupiterone/integration-sdk-http-client
8.34.0 - 2023-04-11
Added
- Added support for
json
environment variables. Example:
.env
file:
// .env
SEVERITIES=["HIGH", "CRITICAL"]
Code:
import { Client } from './client';
import { createVulnEntity } from './converter';
type IntegrationConfig = { apiKey: string; severities: string[] };
const invocationConfig: IntegrationInvocationConfig = {
instanceConfigFields: [
{
apiKey: { type: 'string', mask: true },
severities: { type: 'json' },
},
],
integrationSteps: [
{
id: 'fetch-vulnerabilities',
name: 'Fetch Vulnerabilities',
entities: [{ resourceName: 'Vuln', _type: 'vuln', _class: 'Finding' }],
relationships: [],
executionHandler: ({ instance }) => {
const { apiKey, severities } = instance.config;
const client = new Client({ apiKey });
await iterateVulnerabilitiesForSeverity(
{ severities },
async (vuln) => {
await jobState.addEntity(createVulnEntity(vuln));
},
);
},
},
],
};