Class VaultClient
java.lang.Object
com.scivicslab.turingworkflow.plugins.vault.VaultClient
Client for HashiCorp Vault API communication.
Supports reading secrets from Vault KV v2 engine.
- Since:
- 1.0.0
- Author:
- devteam@scivicslab.com
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classException thrown when Vault HTTP operations fail. -
Constructor Summary
ConstructorsConstructorDescriptionVaultClient(VaultConfig config) Creates a new VaultClient with the given configuration. -
Method Summary
-
Constructor Details
-
VaultClient
Creates a new VaultClient with the given configuration.- Parameters:
config- Vault configuration
-
-
Method Details
-
readField
Reads a named field from a Vault KV v2 secret. The path uses CLI-style notation (mount/key);data/is inserted automatically between the mount and the key. For example,"keycloak-local-llm/test-users"becomes the API path/v1/keycloak-local-llm/data/test-users.- Parameters:
kvPath- KV path in CLI notation (e.g., "keycloak-local-llm/test-users")fieldName- name of the field inside the secret's data map- Returns:
- field value as String
- Throws:
VaultClient.VaultException- if Vault communication fails, secret not found, or field missing
-
readSecret
Reads a secret from Vault using the full API path (legacy; reads thevaluefield).- Parameters:
path- full KV v2 API path (e.g., "secret/data/ssh/iacuser/private_key")- Returns:
- value of the
valuefield - Throws:
VaultClient.VaultException- if Vault communication fails or secret not found
-