From a519e720f87f478c7246f51d16017ae5def6114a Mon Sep 17 00:00:00 2001 From: Andrii Landiak Date: Thu, 4 Jun 2026 15:06:36 +0300 Subject: [PATCH] Renaming to endpointUrl for OauthBearerProviderOptions --- msa/js-executor/queue/kafkaTemplate.ts | 2 +- msa/js-executor/queue/oAuthBearerProvider.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/msa/js-executor/queue/kafkaTemplate.ts b/msa/js-executor/queue/kafkaTemplate.ts index 855b393e7b..95c95c6e39 100644 --- a/msa/js-executor/queue/kafkaTemplate.ts +++ b/msa/js-executor/queue/kafkaTemplate.ts @@ -134,7 +134,7 @@ export class KafkaTemplate implements IQueue { oauthBearerProvider: oauthBearerProvider({ clientId: optionalOauthStr('kafka.confluent.oauth.client_id'), clientSecret: optionalOauthStr('kafka.confluent.oauth.client_secret'), - host: optionalOauthStr('kafka.confluent.oauth.endpoint_url'), + endpointUrl: optionalOauthStr('kafka.confluent.oauth.endpoint_url'), refreshThresholdMs, scope, }) diff --git a/msa/js-executor/queue/oAuthBearerProvider.ts b/msa/js-executor/queue/oAuthBearerProvider.ts index 899b6bd2e7..83ae5125b6 100644 --- a/msa/js-executor/queue/oAuthBearerProvider.ts +++ b/msa/js-executor/queue/oAuthBearerProvider.ts @@ -20,7 +20,7 @@ import { _logger } from '../config/logger'; interface OauthBearerProviderOptions { clientId: string; clientSecret: string; - host: string; + endpointUrl: string; refreshThresholdMs: number; // Optional OAuth2 scope. Required by some IdPs for client-credentials (e.g. Azure AD's "api:///.default"). scope?: string; @@ -35,11 +35,11 @@ const EXPIRY_SAFETY_MS = 5000; export const oauthBearerProvider = (options: OauthBearerProviderOptions) => { const logger = _logger('oauthBearerProvider'); - if (!options.clientId || !options.clientSecret || !options.host) { + if (!options.clientId || !options.clientSecret || !options.endpointUrl) { throw new Error('Kafka OAUTHBEARER requires kafka.confluent.oauth.client_id, client_secret and endpoint_url to be set'); } - if (!/^https:\/\//i.test(options.host)) { - logger.warn('Kafka OAuth token endpoint URL is not HTTPS (%s); client credentials will be sent unencrypted', options.host); + if (!/^https:\/\//i.test(options.endpointUrl)) { + logger.warn('Kafka OAuth token endpoint URL is not HTTPS (%s); client credentials will be sent unencrypted', options.endpointUrl); } const refreshThresholdMs = Number(options.refreshThresholdMs); if (!Number.isFinite(refreshThresholdMs) || refreshThresholdMs < 0) { @@ -48,9 +48,9 @@ export const oauthBearerProvider = (options: OauthBearerProviderOptions) => { const scope = options.scope && options.scope.trim().length > 0 ? options.scope.trim() : undefined; let tokenUrl: URL; try { - tokenUrl = new URL(options.host); + tokenUrl = new URL(options.endpointUrl); } catch { - throw new Error(`Kafka OAuth endpoint_url is not a valid URL: ${options.host}`); + throw new Error(`Kafka OAuth endpoint_url is not a valid URL: ${options.endpointUrl}`); } const client = new ClientCredentials({ client: {