mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(ERPNext Node): Add credential test and add support for unauthorized certs (#3732)
* ✨ Add cred injection, cred testing, allow unauthorized certs * Add support for skipping SSL for cred testing * 📘 Add partial override for request options types (#3739) * Change field names and fix error handling * Fix typo Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import {
|
||||
IAuthenticateGeneric,
|
||||
ICredentialTestRequest,
|
||||
ICredentialType,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
@@ -66,5 +68,27 @@ export class ERPNextApi implements ICredentialType {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Ignore SSL Issues',
|
||||
name: 'allowUnauthorizedCerts',
|
||||
type: 'boolean',
|
||||
description: 'Whether to connect even if SSL certificate validation is not possible',
|
||||
default: false,
|
||||
},
|
||||
];
|
||||
authenticate: IAuthenticateGeneric = {
|
||||
type: 'generic',
|
||||
properties: {
|
||||
headers: {
|
||||
Authorization: '=token {{$credentials.apiKey}}:{{$credentials.apiSecret}}',
|
||||
},
|
||||
},
|
||||
};
|
||||
test: ICredentialTestRequest = {
|
||||
request: {
|
||||
baseURL: '={{$credentials.environment === "cloudHosted" ? "https://" + $credentials.subdomain + ".erpnext.com" : $credentials.domain}}',
|
||||
url: '/api/resource/Doctype',
|
||||
skipSslCertificateValidation: '={{ $credentials.allowUnauthorizedCerts }}',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user