Skip to content
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

Owerride configuration properties from smallrye.config.locations #40767

Open
koskom-alt opened this issue May 22, 2024 · 3 comments
Open

Owerride configuration properties from smallrye.config.locations #40767

koskom-alt opened this issue May 22, 2024 · 3 comments
Labels
area/config area/smallrye kind/bug Something isn't working triage/upstream Used for issues which are caused by issues in upstream projects/dependency

Comments

@koskom-alt
Copy link

koskom-alt commented May 22, 2024

Describe the bug

When connecting additional configuration, not all properties are overridden.
For example, when using camel-quarkus-jasypt, there is no way to override the quarkus.camel.jasypt.password parameter by specifying it in the configuration file connected through smallrye.config.locations.
At the same time, other parameters that are used in runtime are redefined as expected.

Expected behavior

Parameters specified in src/main/resources/etc/add.properties and connected through smallrye.config.locations must take precedence over src/main/resources/application.properties.

Actual behavior

quarkus.camel.jasypt.password parameter is not overwritten. As a result, when starting the service, an error occurs: Suppressed: org.jasypt.exceptions.EncryptionOperationNotPossibleException

How to Reproduce?

https://github.com/koskom-alt/config_location_test.git

execute mvn quarkus:dev -Dsmallrye.config.locations=file:{your_path}/add.properties

Output of uname -a or ver

Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:25 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6030 arm64

Output of java -version

java version "17.0.11" 2024-04-16 LTS Java(TM) SE Runtime Environment Oracle GraalVM 17.0.11+7.1 (build 17.0.11+7-LTS-jvmci-23.0-b34) Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 17.0.11+7.1 (build 17.0.11+7-LTS-jvmci-23.0-b34, mixed mode, sharing)

Quarkus version or git rev

3.10.0

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)

Additional information

In native mode the problem persists.

@koskom-alt koskom-alt added the kind/bug Something isn't working label May 22, 2024
@quarkus-bot
Copy link

quarkus-bot bot commented May 22, 2024

/cc @Ladicek (smallrye), @jmartisk (smallrye), @phillip-kruger (smallrye), @radcortez (config,smallrye)

@radcortez
Copy link
Member

The issue here is that the secret handlers configuration is read from the main sources and not configurable config sources (like the ones coming from quarkus.config.location). For instance, consider that quarkus.config.location could be set with a jasypt encoded value. In that case, setting the secret handler configuration would be impossible.

We do have a lazy type for secret handlers that allows only to initialize a handler when it is needed, and while it does not support the previously described problem, it is more flexible.

I did try to add a fix to the camel code, but the jasypt encryptor has to be initialized before the application starts so it can be used with the dev-ui, meaning that the lazy loading behaviour doesn't fully work in this case. I'll have to think in something else.

//cc @jamesnetherton

@radcortez
Copy link
Member

The fix from Camel Quarkus side:
apache/camel-quarkus#6191

@radcortez radcortez added the triage/upstream Used for issues which are caused by issues in upstream projects/dependency label Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config area/smallrye kind/bug Something isn't working triage/upstream Used for issues which are caused by issues in upstream projects/dependency
Projects
None yet
Development

No branches or pull requests

2 participants