Package com.seeq.link.sdk.utilities
Class SecretsHelper
java.lang.Object
com.seeq.link.sdk.utilities.SecretsHelper
Utility for accessing secret configuration fields from external files.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
resolveSecret
(String secretInputString) Gets the secret from the secretInputString.static void
setBasePath
(Path newBasePath) Sets the base path for relative secret file resolution (e.g.
-
Method Details
-
resolveSecret
Gets the secret from the secretInputString. The input may contain a reference to a secret file in the form SECRETS_FILE:/path/to/the/secrets/file. The file may be also relative to the agent data_dir.- Parameters:
secretInputString
- the input as it comes from the configuration file (can be null)- Returns:
- null if the input is null the input if it doesn't start with the prefix "SECRETS_FILE:" the string from file if the input has syntax "SECRETS_FILE:/path/to/the/credentials/file"
- Throws:
com.seeq.utilities.exception.RuntimeIOException
- if an I/O error occurs reading from the file or a malformed or unmappable byte sequence is read
-
setBasePath
Sets the base path for relative secret file resolution (e.g. SECRETS_FILE:relative/path). This should be only called by DefaultAgent during initialization.
-