Comments (9)
This is caused by the VaultConfigSource
not implementing getPropertyNames
: https://github.com/quarkiverse/quarkus-vault/blob/81d276215926b3d106cd1d9af4476421103c704e/runtime/src/main/java/io/quarkus/vault/runtime/config/VaultConfigSource.java#L58-L61. Why is this important for Maps
?
Consider:
@ConfigMapping(prefix = "acme")
interface MyConfig {
String value();
Map<String, String> map();
}
When populating the value()
, the config name is well know: we take the prefix and convert the method name to generate acme.value
and then we query the Config system for that name directly.
To populate a Map
, things are a bit different, because Map
keys are not known, due to the dynamic part of the key name, so the Config system has to query for all known properties under acme.map.*
. This is where getPropertiesNames
comes in. Because the Vault source does not return to use any known names, there is no way for us to known what to query for.
Ideally, all sources should implement getPropertyNames
, but this may not be possible depending on the nature of the source itself. I'm not even sure if Vault provides an API to query for all names, and even if it does, you may now want to expose that for security reasons.
In such cases, you can provide the empty names in source with a lower ordinal (like application.properties
), so the Config system is aware of them, and when they are queried directly, you will get the Vault value for each name. The downside is that you need to know beforehand the Map
key names.
from quarkus.
/cc @geoand (kubernetes), @iocanel (kubernetes), @vsevel (vault)
from quarkus.
/cc @radcortez
from quarkus.
Hi @wiebeck @vsevel, is it a duplicate of quarkiverse/quarkus-vault#231 ?
from quarkus.
Hi @wiebeck @vsevel, is it a duplicate of quarkiverse/quarkus-vault#231 ?
No, this is something different.
from quarkus.
Hi @wiebeck @vsevel, is it a duplicate of quarkiverse/quarkus-vault#231 ?
This issue is due to the more thorough validation of properties containing dashes ("-") usually passed as environment variables since Quarkus 3.7. Workaround is to use quarkus.config.mapping.validate-unknown=false
.
from quarkus.
@radcortez Thanks for the explanation. This actually makes sense (btw. debugging smallrye-config is HELL!). I cannot provide the property names in application.properties
as I don't know their names in advance but in my case it's possible to provide them as environment variable (they're not really secrets actually) which is working as expected.
from quarkus.
it's possible to provide them as environment variable (they're not really secrets actually) which is working as expected.
Yes, Env vars or system properties work, too.
(btw. debugging smallrye-config is HELL!)
Sorry about that. There was a lot of generated code before (there still is), but I did a major rewrite of the mappings implementation and everything should be abstracted now and easier to debug. The generated code is mainly calling the ObjectCreator
API. Please check:
And you can even simulate the generated code:
from quarkus.
BTW, here is where Maps
are created:
from quarkus.
Related Issues (20)
- Hibernate Reactive can't persist a many-to-many relation when one of the entities is a child (with the "joined" inheritance type) and the batch size is greater than 1 HOT 10
- Postgresql bump causing detection of instance Random/SplittableRandom HOT 11
- jpamodelgen fails with range out of bounds HOT 9
- Properly pass errors from JsonRPC backends to Dev UI HOT 2
- Unable to build a container with Jib when podman is running HOT 7
- Exception thrown when stopping devmode and with dev services running with Podman HOT 1
- Quarkus opentelemetry extension WARNING when exporting to dynatrace HOT 11
- GRPC server doesn't respond when running on the same server as HTTP and using TLS HOT 6
- Add @PermissionsAllowed to Panache Resources HOT 9
- Native: Introduce flag to favor build time improvements at the cost of using more resources and vice versa HOT 4
- Prevent API scraping through obscurity HOT 2
- Decorating MongoClient does not work because decorator is removed during build HOT 3
- Jakarta RESTful Web Services 3.1 Multipart support does not work HOT 7
- Wrong duplicateEndPoint when implements two Rest interfaces HOT 7
- Quarkus SmallRye GraphQL not emitting metrics HOT 2
- Use Arc AnnotationStore to build Hibernate ORM metadata HOT 25
- Mockito fails to mock non-public inner class in continuous testing due to classloading issues HOT 8
- cert chain public key resolver thumbprints HOT 4
- Quarkus 3.7.4 java.lang.ClassNotFoundException when running devsevices with gradle HOT 14
- Better error message for @ParameterizedTest failures in a @QuarkusTest HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from quarkus.