-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Load and reference secrets from Azure Key Vault in application.proper…
…ties file (#266) * add key vault config * implement key vault secret config and add UT. * add integration test * update key vault doc. * update screenshot of key vault. * update CI/CD. * test CI * fix format issue * fix keyvault IT failure. * revert test setting for pr266. * On branch keyvault-config Copyediting. modified: docs/modules/ROOT/pages/quarkus-azure-key-vault.adoc Signed-off-by: Ed Burns <[email protected]> * On branch keyvault-config Simple javadoc for getSecretIdentifier. modified: extensions/azure-keyvault/runtime/src/main/java/io/quarkiverse/azure/keyvault/secret/runtime/config/KeyVaultSecretConfigUtil.java Signed-off-by: Ed Burns <[email protected]> * apply feedback. * format file * fix secret builder failure. * do not public KeyVaultSecretConfigSource class. * consider different key vault DNS. * add UT. * fix extension id in the Installation section of doc. * add IT test case for not existing secret. * revert IT changes as the application is not able to start if the property does not exist. * add DNS corner case --------- Signed-off-by: Ed Burns <[email protected]> Co-authored-by: Haixia Cheng <[email protected]> Co-authored-by: Ed Burns <[email protected]>
- Loading branch information
1 parent
17b4120
commit c08be36
Showing
20 changed files
with
571 additions
and
34 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
Binary file modified
BIN
+7.58 KB
(130%)
docs/modules/ROOT/assets/images/quarkus-azure-keyvault-secret-portal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
18 changes: 9 additions & 9 deletions
18
.../secret/runtime/KeyVaultSecretConfig.java → .../runtime/config/KeyVaultSecretConfig.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 |
---|---|---|
@@ -1,23 +1,23 @@ | ||
package io.quarkiverse.azure.keyvault.secret.runtime; | ||
package io.quarkiverse.azure.keyvault.secret.runtime.config; | ||
|
||
import java.util.Optional; | ||
|
||
import io.quarkus.runtime.annotations.ConfigItem; | ||
import io.quarkus.runtime.annotations.ConfigPhase; | ||
import io.quarkus.runtime.annotations.ConfigRoot; | ||
import io.smallrye.config.ConfigMapping; | ||
import io.smallrye.config.WithDefault; | ||
|
||
@ConfigRoot(name = "azure.keyvault.secret", phase = ConfigPhase.RUN_TIME) | ||
public class KeyVaultSecretConfig { | ||
|
||
@ConfigMapping(prefix = "quarkus.azure.keyvault.secret") | ||
@ConfigRoot(phase = ConfigPhase.RUN_TIME) | ||
public interface KeyVaultSecretConfig { | ||
/** | ||
* The flag to enable the key vault secret. If set to false, the key vault secret will be disabled | ||
*/ | ||
@ConfigItem(defaultValue = "true") | ||
public boolean enabled; | ||
@WithDefault("true") | ||
boolean enabled(); | ||
|
||
/** | ||
* The endpoint of Azure Key Vault Secret. Required if quarkus.azure.keyvault.secret.enabled is set to true | ||
*/ | ||
@ConfigItem | ||
public Optional<String> endpoint; | ||
Optional<String> endpoint(); | ||
} |
11 changes: 11 additions & 0 deletions
11
...java/io/quarkiverse/azure/keyvault/secret/runtime/config/KeyVaultSecretConfigBuilder.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,11 @@ | ||
package io.quarkiverse.azure.keyvault.secret.runtime.config; | ||
|
||
import io.quarkus.runtime.configuration.ConfigBuilder; | ||
import io.smallrye.config.SmallRyeConfigBuilder; | ||
|
||
public class KeyVaultSecretConfigBuilder implements ConfigBuilder { | ||
@Override | ||
public SmallRyeConfigBuilder configBuilder(SmallRyeConfigBuilder builder) { | ||
return builder.withSources(new KeyVaultSecretConfigSourceFactory()); | ||
} | ||
} |
Oops, something went wrong.