mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 21:37:32 -08:00
✨ add RabbitMQ AMPQS support (#1598)
* WIP fixes #1596 (RabbitMQ AMPQS support) * ⚡ fix display options Co-authored-by: ahsan-virani <ahsan.virani@gmail.com>
This commit is contained in:
parent
d59e6d1c4b
commit
ca4c3fa980
|
@ -1,5 +1,6 @@
|
||||||
import {
|
import {
|
||||||
ICredentialType,
|
ICredentialType,
|
||||||
|
IDisplayOptions,
|
||||||
NodePropertyTypes,
|
NodePropertyTypes,
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
|
|
||||||
|
@ -51,8 +52,22 @@ export class RabbitMQ implements ICredentialType {
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Client Certificate',
|
displayName: 'Passwordless',
|
||||||
name: 'cert',
|
name: 'passwordless',
|
||||||
|
type: 'boolean' as NodePropertyTypes,
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
ssl: [
|
||||||
|
true,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
default: false,
|
||||||
|
description: 'Passwordless connection with certificates (SASL mechanism EXTERNAL)',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: 'CA Certificates',
|
||||||
|
name: 'ca',
|
||||||
type: 'string' as NodePropertyTypes,
|
type: 'string' as NodePropertyTypes,
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
password: true,
|
password: true,
|
||||||
|
@ -65,6 +80,26 @@ export class RabbitMQ implements ICredentialType {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
description: 'SSL CA Certificates to use.',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Client Certificate',
|
||||||
|
name: 'cert',
|
||||||
|
type: 'string' as NodePropertyTypes,
|
||||||
|
typeOptions: {
|
||||||
|
password: true,
|
||||||
|
},
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
ssl: [
|
||||||
|
true,
|
||||||
|
],
|
||||||
|
passwordless: [
|
||||||
|
true,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
} as IDisplayOptions,
|
||||||
|
default: '',
|
||||||
description: 'SSL Client Certificate to use.',
|
description: 'SSL Client Certificate to use.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -79,6 +114,9 @@ export class RabbitMQ implements ICredentialType {
|
||||||
ssl: [
|
ssl: [
|
||||||
true,
|
true,
|
||||||
],
|
],
|
||||||
|
passwordless: [
|
||||||
|
true,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
@ -96,31 +134,13 @@ export class RabbitMQ implements ICredentialType {
|
||||||
ssl: [
|
ssl: [
|
||||||
true,
|
true,
|
||||||
],
|
],
|
||||||
},
|
passwordless: [
|
||||||
},
|
|
||||||
default: '',
|
|
||||||
description: 'SSL passphrase to use.',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
displayName: 'CA Certificates',
|
|
||||||
name: 'ca',
|
|
||||||
type: 'string' as NodePropertyTypes,
|
|
||||||
typeOptions: {
|
|
||||||
password: true,
|
|
||||||
},
|
|
||||||
// typeOptions: {
|
|
||||||
// multipleValues: true,
|
|
||||||
// multipleValueButtonText: 'Add Certificate',
|
|
||||||
// },
|
|
||||||
displayOptions: {
|
|
||||||
show: {
|
|
||||||
ssl: [
|
|
||||||
true,
|
true,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
description: 'SSL CA Certificates to use.',
|
description: 'SSL passphrase to use.',
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// displayName: 'Client ID',
|
// displayName: 'Client ID',
|
||||||
|
|
|
@ -26,11 +26,13 @@ export async function rabbitmqConnect(this: IExecuteFunctions | ITriggerFunction
|
||||||
if (credentials.ssl === true) {
|
if (credentials.ssl === true) {
|
||||||
credentialData.protocol = 'amqps';
|
credentialData.protocol = 'amqps';
|
||||||
|
|
||||||
optsData.cert = credentials.cert === '' ? undefined : Buffer.from(credentials.cert as string);
|
|
||||||
optsData.key = credentials.key === '' ? undefined : Buffer.from(credentials.key as string);
|
|
||||||
optsData.passphrase = credentials.passphrase === '' ? undefined : credentials.passphrase;
|
|
||||||
optsData.ca = credentials.ca === '' ? undefined : [Buffer.from(credentials.ca as string)];
|
optsData.ca = credentials.ca === '' ? undefined : [Buffer.from(credentials.ca as string)];
|
||||||
optsData.credentials = amqplib.credentials.external();
|
if (credentials.passwordless === true) {
|
||||||
|
optsData.cert = credentials.cert === '' ? undefined : Buffer.from(credentials.cert as string);
|
||||||
|
optsData.key = credentials.key === '' ? undefined : Buffer.from(credentials.key as string);
|
||||||
|
optsData.passphrase = credentials.passphrase === '' ? undefined : credentials.passphrase;
|
||||||
|
optsData.credentials = amqplib.credentials.external();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue