Skip to content

Commit b768df6

Browse files
Muchembigermanosin
andauthored
BE: Auth: Support GCP IAM Auth (#1013)
Co-authored-by: German Osin <german.osin@gmail.com>
1 parent ba70933 commit b768df6

File tree

6 files changed

+25
-0
lines changed

6 files changed

+25
-0
lines changed

api/build.gradle

+9
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ dependencies {
6262
implementation libs.netty.common
6363
implementation libs.netty.handler
6464

65+
66+
// Google Managed Service for Kafka IAM support
67+
implementation (libs.google.managed.kafka.login.handler) {
68+
exclude group: 'com.google.oauth-client', module: 'google-oauth-client'
69+
}
70+
implementation (libs.google.oauth.client) {
71+
because("CVE Fix: It is excluded above because of a vulnerability")
72+
}
73+
6574
// Annotation processors
6675
implementation libs.lombok
6776
implementation libs.mapstruct

frontend/src/lib/constants.ts

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ export const AUTH_OPTIONS = [
9494
{ value: 'SASL/LDAP', label: 'SASL/LDAP' },
9595
{ value: 'SASL/AWS IAM', label: 'SASL/AWS IAM' },
9696
{ value: 'SASL/Azure Entra', label: 'SASL/Azure Entra' },
97+
{ value: 'SASL/GCP IAM', label: 'SASL/GCP IAM' },
9798
{ value: 'mTLS', label: 'mTLS' },
9899
];
99100

frontend/src/widgets/ClusterConfigForm/schema.ts

+1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ const authPropsSchema = lazy((_, { parent }) => {
144144
awsProfileName: string(),
145145
});
146146
case 'SASL/Azure Entra':
147+
case 'SASL/GCP IAM':
147148
case 'mTLS':
148149
default:
149150
return mixed().optional();

frontend/src/widgets/ClusterConfigForm/utils/getJaasConfig.ts

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const JAAS_CONFIGS = {
1111
'SASL/AWS IAM': 'software.amazon.msk.auth.iam.IAMLoginModule',
1212
'SASL/Azure Entra':
1313
'org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule',
14+
'SASL/GCP IAM': 'com.google.cloud.hosted.kafka.auth.GcpLoginCallbackHandler',
1415
};
1516

1617
type MethodName = keyof typeof JAAS_CONFIGS;

frontend/src/widgets/ClusterConfigForm/utils/transformFormDataToPayload.ts

+9
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,15 @@ export const transformFormDataToPayload = (data: ClusterConfigFormValues) => {
272272
'sasl.jaas.config': getJaasConfig('SASL/Azure Entra', {}),
273273
};
274274
break;
275+
case 'SASL/GCP IAM':
276+
config.properties = {
277+
'security.protocol': securityProtocol,
278+
'sasl.mechanism': 'OAUTHBEARER',
279+
'sasl.client.callback.handler.class':
280+
'com.google.cloud.hosted.kafka.auth.GcpLoginCallbackHandler',
281+
'sasl.jaas.config': getJaasConfig('SASL/GCP IAM', {}),
282+
};
283+
break;
275284
case 'mTLS':
276285
config.properties = {
277286
'security.protocol': 'SSL',

gradle/libs.versions.toml

+4
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,7 @@ netty-handler = { module = 'io.netty:netty-handler', version.ref = 'netty' }
133133

134134
# test scope
135135
bouncycastle-bcpkix = { module = 'org.bouncycastle:bcpkix-jdk18on', version = '1.80' }
136+
137+
# Google Managed Service for Apache Kafka support
138+
google-managed-kafka-login-handler = {module = 'com.google.cloud.hosted.kafka:managed-kafka-auth-login-handler', version = '1.0.5'}
139+
google-oauth-client = { module = 'com.google.oauth-client:google-oauth-client', version = '1.39.0' }

0 commit comments

Comments
 (0)