forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use spring.factories to provide bean: KeyVaultHealthIndicator. (Azure…
…#14337) * Use spring.factories to provide bean: KeyVaultHealthIndicator. * Fix error reported by maven-checkstyle-plugin. Co-authored-by: Rujun Chen <[email protected]>
- Loading branch information
Showing
6 changed files
with
35 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...-boot-test-cosmosdb/src/test/java/com/microsoft/azure/test/cosmosdb/CosmosActuatorIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...g-boot/src/main/java/com/microsoft/azure/keyvault/spring/KeyVaultHealthConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.microsoft.azure.keyvault.spring; | ||
|
||
import com.azure.security.keyvault.secrets.SecretClient; | ||
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator; | ||
import org.springframework.boot.actuate.health.HealthIndicator; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.PropertySource; | ||
import org.springframework.core.env.ConfigurableEnvironment; | ||
|
||
@Configuration | ||
@ConditionalOnClass({ SecretClient.class, HealthIndicator.class }) | ||
@PropertySource("classpath:/azure-spring-actuator.properties") | ||
public class KeyVaultHealthConfiguration { | ||
|
||
@Bean | ||
@ConditionalOnEnabledHealthIndicator("azure-key-vault") | ||
KeyVaultHealthIndicator keyVaultHealthIndicator(ConfigurableEnvironment environment) { | ||
return new KeyVaultHealthIndicator(environment); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters