Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
sankalpbhatia authored Oct 17, 2022
2 parents 7d57406 + 4abd8e4 commit ca37eb5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).


## [2.2.1] - 2022-10-13

### Fixed
- Fixed Typescript definitions for custom authentication mechanisms #1459

## [2.2.0] - 2022-08-16

### Added
Expand Down
8 changes: 6 additions & 2 deletions docs/CustomAuthenticationMechanism.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ configure your brokers.
A custom authentication mechanism needs to fulfill the following interface:

```ts
type SaslAuthenticateArgs<ParseResult> = {
request: SaslAuthenticationRequest
response?: SaslAuthenticationResponse<ParseResult>
}

type AuthenticationProviderArgs = {
host: string
port: number
logger: Logger
saslAuthenticate: <ParseResult>(
request: SaslAuthenticationRequest,
response?: SaslAuthenticationResponse<ParseResult>
args: SaslAuthenticateArgs<ParseResult>
) => Promise<ParseResult | void>
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kafkajs",
"version": "2.2.0",
"version": "2.2.1",
"description": "A modern Apache Kafka client for node.js",
"author": "Tulio Ornelas <[email protected]>",
"main": "index.js",
Expand Down
15 changes: 11 additions & 4 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ export type Authenticator = {
authenticate: () => Promise<void>
}

export type SaslAuthenticateArgs<ParseResult> = {
request: SaslAuthenticationRequest
response?: SaslAuthenticationResponse<ParseResult>
}

export type AuthenticationProviderArgs = {
host: string
port: number
logger: Logger
saslAuthenticate: <ParseResult>(
request: SaslAuthenticationRequest,
response?: SaslAuthenticationResponse<ParseResult>
args: SaslAuthenticateArgs<ParseResult>
) => Promise<ParseResult | void>
}

Expand Down Expand Up @@ -259,7 +263,7 @@ export interface ReplicaAssignment {
}

export interface PartitionReassignment {
topic: string,
topic: string
partitionAssignment: Array<ReplicaAssignment>
}

Expand Down Expand Up @@ -694,7 +698,10 @@ export type Broker = {
topics: PartitionReassignment[]
timeout?: number
}): Promise<any>
listPartitionReassignments(request: { topics?: TopicPartitions[]; timeout?: number }): Promise<ListPartitionReassignmentsResponse>
listPartitionReassignments(request: {
topics?: TopicPartitions[]
timeout?: number
}): Promise<ListPartitionReassignmentsResponse>
}

interface MessageSetEntry {
Expand Down

0 comments on commit ca37eb5

Please sign in to comment.