2020-10-29 07:42:54 -07:00
|
|
|
import {
|
|
|
|
ICredentialType,
|
2021-06-12 09:39:55 -07:00
|
|
|
INodeProperties,
|
2020-10-29 07:42:54 -07:00
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
|
|
|
export class Kafka implements ICredentialType {
|
|
|
|
name = 'kafka';
|
|
|
|
displayName = 'Kafka';
|
|
|
|
documentationUrl = 'kafka';
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2020-10-29 07:42:54 -07:00
|
|
|
{
|
|
|
|
displayName: 'Client ID',
|
|
|
|
name: 'clientId',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2020-10-29 07:42:54 -07:00
|
|
|
default: '',
|
2020-10-29 07:44:11 -07:00
|
|
|
placeholder: 'my-app',
|
2020-10-29 07:42:54 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Brokers',
|
|
|
|
name: 'brokers',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2020-10-29 07:42:54 -07:00
|
|
|
default: '',
|
2020-10-29 07:44:11 -07:00
|
|
|
placeholder: 'kafka1:9092,kafka2:9092',
|
2020-10-29 07:42:54 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'SSL',
|
|
|
|
name: 'ssl',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'boolean',
|
2020-10-29 07:42:54 -07:00
|
|
|
default: true,
|
|
|
|
},
|
2021-03-11 05:25:02 -08:00
|
|
|
{
|
|
|
|
displayName: 'Authentication',
|
|
|
|
name: 'authentication',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'boolean',
|
2021-03-11 05:25:02 -08:00
|
|
|
default: false,
|
|
|
|
},
|
2020-10-29 07:44:11 -07:00
|
|
|
{
|
|
|
|
displayName: 'Username',
|
|
|
|
name: 'username',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2021-03-11 05:25:02 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
authentication: [
|
|
|
|
true,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2020-10-29 07:44:11 -07:00
|
|
|
default: '',
|
|
|
|
description: 'Optional username if authenticated is required.',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Password',
|
|
|
|
name: 'password',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2021-03-11 05:25:02 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
authentication: [
|
|
|
|
true,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2020-10-29 07:44:11 -07:00
|
|
|
typeOptions: {
|
|
|
|
password: true,
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
description: 'Optional password if authenticated is required.',
|
|
|
|
},
|
2021-03-11 05:25:02 -08:00
|
|
|
{
|
|
|
|
displayName: 'SASL mechanism',
|
|
|
|
name: 'saslMechanism',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'options',
|
2021-03-11 05:25:02 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
authentication: [
|
|
|
|
true,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'plain',
|
|
|
|
value: 'plain',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'scram-sha-256',
|
|
|
|
value: 'scram-sha-256',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'scram-sha-512',
|
|
|
|
value: 'scram-sha-512',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'plain',
|
|
|
|
description: 'The SASL mechanism.',
|
|
|
|
},
|
2020-10-29 07:42:54 -07:00
|
|
|
];
|
|
|
|
}
|