feat: Add new credentials for the HTTP Request node (#9833)

Co-authored-by: Jonathan Bennetts <jonathan.bennetts@gmail.com>
Co-authored-by: Shireen Missi <94372015+ShireenMissi@users.noreply.github.com>
This commit is contained in:
Bram Kn 2024-08-23 19:19:05 +02:00 committed by GitHub
parent 6422fb33c0
commit 26f1af397b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 828 additions and 76 deletions

View file

@ -0,0 +1,73 @@
import type {
ICredentialDataDecryptedObject,
ICredentialTestRequest,
ICredentialType,
IHttpRequestOptions,
INodeProperties,
} from 'n8n-workflow';
export class DatadogApi implements ICredentialType {
name = 'datadogApi';
displayName = 'Datadog API';
documentationUrl = 'datadog';
icon = { light: 'file:icons/Datadog.svg', dark: 'file:icons/Datadog.svg' } as const;
httpRequestNode = {
name: 'Datadog',
docsUrl: 'https://docs.datadoghq.com/api/latest/',
apiBaseUrlPlaceholder: 'https://api.datadoghq.com/api/v1/metrics',
};
properties: INodeProperties[] = [
{
displayName: 'URL',
name: 'url',
required: true,
type: 'string',
default: 'https://api.datadoghq.com',
},
{
displayName: 'API Key',
name: 'apiKey',
required: true,
type: 'string',
typeOptions: { password: true },
default: '',
},
{
displayName: 'APP Key',
name: 'appKey',
required: false,
type: 'string',
default: '',
typeOptions: { password: true },
description: 'For some endpoints, you also need an Application key.',
},
];
async authenticate(
credentials: ICredentialDataDecryptedObject,
requestOptions: IHttpRequestOptions,
): Promise<IHttpRequestOptions> {
requestOptions.headers = {
'DD-API-KEY': credentials.apiKey,
'DD-APPLICATION-KEY': credentials.appKey,
};
if (!requestOptions.headers['DD-APPLICATION-KEY']) {
delete requestOptions.headers['DD-APPLICATION-KEY'];
}
return requestOptions;
}
test: ICredentialTestRequest = {
request: {
baseURL: '={{$credentials.url}}',
url: '/api/v1/validate',
method: 'GET',
},
};
}

View file

@ -0,0 +1,67 @@
import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class DfirIrisApi implements ICredentialType {
name = 'dfirIrisApi';
displayName = 'DFIR-IRIS API';
documentationUrl = 'dfiriris';
icon = { light: 'file:icons/DfirIris.svg', dark: 'file:icons/DfirIris.svg' } as const;
httpRequestNode = {
name: 'DFIR-IRIS',
docsUrl: 'https://docs.dfir-iris.org/operations/api/',
apiBaseUrlPlaceholder: 'http://<yourserver_ip>/manage/cases/list',
};
properties: INodeProperties[] = [
{
displayName: 'Base URL',
name: 'baseUrl',
type: 'string',
default: '',
placeholder: 'e.g. https://localhost',
description:
'The API endpoints are reachable on the same Address and port as the web interface.',
required: true,
},
{
displayName: 'API Key',
name: 'apiKey',
required: true,
type: 'string',
typeOptions: { password: true },
default: '',
},
{
displayName: 'Ignore SSL Issues',
name: 'skipSslCertificateValidation',
type: 'boolean',
default: false,
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
Authorization: '=Bearer {{$credentials.apiKey}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: '={{$credentials.baseUrl}}',
url: '/api/ping',
method: 'GET',
skipSslCertificateValidation: '={{$credentials.skipSslCertificateValidation}}',
},
};
}

View file

@ -0,0 +1,37 @@
import type { IAuthenticateGeneric, ICredentialType, INodeProperties } from 'n8n-workflow';
export class DynatraceApi implements ICredentialType {
name = 'dynatraceApi';
displayName = 'DynatraceAPI';
documentationUrl = 'dynatrace';
icon = { light: 'file:icons/Dynatrace.svg', dark: 'file:icons/Dynatrace.svg' } as const;
httpRequestNode = {
name: 'Dynatrace',
docsUrl: 'https://docs.dynatrace.com/docs/dynatrace-api',
apiBaseUrlPlaceholder: 'https://{your-environment-id}.live.dynatrace.com/api/v2/events',
};
properties: INodeProperties[] = [
{
displayName: 'API Key',
name: 'apiKey',
required: true,
type: 'string',
typeOptions: { password: true },
default: '',
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
Authorization: '=Api-Token {{$credentials.apiKey}}',
},
},
};
}

View file

@ -1,4 +1,10 @@
import type { ICredentialType, INodeProperties } from 'n8n-workflow';
import type {
ICredentialDataDecryptedObject,
ICredentialTestRequest,
ICredentialType,
IHttpRequestOptions,
INodeProperties,
} from 'n8n-workflow';
export class ElasticSecurityApi implements ICredentialType {
name = 'elasticSecurityApi';
@ -8,12 +14,42 @@ export class ElasticSecurityApi implements ICredentialType {
documentationUrl = 'elasticSecurity';
properties: INodeProperties[] = [
{
displayName: 'Base URL',
name: 'baseUrl',
type: 'string',
default: '',
placeholder: 'e.g. https://mydeployment.kb.us-central1.gcp.cloud.es.io:9243',
description: "Referred to as Kibana 'endpoint' in the Elastic deployment dashboard",
required: true,
},
{
displayName: 'Type',
name: 'type',
type: 'options',
options: [
{
name: 'API Key',
value: 'apiKey',
},
{
name: 'Basic Auth',
value: 'basicAuth',
},
],
default: 'basicAuth',
},
{
displayName: 'Username',
name: 'username',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
type: ['basicAuth'],
},
},
},
{
displayName: 'Password',
@ -24,15 +60,52 @@ export class ElasticSecurityApi implements ICredentialType {
},
default: '',
required: true,
displayOptions: {
show: {
type: ['basicAuth'],
},
},
},
{
displayName: 'Base URL',
name: 'baseUrl',
type: 'string',
default: '',
placeholder: 'e.g. https://mydeployment.kb.us-central1.gcp.cloud.es.io:9243',
description: "Referred to as Kibana 'endpoint' in the Elastic deployment dashboard",
displayName: 'API Key',
name: 'apiKey',
required: true,
type: 'string',
typeOptions: { password: true },
default: '',
displayOptions: {
show: {
type: ['apiKey'],
},
},
},
];
async authenticate(
credentials: ICredentialDataDecryptedObject,
requestOptions: IHttpRequestOptions,
): Promise<IHttpRequestOptions> {
if (credentials.type === 'apiKey') {
requestOptions.headers = {
Authorization: `ApiKey ${credentials.apiKey}`,
};
} else {
requestOptions.auth = {
username: credentials.username as string,
password: credentials.password as string,
};
requestOptions.headers = {
'kbn-xsrf': true,
};
}
return requestOptions;
}
test: ICredentialTestRequest = {
request: {
baseURL: '={{$credentials.baseUrl}}',
url: '/api/endpoint/metadata',
method: 'GET',
},
};
}

View file

@ -0,0 +1,50 @@
import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class FilescanApi implements ICredentialType {
name = 'filescanApi';
displayName = 'Filescan API';
documentationUrl = 'filescan';
icon = { light: 'file:icons/Filescan.svg', dark: 'file:icons/Filescan.svg' } as const;
httpRequestNode = {
name: 'Filescan',
docsUrl: 'https://www.filescan.io/api/docs',
apiBaseUrlPlaceholder: 'https://www.filescan.io/api/system/do-healthcheck',
};
properties: INodeProperties[] = [
{
displayName: 'API Key',
name: 'apiKey',
required: true,
type: 'string',
typeOptions: { password: true },
default: '',
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
'X-Api-Key': '={{$credentials.apiKey}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: 'https://www.filescan.io/api',
url: '/system/do-healthcheck',
method: 'GET',
},
};
}

View file

@ -0,0 +1,51 @@
import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';
export class MalcoreApi implements ICredentialType {
name = 'malcoreApi';
displayName = 'MalcoreAPI';
documentationUrl = 'malcore';
icon = { light: 'file:icons/Malcore.png', dark: 'file:icons/Malcore.png' } as const;
httpRequestNode = {
name: 'Malcore',
docsUrl: 'https://malcore.readme.io/reference/upload',
apiBaseUrlPlaceholder: 'https://api.malcore.io/api/urlcheck',
};
properties: INodeProperties[] = [
{
displayName: 'API Key',
name: 'apiKey',
required: true,
type: 'string',
typeOptions: { password: true },
default: '',
},
];
authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
apiKey: '={{$credentials.apiKey}}',
},
},
};
test: ICredentialTestRequest = {
request: {
baseURL: 'https://api.malcore.io/api',
url: '/urlcheck',
method: 'POST',
body: { url: 'google.com' },
},
};
}

View file

@ -0,0 +1 @@
<svg height="2500" viewBox=".27 .27 800.01 858.98" width="2328" xmlns="http://www.w3.org/2000/svg"><path d="m670.38 608.27-71.24-46.99-59.43 99.27-69.12-20.21-60.86 92.89 3.12 29.24 330.9-60.97-19.22-206.75zm-308.59-89.14 53.09-7.3c8.59 3.86 14.57 5.33 24.87 7.95 16.04 4.18 34.61 8.19 62.11-5.67 6.4-3.17 19.73-15.36 25.12-22.31l217.52-39.46 22.19 268.56-372.65 67.16zm404.06-96.77-21.47 4.09-41.25-426.18-702.86 81.5 86.59 702.68 82.27-11.94c-6.57-9.38-16.8-20.73-34.27-35.26-24.23-20.13-15.66-54.32-1.37-75.91 18.91-36.48 116.34-82.84 110.82-141.15-1.98-21.2-5.35-48.8-25.03-67.71-.74 7.85.59 15.41.59 15.41s-8.08-10.31-12.11-24.37c-4-5.39-7.14-7.11-11.39-14.31-3.03 8.33-2.63 17.99-2.63 17.99s-6.61-15.62-7.68-28.8c-3.92 5.9-4.91 17.11-4.91 17.11s-8.59-24.62-6.63-37.88c-3.92-11.54-15.54-34.44-12.25-86.49 21.45 15.03 68.67 11.46 87.07-15.66 6.11-8.98 10.29-33.5-3.05-81.81-8.57-30.98-29.79-77.11-38.06-94.61l-.99.71c4.36 14.1 13.35 43.66 16.8 57.99 10.44 43.47 13.24 58.6 8.34 78.64-4.17 17.42-14.17 28.82-39.52 41.56-25.35 12.78-58.99-18.32-61.12-20.04-24.63-19.62-43.68-51.63-45.81-67.18-2.21-17.02 9.81-27.24 15.87-41.16-8.67 2.48-18.34 6.88-18.34 6.88s11.54-11.94 25.77-22.27c5.89-3.9 9.35-6.38 15.56-11.54-8.99-.15-16.29.11-16.29.11s14.99-8.1 30.53-14c-11.37-.5-22.25-.08-22.25-.08s33.45-14.96 59.87-25.94c18.17-7.45 35.92-5.25 45.89 9.17 13.09 18.89 26.84 29.15 55.98 35.51 17.89-7.93 23.33-12.01 45.81-18.13 19.79-21.76 35.33-24.58 35.33-24.58s-7.71 7.07-9.77 18.18c11.22-8.84 23.52-16.22 23.52-16.22s-4.76 5.88-9.2 15.22l1.03 1.53c13.09-7.85 28.48-14.04 28.48-14.04s-4.4 5.56-9.56 12.76c9.87-.08 29.89.42 37.66 1.3 45.87 1.01 55.39-48.99 72.99-55.26 22.04-7.87 31.89-12.63 69.45 24.26 32.23 31.67 57.41 88.36 44.91 101.06-10.48 10.54-31.16-4.11-54.08-32.68-12.11-15.13-21.27-33.01-25.56-55.74-3.62-19.18-17.71-30.31-17.71-30.31s8.18 18.18 8.18 34.24c0 8.77 1.1 41.56 15.16 59.96-1.39 2.69-2.04 13.31-3.58 15.34-16.36-19.77-51.49-33.92-57.22-38.09 19.39 15.89 63.96 52.39 81.08 87.37 16.19 33.08 6.65 63.4 14.84 71.25 2.33 2.25 34.82 42.73 41.07 63.07 10.9 35.45.65 72.7-13.62 95.81l-39.85 6.21c-5.83-1.62-9.76-2.43-14.99-5.46 2.88-5.1 8.61-17.82 8.67-20.44l-2.25-3.95c-12.4 17.57-33.18 34.63-50.44 44.43-22.59 12.8-48.63 10.83-65.58 5.58-48.11-14.84-93.6-47.35-104.57-55.89 0 0-.34 6.82 1.73 8.35 12.13 13.68 39.92 38.43 66.78 55.68l-57.26 6.3 27.07 210.78c-12 1.72-13.87 2.56-27.01 4.43-11.58-40.91-33.73-67.62-57.94-83.18-21.35-13.72-50.8-16.81-78.99-11.23l-1.81 2.1c19.6-2.04 42.74.8 66.51 15.85 23.33 14.75 42.13 52.85 49.05 75.79 8.86 29.32 14.99 60.68-8.86 93.92-16.97 23.63-66.51 36.69-106.53 8.44 10.69 17.19 25.14 31.25 44.59 33.9 28.88 3.92 56.29-1.09 75.16-20.46 16.11-16.56 24.65-51.19 22.4-87.66l25.49-3.7 9.2 65.46 421.98-50.81zm-256.73-177.77c-1.18 2.69-3.03 4.45-.25 13.2l.17.5.44 1.13 1.16 2.62c5.01 10.24 10.51 19.9 19.7 24.83 2.38-.4 4.84-.67 7.39-.8 8.63-.38 14.08.99 17.54 2.85.31-1.72.38-4.24.19-7.95-.67-12.97 2.57-35.03-22.36-46.64-9.41-4.37-22.61-3.02-27.01 2.43.8.1 1.52.27 2.08.46 6.65 2.33 2.14 4.62.95 7.37m69.87 121.02c-3.27-1.8-18.55-1.09-29.29.19-20.46 2.41-42.55 9.51-47.39 13.29-8.8 6.8-4.8 18.66 1.7 23.53 18.23 13.62 34.21 22.75 51.08 20.53 10.36-1.36 19.49-17.76 25.96-32.64 4.43-10.25 4.43-21.31-2.06-24.9m-181.14-104.96c5.77-5.48-28.74-12.68-55.52 5.58-19.75 13.47-20.38 42.35-1.47 58.72 1.89 1.62 3.45 2.77 4.91 3.71 5.52-2.6 11.81-5.23 19.05-7.58 12.23-3.97 22.4-6.02 30.76-7.11 4-4.47 8.65-12.34 7.49-26.59-1.58-19.33-16.23-16.26-5.22-26.73" fill="#632ca6"/></svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 34 KiB

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="-2 0 260 260" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid">
<g>
<path d="M86.3857687,21.6895737 C83.0567503,39.2593929 78.9879501,65.3367034 76.7686045,91.7839049 C72.8847498,138.390162 75.2890408,169.645946 75.2890408,169.645946 L9.63340081,231.972567 C9.63340081,231.972567 4.63987326,197.017874 2.05063675,157.62449 C0.571073033,133.211689 0.0162366389,111.758015 0.0162366389,98.8118326 C0.0162366389,98.0720507 0.386127568,97.3322688 0.386127568,96.592487 C0.386127568,95.6677597 1.49580036,86.9753228 10.0032917,78.8377224 C19.250565,69.9603401 87.4954415,16.5111007 86.3857687,21.6895737 Z" fill="#1496FF">
</path>
<path d="M86.3857687,21.6895737 C83.0567503,39.2593929 78.9879501,65.3367034 76.7686045,91.7839049 C76.7686045,91.7839049 4.08503686,83.0914681 0.0162366389,100.661287 C0.0162366389,99.7365599 1.31085489,89.0097229 9.81834627,80.8721225 C19.0656195,71.9947402 87.4954415,16.5111007 86.3857687,21.6895737 L86.3857687,21.6895737 Z" fill="#1284EA">
</path>
<path d="M0.0162366389,96.4075415 L0.0162366389,100.476342 C0.756018498,97.3322688 2.05063675,95.1129233 4.63987326,91.5989594 C10.0032917,84.7559772 18.6957286,82.9065226 22.2096924,82.5366317 C39.964457,80.1323406 66.226713,77.3581587 92.6739145,76.6183768 C139.465117,75.1388131 170.35101,79.0226678 170.35101,79.0226678 L236.00665,16.6960462 C236.00665,16.6960462 201.606793,10.2229549 162.398355,5.59931831 C136.690935,2.45524541 114.127588,0.790736222 101.366351,0.0509543628 C100.441624,0.0509543628 91.3792963,-1.05871843 82.8718049,7.07888203 C73.6245316,15.9562643 26.6483836,60.5281214 7.78394616,78.4678314 C-0.72354522,86.6054319 0.0162366389,95.6677597 0.0162366389,96.4075415 Z" fill="#B4DC00">
</path>
<path d="M233.602359,176.119037 C215.847594,178.523328 189.585338,181.482455 163.138137,182.407183 C116.346934,183.886746 85.2760959,180.002892 85.2760959,180.002892 L19.6204559,242.514459 C19.6204559,242.514459 54.3902033,249.357441 93.5986418,253.796132 C117.641552,256.570314 138.910281,258.049878 151.856463,258.78966 C152.781191,258.78966 154.260754,258.049878 155.185482,258.049878 C156.110209,258.049878 165.172537,256.385369 173.680028,248.247768 C182.927301,239.370386 238.780832,175.5642 233.602359,176.119037 L233.602359,176.119037 Z" fill="#6F2DA8">
</path>
<path d="M233.602359,176.119037 C215.847594,178.523328 189.585338,181.482455 163.138137,182.407183 C163.138137,182.407183 168.131664,255.460641 150.561845,258.604714 C151.486572,258.604714 163.508028,258.049878 172.015519,249.912277 C181.262792,241.034895 238.780832,175.5642 233.602359,176.119037 L233.602359,176.119037 Z" fill="#591F91">
</path>
<path d="M154.4457,258.974605 C153.151081,258.974605 151.856463,258.78966 150.3769,258.78966 C153.705918,258.234823 155.925263,257.12515 159.439227,254.535914 C166.467155,249.542386 168.686501,240.84995 169.426282,237.335986 C172.570355,219.766167 176.824101,193.688856 178.858501,167.241655 C182.55741,120.635397 180.338065,89.5645593 180.338065,89.5645593 L245.993705,27.0529922 C245.993705,27.0529922 250.802287,61.8227396 253.576469,101.216124 C255.240978,126.923543 255.795814,149.671835 255.98076,162.248127 C255.98076,163.172854 256.720542,172.235182 248.21305,180.372783 C238.965777,189.250165 191.989629,234.006967 173.310137,251.946677 C164.432755,260.084278 155.370427,258.974605 154.4457,258.974605 L154.4457,258.974605 Z" fill="#73BE28">
</path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.6 KiB

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg width="800px" height="800px" viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet"><path d="M255.96 134.393c0-21.521-13.373-40.117-33.223-47.43a75.239 75.239 0 0 0 1.253-13.791c0-39.909-32.386-72.295-72.295-72.295-23.193 0-44.923 11.074-58.505 30.088-6.686-5.224-14.835-7.94-23.402-7.94-21.104 0-38.446 17.133-38.446 38.446 0 4.597.836 9.194 2.298 13.373C13.582 81.739 0 100.962 0 122.274c0 21.522 13.373 40.327 33.431 47.64-.835 4.388-1.253 8.985-1.253 13.79 0 39.7 32.386 72.087 72.086 72.087 23.402 0 44.924-11.283 58.505-30.088 6.686 5.223 15.044 8.149 23.611 8.149 21.104 0 38.446-17.134 38.446-38.446 0-4.597-.836-9.194-2.298-13.373 19.64-7.104 33.431-26.327 33.431-47.64z" fill="#FFF"/><path d="M100.085 110.364l57.043 26.119 57.669-50.565a64.312 64.312 0 0 0 1.253-12.746c0-35.52-28.834-64.355-64.355-64.355-21.313 0-41.162 10.447-53.072 27.998l-9.612 49.73 11.074 23.82z" fill="#F4BD19"/><path d="M40.953 170.75c-.835 4.179-1.253 8.567-1.253 12.955 0 35.52 29.043 64.564 64.564 64.564 21.522 0 41.372-10.656 53.49-28.208l9.403-49.729-12.746-24.238-57.251-26.118-56.207 50.774z" fill="#3CBEB1"/><path d="M40.536 71.918l39.073 9.194 8.775-44.506c-5.432-4.179-11.91-6.268-18.805-6.268-16.925 0-30.924 13.79-30.924 30.924 0 3.552.627 7.313 1.88 10.656z" fill="#E9478C"/><path d="M37.192 81.32c-17.551 5.642-29.67 22.567-29.67 40.954 0 17.97 11.074 34.059 27.79 40.327l54.953-49.73-10.03-21.52-43.043-10.03z" fill="#2C458F"/><path d="M167.784 219.852c5.432 4.18 11.91 6.478 18.596 6.478 16.925 0 30.924-13.79 30.924-30.924 0-3.761-.627-7.314-1.88-10.657l-39.073-9.193-8.567 44.296z" fill="#95C63D"/><path d="M175.724 165.317l43.043 10.03c17.551-5.85 29.67-22.566 29.67-40.954 0-17.97-11.074-33.849-27.79-40.326l-56.415 49.311 11.492 21.94z" fill="#176655"/></svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="200" height="200">
<path d="M0 0 C66 0 132 0 200 0 C200 66 200 132 200 200 C134 200 68 200 0 200 C0 134 0 68 0 0 Z " fill="#FCFDFE" transform="translate(0,0)"/>
<path d="M0 0 C2.97 0 5.94 0 9 0 C9.32871094 1.16015625 9.32871094 1.16015625 9.6640625 2.34375 C12.7670487 12.53567216 16.47174137 19.48366331 26.03125 24.69921875 C34.25674761 28.30328547 43.09750872 29.70941265 51.90625 31.14453125 C53.74920654 31.45088501 53.74920654 31.45088501 55.62939453 31.76342773 C58.07496857 32.16273441 60.52390935 32.54207868 62.97607422 32.89868164 C72.12276024 34.37442901 80.37525644 37.01033521 86.0625 44.75 C88.54763227 49.26524033 88.88548606 53.91974523 89 59 C88.319375 58.2575 87.63875 57.515 86.9375 56.75 C80.33542437 50.1665743 71.9889828 47.96335231 62.9765625 46.7109375 C62.23038666 46.60278717 61.48421082 46.49463684 60.71542358 46.38320923 C58.35265961 46.04195585 55.98888881 45.70836276 53.625 45.375 C52.01425005 45.14373608 50.40357208 44.91197033 48.79296875 44.6796875 C44.86278775 44.11398393 40.93168592 43.55514365 37 43 C37 43.66 37 44.32 37 45 C35.35 45 33.7 45 32 45 C32 42.36 32 39.72 32 37 C30.02 37 28.04 37 26 37 C26 37.66 26 38.32 26 39 C21.47126099 38.46720718 18.42350929 37.02542682 15 34 C14.625 30.25 14.625 30.25 15 27 C12.69 27 10.38 27 8 27 C8 29.64 8 32.28 8 35 C8.7425 34.87625 9.485 34.7525 10.25 34.625 C11.61125 34.810625 11.61125 34.810625 13 35 C13.90468139 36.44078888 14.80540368 37.88431558 15.6796875 39.34375 C22.41783682 47.79633968 36.8997569 48.35571337 46.84765625 49.63671875 C61.49484216 51.5501727 77.07139489 53.88025445 87 66 C91.76636206 73.18388288 93.32728118 80.93391059 93.125 89.4375 C93.11597656 90.16904297 93.10695313 90.90058594 93.09765625 91.65429688 C93.07436153 93.43634298 93.0385019 95.21821759 93 97 C90.26196565 95.63098283 90.2440383 94.29318019 89.25 91.4375 C85.95079819 82.93477768 80.91905937 76.61596532 73 72 C64.30384762 68.43980766 55.19090755 66.64572531 46 64.875 C43.43648447 64.37760146 40.87392978 63.87521771 38.3125 63.3671875 C37.19488281 63.15175293 36.07726562 62.93631836 34.92578125 62.71435547 C32.33059152 62.08071686 30.30875117 61.31517365 28 60 C28 58.35 28 56.7 28 55 C26.02 55 24.04 55 22 55 C22 57.31 22 59.62 22 62 C22.9075 62.04125 23.815 62.0825 24.75 62.125 C28.38696734 62.63013435 31.04241814 63.99303803 34.25 65.75 C39.57584142 68.55025373 44.76237953 70.18121512 50.5625 71.625 C51.38427734 71.83181396 52.20605469 72.03862793 53.05273438 72.25170898 C54.64781256 72.65223734 56.24302261 73.05224101 57.83837891 73.45166016 C66.63900466 75.68412068 73.02342107 77.98739494 78 86 C78.6796875 88.25 78.6796875 88.25 79 90 C78.29875 89.401875 77.5975 88.80375 76.875 88.1875 C71.93969747 84.43237851 67.53197544 82.66272502 61.39453125 81.8671875 C60.16412109 81.70089844 58.93371094 81.53460938 57.66601562 81.36328125 C56.39435547 81.20214844 55.12269531 81.04101562 53.8125 80.875 C51.27704122 80.54135349 48.74186884 80.20552105 46.20703125 79.8671875 C45.0878833 79.72394043 43.96873535 79.58069336 42.81567383 79.43310547 C40 79 40 79 37 78 C37 76.35 37 74.7 37 73 C34.36 73 31.72 73 29 73 C29 73.66 29 74.32 29 75 C22.46184177 73.36546044 17.38954095 69.6003828 12.875 64.6875 C10.38606542 62.44745888 8.27468188 62.29769835 5 62 C5 60.02 5 58.04 5 56 C6.98 56 8.96 56 11 56 C11 52.7 11 49.4 11 46 C8.36 46 5.72 46 3 46 C2.21311555 43.22276075 1.88050076 40.77389923 1.90234375 37.890625 C1.90717773 36.75947266 1.90717773 36.75947266 1.91210938 35.60546875 C1.92048828 34.82816406 1.92886719 34.05085938 1.9375 33.25 C1.94201172 32.45722656 1.94652344 31.66445312 1.95117188 30.84765625 C1.96291435 28.89840492 1.98084854 26.94919262 2 25 C0.68 25 -0.64 25 -2 25 C-2 22.69 -2 20.38 -2 18 C0.97 18 3.94 18 7 18 C7 15.03 7 12.06 7 9 C4.69 9 2.38 9 0 9 C0 6.03 0 3.06 0 0 Z " fill="#1C73C1" transform="translate(52,79)"/>
<path d="M0 0 C1.41764994 0.93601246 2.83407568 1.8738792 4.25 2.8125 C5.03890625 3.33457031 5.8278125 3.85664062 6.640625 4.39453125 C8.81092481 5.87134122 10.91413768 7.40689873 13 9 C13.33 8.01 13.66 7.02 14 6 C15.98 6 17.96 6 20 6 C20 7.65 20 9.3 20 11 C18.35 11 16.7 11 15 11 C15 11.99 15 12.98 15 14 C21.93 13.01 21.93 13.01 29 12 C29 13.98 29 15.96 29 18 C31.97 18 34.94 18 38 18 C38 14.04 38 10.08 38 6 C39.65 6 41.3 6 43 6 C43 7.32 43 8.64 43 10 C46.3 10 49.6 10 53 10 C53 11.32 53 12.64 53 14 C54.65 14 56.3 14 58 14 C58 13.01 58 12.02 58 11 C59.52102323 11.14383922 61.04180897 11.29019014 62.5625 11.4375 C63.40941406 11.51871094 64.25632812 11.59992187 65.12890625 11.68359375 C68 12 68 12 71.2890625 12.90234375 C76.77092017 13.04660316 79.60006339 10.39119109 83.8125 7.125 C85.31862653 6.00208909 86.82511928 4.87966916 88.33203125 3.7578125 C88.98921143 3.2539502 89.6463916 2.75008789 90.32348633 2.23095703 C92 1 92 1 94 0 C92.59155282 3.21524305 90.89655214 5.32183868 88.375 7.75 C87.42753906 8.67039062 87.42753906 8.67039062 86.4609375 9.609375 C85.97882813 10.06828125 85.49671875 10.5271875 85 11 C85.99 11.33 86.98 11.66 88 12 C79.8633153 19.83863765 71.45347335 26.80012669 62 33 C61.37706055 33.41008301 60.75412109 33.82016602 60.11230469 34.24267578 C58.25844875 35.44192157 56.38614406 36.60233954 54.5 37.75 C53.3965625 38.42546875 52.293125 39.1009375 51.15625 39.796875 C48 41 48 41 45.04296875 40.45703125 C41.52820892 38.77409747 38.1413911 36.95819681 34.8125 34.9375 C34.15612549 34.54046875 33.49975098 34.1434375 32.82348633 33.734375 C22.96061763 27.63754745 14.51774313 19.81562981 6 12 C6.99 11.67 7.98 11.34 9 11 C8.3503125 10.37351562 7.700625 9.74703125 7.03125 9.1015625 C6.1959375 8.28429688 5.360625 7.46703125 4.5 6.625 C3.6646875 5.81289063 2.829375 5.00078125 1.96875 4.1640625 C0 2 0 2 0 0 Z " fill="#2E9FE6" transform="translate(57,38)"/>
<path d="M0 0 C0.81404297 0.61488281 0.81404297 0.61488281 1.64453125 1.2421875 C2.35996094 1.78101563 3.07539062 2.31984375 3.8125 2.875 C4.52019531 3.40867188 5.22789063 3.94234375 5.95703125 4.4921875 C7.60456297 5.70814781 9.29624211 6.86416141 11 8 C11.37109375 10.28515625 11.37109375 10.28515625 11.4375 13.0625 C11.91481157 20.20345552 13.85080229 25.47469269 18.5 30.9375 C23.16359364 34.78496475 25.88262434 35.31641598 32 35 C34.0064731 34.70814937 36.00994193 34.38830401 38 34 C41 39.75 41 39.75 41 42 C41.66 42 42.32 42 43 42 C43.268125 41.236875 43.53625 40.47375 43.8125 39.6875 C44.94424112 37.12619116 45.91223401 35.80307062 48 34 C48.99 34.33 49.98 34.66 51 35 C55.90333175 35.4807188 59.7775613 35.00804991 64.0703125 32.64453125 C68.82432045 28.59303864 71.70918985 22.17398507 72.2734375 16.015625 C72.28632813 15.08234375 72.29921875 14.1490625 72.3125 13.1875 C72.41991586 9.65812179 72.61898473 8.42466557 75.01171875 5.7578125 C81.09751506 1 81.09751506 1 83 1 C83.57259482 19.47148474 83.57259482 19.47148474 80 27 C79.70996094 27.70511719 79.41992188 28.41023438 79.12109375 29.13671875 C76.92986233 34.09678652 74.37573435 36.81764775 70 40 C70 38.68 70 37.36 70 36 C69.33871094 36.52787109 69.33871094 36.52787109 68.6640625 37.06640625 C60.80366534 42.83370915 49.87089838 48.95694926 39.8828125 49.01953125 C37.00337016 48.31462326 34.65143625 47.32950589 32 46 C30.77661018 45.42716968 29.55261042 44.85564087 28.328125 44.28515625 C23.73248177 42.09236457 19.24170484 39.82780323 15 37 C14.67 37.99 14.34 38.98 14 40 C8.50697381 37.79329833 6.43385794 33.15405211 4 28 C2.7501514 24.04137174 1.79767787 20.07235545 1 16 C2.65 16 4.3 16 6 16 C6 13.69 6 11.38 6 9 C4.02 9 2.04 9 0 9 C0 6.03 0 3.06 0 0 Z " fill="#2892DA" transform="translate(62,56)"/>
<path d="M0 0 C1.20698658 4.82794633 0.42003532 6.00783103 -1.8203125 10.1640625 C-4.0031602 13.56120958 -6.24231666 14.74743889 -10 16 C-13.375 16.375 -13.375 16.375 -17 16 C-19.9375 13.5 -19.9375 13.5 -22 11 C-18.79619983 8.86413322 -17.98060033 8.76867825 -14.3125 8.875 C-13.10013672 8.90207031 -13.10013672 8.90207031 -11.86328125 8.9296875 C-10.94095703 8.96449219 -10.94095703 8.96449219 -10 9 C-9.34 6.69 -8.68 4.38 -8 2 C-5.36 1.34 -2.72 0.68 0 0 Z " fill="#E26C30" transform="translate(130,71)"/>
<path d="M0 0 C4.455 0.99 4.455 0.99 9 2 C9.33 4.31 9.66 6.62 10 9 C11.03060547 8.94779297 11.03060547 8.94779297 12.08203125 8.89453125 C12.98308594 8.86746094 13.88414063 8.84039062 14.8125 8.8125 C15.70582031 8.77769531 16.59914063 8.74289063 17.51953125 8.70703125 C20.41647515 9.04918998 21.22555028 9.75393573 23 12 C20.11171799 15.16335648 18.01180326 15.90454686 13.6875 16.3125 C9.20580785 15.93269558 7.38620618 14.93471202 4 12 C1.13713993 8.25966889 -0.58251689 4.80576432 0 0 Z " fill="#E1672A" transform="translate(77,71)"/>
<path d="M0 0 C3.63 0 7.26 0 11 0 C11 3.63 11 7.26 11 11 C7.37 11 3.74 11 0 11 C0 7.37 0 3.74 0 0 Z " fill="#1675C5" transform="translate(32,64)"/>
<path d="M0 0 C3.3 0 6.6 0 10 0 C10 3.3 10 6.6 10 10 C6.7 10 3.4 10 0 10 C0 6.7 0 3.4 0 0 Z " fill="#30AEF3" transform="translate(97,24)"/>
<path d="M0 0 C2.64 0 5.28 0 8 0 C8 2.97 8 5.94 8 9 C5.36 9 2.72 9 0 9 C0 6.03 0 3.06 0 0 Z " fill="#084EA3" transform="translate(51,149)"/>
<path d="M0 0 C0.66 0.66 1.32 1.32 2 2 C-0.05233685 4.2477975 -1.00667261 5.0022242 -4 6 C-10.54098361 6.2295082 -10.54098361 6.2295082 -13 5 C-12.4375 3.125 -12.4375 3.125 -11 1 C-7.15391594 -0.49569935 -3.91701403 -1.74089512 0 0 Z " fill="#D53D20" transform="translate(98,81)"/>
<path d="M0 0 C2.64 0 5.28 0 8 0 C8 2.64 8 5.28 8 8 C5.36 8 2.72 8 0 8 C0 5.36 0 2.72 0 0 Z " fill="#1960AF" transform="translate(43,126)"/>
<path d="M0 0 C2.64 0 5.28 0 8 0 C8 2.64 8 5.28 8 8 C5.36 8 2.72 8 0 8 C0 5.36 0 2.72 0 0 Z " fill="#1B6FBD" transform="translate(36,88)"/>
<path d="M0 0 C2.64 0 5.28 0 8 0 C8 2.64 8 5.28 8 8 C5.36 8 2.72 8 0 8 C0 5.36 0 2.72 0 0 Z " fill="#3091D7" transform="translate(36,39)"/>
<path d="M0 0 C1.33998047 0.31324219 1.33998047 0.31324219 2.70703125 0.6328125 C3.60808594 0.83648437 4.50914063 1.04015625 5.4375 1.25 C6.46810547 1.50136719 6.46810547 1.50136719 7.51953125 1.7578125 C7.18953125 3.4078125 6.85953125 5.0578125 6.51953125 6.7578125 C3.33203125 7.0703125 3.33203125 7.0703125 -0.48046875 6.7578125 C-3.41796875 4.2578125 -3.41796875 4.2578125 -5.48046875 1.7578125 C-2.48046875 -0.2421875 -2.48046875 -0.2421875 0 0 Z " fill="#D02E22" transform="translate(113.48046875,80.2421875)"/>
<path d="M0 0 C1.9375 0.8125 1.9375 0.8125 4 2 C5.11450049 5.34350146 4.91669067 6.66657937 4 10 C3.01 11.485 3.01 11.485 2 13 C1.34 13 0.68 13 0 13 C-1.06671952 9.79984144 -0.94845472 8.11455706 -0.5625 4.8125 C-0.46066406 3.91144531 -0.35882813 3.01039062 -0.25390625 2.08203125 C-0.17011719 1.39496094 -0.08632812 0.70789063 0 0 Z " fill="#E6F1FA" transform="translate(103,85)"/>
<path d="M0 0 C2.31 0 4.62 0 7 0 C7 2.31 7 4.62 7 7 C4.69 7 2.38 7 0 7 C0 4.69 0 2.38 0 0 Z " fill="#58B5ED" transform="translate(83,34)"/>
<path d="M0 0 C1.98 0 3.96 0 6 0 C6 2.31 6 4.62 6 7 C4.02 7 2.04 7 0 7 C0 4.69 0 2.38 0 0 Z " fill="#3790D4" transform="translate(53,63)"/>
<path d="M0 0 C4.455 0.99 4.455 0.99 9 2 C9 3.65 9 5.3 9 7 C8.34 6.01 7.68 5.02 7 4 C5.35 5.32 3.7 6.64 2 8 C-0.1519437 4.77208445 -0.20086443 3.71599191 0 0 Z " fill="#EB8C38" transform="translate(77,71)"/>
<path d="M0 0 C1.65 0.33 3.3 0.66 5 1 C3.9375 2.9375 3.9375 2.9375 2 5 C-1.6875 5.75 -1.6875 5.75 -5 6 C-3.35 4.02 -1.7 2.04 0 0 Z " fill="#CF2A21" transform="translate(95,81)"/>
<path d="M0 0 C1.65 0 3.3 0 5 0 C5 1.98 5 3.96 5 6 C3.35 6 1.7 6 0 6 C0 4.02 0 2.04 0 0 Z " fill="#1658A8" transform="translate(33,141)"/>
<path d="M0 0 C1.98 0 3.96 0 6 0 C6 1.65 6 3.3 6 5 C4.02 5 2.04 5 0 5 C0 3.35 0 1.7 0 0 Z " fill="#2F8FD6" transform="translate(48,51)"/>
<path d="M0 0 C1.98 0 3.96 0 6 0 C6 1.65 6 3.3 6 5 C4.02 5 2.04 5 0 5 C0 3.35 0 1.7 0 0 Z " fill="#2A98E0" transform="translate(71,44)"/>
<path d="M0 0 C0.95465783 2.16967689 1.14401212 3.56328793 0.3984375 5.82421875 C-0.35870385 7.5684743 -1.17609198 9.28627131 -2 11 C-2.33 11 -2.66 11 -3 11 C-3.08096803 9.54257537 -3.13917774 8.08387193 -3.1875 6.625 C-3.22230469 5.81289062 -3.25710937 5.00078125 -3.29296875 4.1640625 C-3.19628906 3.44992188 -3.09960938 2.73578125 -3 2 C-2.01 1.34 -1.02 0.68 0 0 Z " fill="#EA882E" transform="translate(130,71)"/>
<path d="M0 0 C1.65 0 3.3 0 5 0 C5 1.65 5 3.3 5 5 C3.35 5 1.7 5 0 5 C0 3.35 0 1.7 0 0 Z " fill="#0A55A9" transform="translate(87,164)"/>
<path d="M0 0 C1.65 0 3.3 0 5 0 C5 1.65 5 3.3 5 5 C3.35 5 1.7 5 0 5 C0 3.35 0 1.7 0 0 Z " fill="#FEFEFF" transform="translate(97,61)"/>
<path d="M0 0 C1.65 0 3.3 0 5 0 C5 1.65 5 3.3 5 5 C3.35 5 1.7 5 0 5 C0 3.35 0 1.7 0 0 Z " fill="#29ABF3" transform="translate(111,36)"/>
<path d="M0 0 C1.65 0 3.3 0 5 0 C5 1.65 5 3.3 5 5 C3.35 5 1.7 5 0 5 C0 3.35 0 1.7 0 0 Z " fill="#39A3E6" transform="translate(65,30)"/>
<path d="M0 0 C1.65 0 3.3 0 5 0 C4.67 1.65 4.34 3.3 4 5 C2.68 5 1.36 5 0 5 C0 3.35 0 1.7 0 0 Z " fill="#D4371A" transform="translate(116,82)"/>
<path d="M0 0 C1.32 1.32 2.64 2.64 4 4 C3.01 5.98 2.02 7.96 1 10 C0.67 10 0.34 10 0 10 C0 6.7 0 3.4 0 0 Z " fill="#3496DA" transform="translate(104,85)"/>
<path d="M0 0 C0 3 0 3 -1.53125 4.82421875 C-2.1809375 5.43910156 -2.830625 6.05398437 -3.5 6.6875 C-4.1496875 7.31011719 -4.799375 7.93273438 -5.46875 8.57421875 C-5.9740625 9.04472656 -6.479375 9.51523437 -7 10 C-7 7 -7 7 -4.625 4.4375 C-3.75875 3.633125 -2.8925 2.82875 -2 2 C-1.34 1.34 -0.68 0.68 0 0 Z " fill="#53C4FD" transform="translate(150,38)"/>
</svg>

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -1,15 +1,11 @@
import type {
IExecuteFunctions,
ICredentialsDecrypted,
ICredentialTestFunctions,
IDataObject,
ILoadOptionsFunctions,
INodeCredentialTestResult,
INodeExecutionData,
INodePropertyOptions,
INodeType,
INodeTypeDescription,
IRequestOptions,
} from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow';
@ -19,7 +15,6 @@ import {
getVersion,
handleListing,
throwOnEmptyUpdate,
tolerateTrailingSlash,
} from './GenericFunctions';
import {
@ -33,12 +28,7 @@ import {
connectorOperations,
} from './descriptions';
import type {
Connector,
ConnectorCreatePayload,
ConnectorType,
ElasticSecurityApiCredentials,
} from './types';
import type { Connector, ConnectorCreatePayload, ConnectorType } from './types';
export class ElasticSecurity implements INodeType {
description: INodeTypeDescription = {
@ -58,7 +48,6 @@ export class ElasticSecurity implements INodeType {
{
name: 'elasticSecurityApi',
required: true,
testedBy: 'elasticSecurityApiTest',
},
],
properties: [
@ -115,49 +104,6 @@ export class ElasticSecurity implements INodeType {
return connectors.map(({ name, id }) => ({ name, value: id }));
},
},
credentialTest: {
async elasticSecurityApiTest(
this: ICredentialTestFunctions,
credential: ICredentialsDecrypted,
): Promise<INodeCredentialTestResult> {
const {
username,
password,
baseUrl: rawBaseUrl,
} = credential.data as ElasticSecurityApiCredentials;
const baseUrl = tolerateTrailingSlash(rawBaseUrl);
const token = Buffer.from(`${username}:${password}`).toString('base64');
const endpoint = '/cases/status';
const options: IRequestOptions = {
headers: {
Authorization: `Basic ${token}`,
'kbn-xsrf': true,
},
method: 'GET',
body: {},
qs: {},
uri: `${baseUrl}/api${endpoint}`,
json: true,
};
try {
await this.helpers.request(options);
return {
status: 'OK',
message: 'Authentication successful',
};
} catch (error) {
return {
status: 'Error',
message: error.message,
};
}
},
},
};
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {

View file

@ -21,21 +21,13 @@ export async function elasticSecurityApiRequest(
body: IDataObject = {},
qs: IDataObject = {},
) {
const {
username,
password,
baseUrl: rawBaseUrl,
} = (await this.getCredentials('elasticSecurityApi')) as ElasticSecurityApiCredentials;
const { baseUrl: rawBaseUrl } = (await this.getCredentials(
'elasticSecurityApi',
)) as ElasticSecurityApiCredentials;
const baseUrl = tolerateTrailingSlash(rawBaseUrl);
const token = Buffer.from(`${username}:${password}`).toString('base64');
const options: IRequestOptions = {
headers: {
Authorization: `Basic ${token}`,
'kbn-xsrf': true,
},
method,
body,
qs,
@ -52,7 +44,7 @@ export async function elasticSecurityApiRequest(
}
try {
return await this.helpers.request(options);
return await this.helpers.requestWithAuthentication.call(this, 'elasticSecurityApi', options);
} catch (error) {
if (error?.error?.error === 'Not Acceptable' && error?.error?.message) {
error.error.error = `${error.error.error}: ${error.error.message}`;

View file

@ -1,6 +1,7 @@
export type ElasticSecurityApiCredentials = {
username: string;
password: string;
username?: string;
password?: string;
apiKey?: string;
baseUrl: string;
};

View file

@ -75,8 +75,10 @@
"dist/credentials/CrowdStrikeOAuth2Api.credentials.js",
"dist/credentials/CrowdDevApi.credentials.js",
"dist/credentials/CustomerIoApi.credentials.js",
"dist/credentials/DatadogApi.credentials.js",
"dist/credentials/DeepLApi.credentials.js",
"dist/credentials/DemioApi.credentials.js",
"dist/credentials/DfirIrisApi.credentials.js",
"dist/credentials/DhlApi.credentials.js",
"dist/credentials/DiscordBotApi.credentials.js",
"dist/credentials/DiscordOAuth2Api.credentials.js",
@ -88,6 +90,7 @@
"dist/credentials/DropboxApi.credentials.js",
"dist/credentials/DropboxOAuth2Api.credentials.js",
"dist/credentials/DropcontactApi.credentials.js",
"dist/credentials/DynatraceApi.credentials.js",
"dist/credentials/EgoiApi.credentials.js",
"dist/credentials/ElasticsearchApi.credentials.js",
"dist/credentials/ElasticSecurityApi.credentials.js",
@ -101,6 +104,7 @@
"dist/credentials/FacebookLeadAdsOAuth2Api.credentials.js",
"dist/credentials/FigmaApi.credentials.js",
"dist/credentials/FileMaker.credentials.js",
"dist/credentials/FilescanApi.credentials.js",
"dist/credentials/FlowApi.credentials.js",
"dist/credentials/FormIoApi.credentials.js",
"dist/credentials/FormstackApi.credentials.js",
@ -198,6 +202,7 @@
"dist/credentials/MailgunApi.credentials.js",
"dist/credentials/MailjetEmailApi.credentials.js",
"dist/credentials/MailjetSmsApi.credentials.js",
"dist/credentials/MalcoreApi.credentials.js",
"dist/credentials/MandrillApi.credentials.js",
"dist/credentials/MarketstackApi.credentials.js",
"dist/credentials/MatrixApi.credentials.js",