Custom Secure Storage allows organizations to integrate their own proprietary or third-party key vault solutions with AMT Java. This option provides flexibility for environments that use specialized security infrastructure not directly supported by the built-in vault types.
To use a custom vault implementation, you must first create a Java class that implements the AmtVaultAPI
interface. This class will handle the connection logic and secret retrieval from your chosen secure storage
solution.
Your custom vault class must implement the following interface:
package com.avanade.ltcoe.amt.secure.storage;
public interface AmtVaultAPI {
void initialize(Map<String, String> vaultConfiguration)
throws AmtVaultInitializationException;
String getSecret(String key);
}The implementation should:
initialize() method using configuration from the YAML filegetSecret() method, returning null if the key is not foundFor reference examples, see the built-in implementations such as AmtSimpleVault,
AmtAzureVault, or AmtHashiCorpVault in the secure storage API package.
After creating your custom vault implementation, update the Control Center or Application configuration file to reference your custom class:
secureStorages:
- id: custom
vaultType: Custom
vaultClass: com.example.mycompany.MyCustomVault
vaultConfiguration:
# Add your custom configuration key-value pairs here
customSetting1: value1
customSetting2: value2Configuration Parameters:
id - A unique identifier for this vault instancevaultType - Must be set to CustomvaultClass - The fully qualified class name of your custom vault implementationvaultConfiguration - Key-value pairs passed to your vault's initialize() method| Important |
|---|
If the class specified in vaultClass cannot be found on the classpath, the runtime will
fail to start with a VaultClassNotFoundException. |
Your custom vault implementation must:
<dependency>
<groupId>com.avanade.ltcoe.amt</groupId>
<artifactId>platform-api-secure-storage</artifactId>
<version>${amt.version}</version>
<scope>provided</scope>
</dependency>| Good to know |
|---|
Your custom vault implementation has access to all configuration values specified in
vaultConfiguration, allowing you to pass connection strings, credentials, or any other
settings your vault needs. |