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

Fix saslAuthenticate parameter type definitions #1459

Merged
merged 1 commit into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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