Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript: SASLOptions interface does not have support for AWS specific fields #935

Closed
r115 opened this issue Oct 31, 2020 · 0 comments · Fixed by #966
Closed

Typescript: SASLOptions interface does not have support for AWS specific fields #935

r115 opened this issue Oct 31, 2020 · 0 comments · Fixed by #966

Comments

@r115
Copy link

r115 commented Oct 31, 2020

Describe the bug
When working with typescript, initializing the Kafka client for aws sasl mechanism throws a typing error.

To Reproduce

import { Kafka } from 'kafkajs';

const client = new Kafka({
   brokers: ['localhost:9092'],
   clientId: 'SampleClientId',
   ssl: true,
   sasl: {
     mechanism: 'aws',
     authorizationIdentity: 'awsidentity',
     accessKeyId: 'access_key',
     secretAccessKey: 'secret_key',
   }
})

REPL : https://repl.it/@r115/BrokenOptimalGoals

Expected behavior
Adding aws auth specific fields e.g accessKeyId should not throw a typing error.

Observed behavior
Adding aws mechanism auth fields e.g. accessKeyId throws an error.

 Type '{ mechanism: "aws"; authorizationIdentity: string; accessKeyId: string; secretAccessKey: string; }' is not assignable to type 'SASLOptions'.
  Object literal may only specify known properties, and 'authorizationIdentity' does not exist in type 'SASLOptions'.

Environment:

  • OS: Mac OS 10.15.7
  • KafkaJS version: 1.14.0
  • Kafka version : 2.3.1
  • NodeJS version: 12.16.3

Additional context
N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants