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

Incorrect Typescript interface for SASLAuthenticate handler (custom mechanisms) #1458

Closed
Drew-Kimberly opened this issue Oct 11, 2022 · 1 comment · Fixed by #1459
Closed

Comments

@Drew-Kimberly
Copy link

Describe the bug
The Typescript interface is defined as:

  saslAuthenticate: <ParseResult>(
    request: SaslAuthenticationRequest,
    response?: SaslAuthenticationResponse<ParseResult>
  ) => Promise<ParseResult | void>

While the implementation expects a single arg that is a wrapper object with request and response properties: https://github.com/tulios/kafkajs/blob/master/src/broker/saslAuthenticator/index.js#L42

Expected behavior
The TS interface should match the implementation

Observed behavior
Implementing a custom SASL mechanism to the TS interface will result in an error at runtime due to the unexpected shape of the arg.

@Drew-Kimberly
Copy link
Author

Much appreciated for the fast turnaround 🙏

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

Successfully merging a pull request may close this issue.

1 participant