In Springboot, let's say I have a configuration that reads a properties file like this.
@Configuration @PropertySource( "classpath:karmiel.properties") Contents of karmiel.propeties:
keystore=https:/blah/vault username-token=vault-user-value password-token=vault-password-value url=vault-connection+path karmiel.properties is transmitted automatically during aks pods startup and forbidden from having human intervention to modify its contents.
I would like that all names of properties read from karmiel.properties to be spontaneously prefixed with "karmiel." ,
so that it was as though the contents of the properties file were
karmiel.keystore=https:/blah/vault karmiel.username-token=vault-user-value karmiel.password-token=vault-password-value karmiel.url=vault-connection+path Such prefixing is necessary because more than one such file is transmitted and read, most of them with clashing property names. For example, there might be a file sderot.properties and I would need Spring to append "sderot." to the names of its properties.
The obvious solution is to update all the secrets generation processes to include the prefixes in the property names before transmitting the file.
Let's say modifying those processes is not possible and that writing intervention deployment code to transform the properties files is also discouraged.
That leaves me with one option which is to read the properties files programmatically.
However, I am hoping if I could reduce the amount of code written by depending on @PropertySource and then hoping that Spring has an automagic feature to append a prefix to the property names.