Is your feature request related to a problem? Please describe.
I have tried to use the KeyVaultEnvironmentPostProcessor with a local test double and started to wonder whether I am doing it wrong or it is not possible to configure how the SecretClient is created (or use my own bean instead of creating a new one).
The SecretClientBuilderFactory is using only the bare minimum default configuration here as I understood. It is a bit confusing as I have assumed this bean will be reused from AzureKeyVaultSecretAutoConfiguration.
Describe the solution you'd like
Could we please provide our own SecretClient instance to the KeyVaultEnvironmentPostProcessor as an option?
Describe alternatives you've considered
If there would be a simple way to at least override the method and use a subclass that could be helpful as well, but it has package visibility now.
Additional context
In case we need to customize the SecretClient (for example a custom TokenCredential implementation needs to be used etc.) then it is not possible to do it as far as I see without hacking the KeyVaultEnvironmentPostProcessor. In my case, I would love to use a local test double for development and only use the real Key Vault in test/prod environments.
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
Is your feature request related to a problem? Please describe.
I have tried to use the
KeyVaultEnvironmentPostProcessorwith a local test double and started to wonder whether I am doing it wrong or it is not possible to configure how theSecretClientis created (or use my own bean instead of creating a new one).The
SecretClientBuilderFactoryis using only the bare minimum default configuration here as I understood. It is a bit confusing as I have assumed this bean will be reused from AzureKeyVaultSecretAutoConfiguration.Describe the solution you'd like
Could we please provide our own
SecretClientinstance to theKeyVaultEnvironmentPostProcessoras an option?Describe alternatives you've considered
If there would be a simple way to at least override the method and use a subclass that could be helpful as well, but it has package visibility now.
Additional context
In case we need to customize the
SecretClient(for example a customTokenCredentialimplementation needs to be used etc.) then it is not possible to do it as far as I see without hacking theKeyVaultEnvironmentPostProcessor. In my case, I would love to use a local test double for development and only use the real Key Vault in test/prod environments.Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report