Skip to content

BE: Auth: Support GCP IAM Auth #1013

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ dependencies {
implementation libs.netty.common
implementation libs.netty.handler


// Google Managed Service for Kafka IAM support
implementation (libs.google.managed.kafka.login.handler) {
exclude group: 'com.google.oauth-client', module: 'google-oauth-client'
}
implementation (libs.google.oauth.client) {
because("CVE Fix: It is excluded above because of a vulnerability")
}

// Annotation processors
implementation libs.lombok
implementation libs.mapstruct
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const AUTH_OPTIONS = [
{ value: 'SASL/LDAP', label: 'SASL/LDAP' },
{ value: 'SASL/AWS IAM', label: 'SASL/AWS IAM' },
{ value: 'SASL/Azure Entra', label: 'SASL/Azure Entra' },
{ value: 'SASL/GCP IAM', label: 'SASL/GCP IAM' },
{ value: 'mTLS', label: 'mTLS' },
];

Expand Down
1 change: 1 addition & 0 deletions frontend/src/widgets/ClusterConfigForm/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ const authPropsSchema = lazy((_, { parent }) => {
awsProfileName: string(),
});
case 'SASL/Azure Entra':
case 'SASL/GCP IAM':
case 'mTLS':
default:
return mixed().optional();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const JAAS_CONFIGS = {
'SASL/AWS IAM': 'software.amazon.msk.auth.iam.IAMLoginModule',
'SASL/Azure Entra':
'org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule',
'SASL/GCP IAM': 'com.google.cloud.hosted.kafka.auth.GcpLoginCallbackHandler',
};

type MethodName = keyof typeof JAAS_CONFIGS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,15 @@ export const transformFormDataToPayload = (data: ClusterConfigFormValues) => {
'sasl.jaas.config': getJaasConfig('SASL/Azure Entra', {}),
};
break;
case 'SASL/GCP IAM':
config.properties = {
'security.protocol': securityProtocol,
'sasl.mechanism': 'OAUTHBEARER',
'sasl.client.callback.handler.class':
'com.google.cloud.hosted.kafka.auth.GcpLoginCallbackHandler',
'sasl.jaas.config': getJaasConfig('SASL/GCP IAM', {}),
};
break;
case 'mTLS':
config.properties = {
'security.protocol': 'SSL',
Expand Down
4 changes: 4 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,7 @@ netty-handler = { module = 'io.netty:netty-handler', version.ref = 'netty' }

# test scope
bouncycastle-bcpkix = { module = 'org.bouncycastle:bcpkix-jdk18on', version = '1.80' }

# Google Managed Service for Apache Kafka support
google-managed-kafka-login-handler = {module = 'com.google.cloud.hosted.kafka:managed-kafka-auth-login-handler', version = '1.0.5'}
google-oauth-client = { module = 'com.google.oauth-client:google-oauth-client', version = '1.39.0' }
Loading