lensesio/secret-provider

aws.access.key and aws.secret.key are required although aws.auth.mode=default

Closed this issue · 2 comments

I tried to set it using default authentication because both connect and AWS Secret Manager are in the same AWS account.

config was as follows:
aws.access.key = null
aws.auth.method = default
aws.region = eu-central-1
aws.secret.key = null

but i would get the following exception:

ERROR Stopping due to error (org.apache.kafka.connect.cli.ConnectDistributed:86)
 org.apache.kafka.connect.errors.ConnectException: aws.access.key not set
	at io.lenses.connect.secrets.config.AbstractConfigExtensions$AbstractConfigExtension$.raiseException$extension(AbstractConfigProvider.scala:26)
 	at io.lenses.connect.secrets.config.AbstractConfigExtensions$AbstractConfigExtension$.$anonfun$getStringOrThrowOnNull$extension$1(AbstractConfigProvider.scala:17)
	at scala.Option.getOrElse(Option.scala:189)

the call getStringOrThrowOnNull in https://github.com/lensesio/secret-provider/blob/master/src/main/scala/io/lenses/connect/secrets/config/AWSProviderSettings.scala#L26-L29 is too strict, as they are checked for being empty afterwards anyway.

+1 for this.
All of your tests seem to be assuming that the keys and secrets should be present in default mode. This is not the case as in the default toolchain there are a number of different ways to connect to AWS, only one of which needs those params to be present.

This is released in 2.3.0