More than an issue it is a question.
Say you have the following configuration for a connector :
{
"config": {
"name": "test-couchbase-source",
"connector.class": "com.couchbase.connect.kafka.CouchbaseSourceConnector",
"tasks.max": "1",
"couchbase.topic": "test-default",
"couchbase.seed.nodes": "couchbase",
"couchbase.bootstrap.timeout": "10s",
"couchbase.bucket": "travel-sample",
"couchbase.username": "couchbase",
"couchbase.password": "couchbase",
"key.converter": "org.apache.kafka.connect.storage.StringConverter",
"couchbase.source.handler": "com.couchbase.connect.kafka.handler.source.RawJsonSourceHandler",
"value.converter": "org.apache.kafka.connect.converters.ByteArrayConverter",
"couchbase.event.filter": "com.couchbase.connect.kafka.filter.AllPassFilter",
"couchbase.stream.from": "BEGINNING",
"couchbase.compression": "ENABLED",
"couchbase.flow.control.buffer": "16m",
"couchbase.persistence.polling.interval": "100ms"
}
}
How can I externalize the configuration for the following secrets?
"couchbase.username": "couchbase",
"couchbase.password": "couchbase",
I tried to use the same syntax as the other configuration options using a custom ConfigProvider
, but that did not seem to work as the values were resolved literally. For example :
config.providers=file
config.providers.file.class=org.apache.kafka.common.config.provider.FileConfigProvider
And
"couchbase.username:${file:/opt/connect-secrets.properties:couchbase.username}
Was resolved literally to the value :${file:/opt/connect-secrets.properties:couchbase.username}
Can ConfigProvider
be used to resolve the connectors configuration? Or, what can be used?