micronaut-discovery-client icon indicating copy to clipboard operation
micronaut-discovery-client copied to clipboard

Make list of Vault keys configurable

Open at-dro opened this issue 1 year ago • 0 comments

Feature description

The Vault configuration supports structured keys based on (default and configured) application name and active environments, which is obviously a great feature. Given application name "my-application" and environment "production" the following requests are sent:

  • /application
  • /my-application
  • /application/production
  • /my-application/production

Additionally, Micronaut activates some environments automatically (e.g. "cloud" or "cli"), each causing two additional requests. However, a lot of these requests might be unnecessary - in our setup, this gives 10 requests, when we really only need "/my-application/production" (all other requests will result in 404 anyway).

In order to improve startup performance and reduce the load on the Vault service, it would be great to make this configurable (configuration names up for discussion):

  • vault.client.ignore-default-application: boolean flag to remove the /application and /application/[env] keys
  • vault.client.ignore-default-environment: boolean flag to remove the /application and /[application-name] keys
  • vault.client.ignored-environments: set of environment names to ignore when generating the keys

For backward compatibility, the defaults should be false and an empty set.

This would probably need to be implemented in the protected method VaultConfigurationClient#buildVaultKeys, which should not have any outside impact.

at-dro avatar Jan 02 '25 11:01 at-dro