Skip to content

Run CI for #8049 - #8055

Draft
dotansimha wants to merge 2 commits into
mainfrom
8049-run-locally
Draft

Run CI for #8049#8055
dotansimha wants to merge 2 commits into
mainfrom
8049-run-locally

Conversation

@dotansimha

Copy link
Copy Markdown
Member

Pushed locally in order to run CI for #8049

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This PR implements AWS IAM authentication for MSK and adds support for multiple Kafka broker addresses via comma-separated strings in the usage and usage-ingestor services. Feedback identifies a redundant type cast in the token provider utility, a typo in the changeset file, and recommends trimming whitespace when splitting broker addresses to ensure robust environment variable parsing.

Comment on lines +13 to +16
return (async () => {
const token = await generateAuthToken({ region });
return { value: token.token };
}) as () => Promise<{ value: string }>;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The type cast as () => Promise<{ value: string }> is redundant because the async arrow function's return type is already correctly inferred by TypeScript.

Suggested change
return (async () => {
const token = await generateAuthToken({ region });
return { value: token.token };
}) as () => Promise<{ value: string }>;
return async () => {
const token = await generateAuthToken({ region });
return { value: token.token };
};


Added opt-in AWS IAM authentication on MSK for self-hosters deployed on AWS. When enabled, the
`usage` and `usage-ingestor` services authenticate to Kafka using AWS IAM (SigV4) via the
OAUTHBEARER SASL mechanism ??? no static username/password required.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is a placeholder or typo (???) in the description. Please remove it and ensure the sentence is complete.

Suggested change
OAUTHBEARER SASL mechanism ??? no static username/password required.
OAUTHBEARER SASL mechanism; no static username/password required.

const kafka = new Kafka({
clientId: 'usage-ingestor',
brokers: [config.kafka.connection.broker],
brokers: config.kafka.connection.broker.split(','),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It is safer to trim the broker addresses after splitting the string, as environment variables can sometimes contain accidental leading or trailing whitespace.

Suggested change
brokers: config.kafka.connection.broker.split(','),
brokers: config.kafka.connection.broker.split(',').map(broker => broker.trim()),

const kafka = new Kafka({
clientId: 'usage',
brokers: [config.kafka.connection.broker],
brokers: config.kafka.connection.broker.split(','),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It is safer to trim the broker addresses after splitting the string, as environment variables can sometimes contain accidental leading or trailing whitespace.

Suggested change
brokers: config.kafka.connection.broker.split(','),
brokers: config.kafka.connection.broker.split(',').map(broker => broker.trim()),

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants