Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
@jm18457/kafkajs-msk-iam-authentication-mechanism
Advanced tools
Authentication mechanism for AWS MSK IAM for KafkaJS.
Requires kafkajs
version 2.2.0
or higher.
For more information look at https://kafka.js.org/docs/next/configuration#custom-authentication-mechanisms.
npm i @jm18457/kafkajs-msk-iam-authentication-mechanism
const { Kafka } = require('kafkajs')
const {
createMechanism
} = require('@jm18457/kafkajs-msk-iam-authentication-mechanism')
const kafka = new Kafka({
brokers: ['kafka1:9092', 'kafka2:9092'],
clientId: 'my-app',
ssl: true,
sasl: createMechanism({ region: 'eu-central-1' })
})
You can also use the old way of importing the library.
const { Kafka } = require('kafkajs')
const {
Type,
awsIamAuthenticator,
} = require('@jm18457/kafkajs-msk-iam-authentication-mechanism')
const provider = awsIamAuthenticator({
region: 'eu-central-1'
})
const kafka = new Kafka({
brokers: ['kafka1:9092', 'kafka2:9092'],
clientId: 'my-app',
ssl: true,
sasl: {
mechanism: Type,
authenticationProvider: provider
}
})
For working examples look at the examples
folder.
Ƭ Options: Object
Name | Type | Description |
---|---|---|
credentials? | AwsCredentialIdentity | Provider <AwsCredentialIdentity > | Default fromNodeProviderChain() |
region | string | The AWS region in which the Kafka broker exists. |
ttl? | string | Provides the time period, in seconds, for which the generated presigned URL is valid. Default 900 |
userAgent? | string | Is a string passed in by the client library to describe the client. Default MSK_IAM |
• Const
TYPE: "AWS_MSK_IAM"
• Const
Type: "AWS_MSK_IAM"
▸ awsIamAuthenticator(options
): (args
: AuthenticationProviderArgs
) => Authenticator
Name | Type |
---|---|
options | Options |
fn
▸ (args
): Authenticator
Name | Type |
---|---|
args | AuthenticationProviderArgs |
Authenticator
▸ createAuthenticator(options
): (args
: AuthenticationProviderArgs
) => Authenticator
Name | Type |
---|---|
options | Options |
fn
▸ (args
): Authenticator
Name | Type |
---|---|
args | AuthenticationProviderArgs |
Authenticator
▸ createMechanism(options
, mechanism?
): Mechanism
Name | Type | Default value |
---|---|---|
options | Options | undefined |
mechanism | string | TYPE |
Mechanism
FAQs
Authentication mechanism for AWS MSK IAM for KafkaJS.
The npm package @jm18457/kafkajs-msk-iam-authentication-mechanism receives a total of 20,527 weekly downloads. As such, @jm18457/kafkajs-msk-iam-authentication-mechanism popularity was classified as popular.
We found that @jm18457/kafkajs-msk-iam-authentication-mechanism demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.