File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/catalog Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,22 @@ private static Configuration toFlussClientConfig(
243243 }
244244 });
245245
246+ // generate JAAS config if keytab and principal are present in flink table options
247+ String keytab = tableOptions .get (FlinkConnectorOptions .CLIENT_KERBEROS_KEYTAB .key ());
248+ String principal = tableOptions .get (FlinkConnectorOptions .CLIENT_KERBEROS_PRINCIPAL .key ());
249+
250+ if (keytab != null
251+ && principal != null
252+ && !flussConfig .containsKey (ConfigOptions .CLIENT_SASL_JAAS_CONFIG .key ())) {
253+ String jaasConfig =
254+ String .format (
255+ "com.sun.security.auth.module.Krb5LoginModule required "
256+ + "useKeyTab=true storeKey=true useTicketCache=false "
257+ + "keyTab=\" %s\" principal=\" %s\" ;" ,
258+ keytab , principal );
259+ flussConfig .setString (ConfigOptions .CLIENT_SASL_JAAS_CONFIG .key (), jaasConfig );
260+ }
261+
246262 // Todo support LookupOptions.MAX_RETRIES. Currently, Fluss doesn't support connector level
247263 // retry. The option 'client.lookup.max-retries' is only for dealing with the
248264 // RetriableException return by server not all exceptions. Trace by:
You can’t perform that action at this time.
0 commit comments