mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
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:
67
packages/nodes-base/credentials/DfirIrisApi.credentials.ts
Normal file
67
packages/nodes-base/credentials/DfirIrisApi.credentials.ts
Normal 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}}',
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user