MQTT node: Add SSL/TLS support (#1828)

* MQTT node: Add SSL/TLS support

* Add import IDisplayOptions

* Remove  as NodePropertyTypes
This commit is contained in:
Frederic Alix
2021-09-03 14:37:19 +02:00
committed by GitHub
parent e928fb182b
commit 7b752ce492
3 changed files with 166 additions and 18 deletions

View File

@@ -1,5 +1,6 @@
import {
ICredentialType,
IDisplayOptions,
INodeProperties,
} from 'n8n-workflow';
@@ -69,5 +70,99 @@ export class Mqtt implements ICredentialType {
default: '',
description: 'Client ID. If left empty, one is autogenrated for you',
},
{
displayName: 'SSL',
name: 'ssl',
type: 'boolean',
default: false,
},
{
displayName: 'Passwordless',
name: 'passwordless',
type: 'boolean',
displayOptions: {
show: {
ssl: [
true,
],
},
},
default: true,
description: 'Passwordless connection with certificates (SASL mechanism EXTERNAL)',
},
{
displayName: 'CA Certificates',
name: 'ca',
type: 'string',
typeOptions: {
password: true,
},
displayOptions: {
show: {
ssl: [
true,
],
},
},
default: '',
description: 'SSL CA Certificates to use.',
},
{
displayName: 'Reject Unauthorized Certificate',
name: 'rejectUnauthorized',
type: 'boolean',
displayOptions: {
show: {
ssl: [
true,
],
passwordless: [
true,
],
},
} as IDisplayOptions,
default: '',
description: 'Validate Certificate.',
},
{
displayName: 'Client Certificate',
name: 'cert',
type: 'string',
typeOptions: {
password: true,
},
displayOptions: {
show: {
ssl: [
true,
],
passwordless: [
true,
],
},
} as IDisplayOptions,
default: '',
description: 'SSL Client Certificate to use.',
},
{
displayName: 'Client Key',
name: 'key',
type: 'string',
typeOptions: {
password: true,
},
displayOptions: {
show: {
ssl: [
true,
],
passwordless: [
true,
],
},
},
default: '',
description: 'SSL Client Key to use.',
},
];
}