@Configuration
@ConditionalOnBean(value=org.springframework.cloud.config.client.ConfigClientProperties.class)
@ConditionalOnProperty(prefix="spring.cloud.config",
name={"token","client.oauth2.clientId","client.oauth2.clientSecret","client.oauth2.accessTokenUri"})
@AutoConfigureAfter(value=org.springframework.cloud.config.client.ConfigClientAutoConfiguration.class)
@EnableConfigurationProperties(value=ConfigClientOAuth2Properties.class)
@EnableScheduling
public class VaultTokenRenewalAutoConfiguration
extends Object
Configuration for a periodic Vault token renewer. Conditionally configured if there is
a ConfigClientProperties bean and if there is a `spring.cloud.config.token`
property set.
By default, the token is renewed every 60 seconds and is renewed with a 5 minute
time-to-live. The renew rate can be configured by setting `vault.token.renew.rate` to
some value that is the renewal rate in milliseconds. The renewal time-to-live can be
specified with by setting `vault.token.ttl` to some value indicating the time-to-live
in milliseconds.
- Author:
- cwalls