diff --git a/src/main/java/de/stklcode/jvault/connector/VaultConnector.java b/src/main/java/de/stklcode/jvault/connector/VaultConnector.java index 0dada1a..83b9187 100644 --- a/src/main/java/de/stklcode/jvault/connector/VaultConnector.java +++ b/src/main/java/de/stklcode/jvault/connector/VaultConnector.java @@ -398,7 +398,8 @@ public interface VaultConnector extends AutoCloseable, Serializable { /** * Retrieve secret from Vault. - * Prefix "secret/" is automatically added to key. + *
+ * Prefix {@code secret/} is automatically added to key. * * @param key Secret identifier * @return Secret response @@ -410,7 +411,9 @@ public interface VaultConnector extends AutoCloseable, Serializable { /** * Retrieve the latest secret data for specific version from Vault. - * Prefix "secret/data" is automatically added to key. Only available for KV v2 secrets. + *
+ * Prefix "secret/data" is automatically added to key. + * Only available for KV v2 secrets. * * @param key Secret identifier * @return Secret response @@ -423,7 +426,9 @@ public interface VaultConnector extends AutoCloseable, Serializable { /** * Retrieve the latest secret data for specific version from Vault. - * Prefix "secret/data" is automatically added to key. Only available for KV v2 secrets. + *
+ * Path {@code /data/} is read here. + * Only available for KV v2 secrets. * * @param mount Secret store mountpoint (without leading or trailing slash). * @param key Secret identifier @@ -437,7 +442,9 @@ public interface VaultConnector extends AutoCloseable, Serializable { /** * Write secret to Vault. - * Prefix "secret/" is automatically added to path. Only available for KV v2 secrets. + *
+ * Prefix {@code secret/} is automatically added to path. + * Only available for KV v2 secrets. * * @param key Secret identifier. * @param data Secret content. Value must be be JSON serializable. @@ -451,7 +458,9 @@ public interface VaultConnector extends AutoCloseable, Serializable { /** * Write secret to Vault. - * Prefix "secret/" is automatically added to path. Only available for KV v2 secrets. + *
+ * Path {@code /data/} is written here. + * Only available for KV v2 secrets. * * @param mount Secret store mountpoint (without leading or trailing slash). * @param key Secret identifier @@ -466,7 +475,9 @@ public interface VaultConnector extends AutoCloseable, Serializable { /** * Write secret to Vault. - * Prefix "secret/" is automatically added to path. Only available for KV v2 secrets. + *
+ * Path {@code /data/} is written here. + * Only available for KV v2 secrets. * * @param mount Secret store mountpoint (without leading or trailing slash). * @param key Secret identifier @@ -480,7 +491,9 @@ public interface VaultConnector extends AutoCloseable, Serializable { /** * Retrieve secret data from Vault. - * Prefix "secret/data" is automatically added to key. Only available for KV v2 secrets. + *
+ * Path {@code /data/} is read here. + * Only available for KV v2 secrets. * * @param key Secret identifier * @param version Version to read. If {@code null} or zero, the latest version will be returned. @@ -494,7 +507,9 @@ public interface VaultConnector extends AutoCloseable, Serializable { /** * Retrieve secret data from Vault. - * Prefix "secret/data" is automatically added to key. Only available for KV v2 secrets. + *
+ * Path {@code /data/} is read here. + * Only available for KV v2 secrets. * * @param mount Secret store mountpoint (without leading or trailing slash). * @param key Secret identifier @@ -507,7 +522,8 @@ public interface VaultConnector extends AutoCloseable, Serializable { /** * Retrieve secret metadata from Vault. - * Prefix "secret/metadata" is automatically added to key. Only available for KV v2 secrets. + * Path {@code secret/metadata/} is read here. + * Only available for KV v2 secrets. * * @param key Secret identifier * @return Metadata response @@ -518,21 +534,11 @@ public interface VaultConnector extends AutoCloseable, Serializable { return readSecretMetadata(PATH_SECRET, key); } - /** - * Retrieve secret metadata from Vault. - * Prefix "metadata" is automatically added to key. Only available for KV v2 secrets. - * - * @param mount Secret store mountpoint (without leading or trailing slash). - * @param key Secret identifier - * @return Metadata response - * @throws VaultConnectorException on error - * @since 0.8 - */ - MetadataResponse readSecretMetadata(final String mount, final String key) throws VaultConnectorException; - /** * Update secret metadata. - * Prefix "secret/metadata" is automatically added to key. Only available for KV v2 secrets. + *
+ * Path {@code secret/metadata/} is read here. + * Only available for KV v2 secrets. * * @param key Secret identifier * @param maxVersions Maximum number of versions (fallback to backend default if {@code null}) @@ -544,9 +550,25 @@ public interface VaultConnector extends AutoCloseable, Serializable { updateSecretMetadata(PATH_SECRET, key, maxVersions, casRequired); } + /** + * Retrieve secret metadata from Vault. + *
+ * Path {@code /metadata/} is read here. + * Only available for KV v2 secrets. + * + * @param mount Secret store mountpoint (without leading or trailing slash). + * @param key Secret identifier + * @return Metadata response + * @throws VaultConnectorException on error + * @since 0.8 + */ + MetadataResponse readSecretMetadata(final String mount, final String key) throws VaultConnectorException; + /** * Update secret metadata. - * Prefix "metadata" is automatically added to key. Only available for KV v2 secrets. + *
+ * Path {@code /metadata/} is written here. + * Only available for KV v2 secrets. * * @param mount Secret store mountpoint (without leading or trailing slash). * @param key Secret identifier @@ -569,7 +591,8 @@ public interface VaultConnector extends AutoCloseable, Serializable { /** * List available secrets from Vault. - * Prefix "secret/" is automatically added to path. + *
+ * Prefix {@code secret/} is automatically added to path. * * @param path Root path to search * @return List of secret keys @@ -618,7 +641,8 @@ public interface VaultConnector extends AutoCloseable, Serializable { /** * Write secret to Vault. - * Prefix "secret/" is automatically added to path. + *
+ * Prefix {@code secret/} is automatically added to path. * * @param key Secret path * @param value Secret value @@ -632,7 +656,8 @@ public interface VaultConnector extends AutoCloseable, Serializable { /** * Write secret to Vault. - * Prefix "secret/" is automatically added to path. + *
+ * Prefix {@code secret/} is automatically added to path. * * @param key Secret path * @param data Secret content. Value must be be JSON serializable. @@ -657,7 +682,8 @@ public interface VaultConnector extends AutoCloseable, Serializable { /** * Delete secret from Vault. - * Prefix "secret/" is automatically added to path. + *
+ * Prefix {@code secret/} is automatically added to path. * * @param key Secret path * @throws VaultConnectorException on error @@ -668,7 +694,8 @@ public interface VaultConnector extends AutoCloseable, Serializable { /** * Delete latest version of a secret from Vault. - * Only available for KV v2 stores. + *
+ * Prefix {@code secret/} is automatically added to path. Only available for KV v2 stores. * * @param key Secret path. * @throws VaultConnectorException on error @@ -680,6 +707,7 @@ public interface VaultConnector extends AutoCloseable, Serializable { /** * Delete latest version of a secret from Vault. + *
* Only available for KV v2 stores. * * @param mount Secret store mountpoint (without leading or trailing slash). @@ -691,6 +719,8 @@ public interface VaultConnector extends AutoCloseable, Serializable { /** * Delete latest version of a secret from Vault. + *
+ * Prefix {@code secret/} is automatically added to path. * Only available for KV v2 stores. * * @param key Secret path. @@ -703,6 +733,8 @@ public interface VaultConnector extends AutoCloseable, Serializable { /** * Delete latest version of a secret from Vault. + *
+ * Prefix {@code secret/} is automatically added to path. * Only available for KV v2 stores. * * @param mount Secret store mountpoint (without leading or trailing slash). @@ -714,6 +746,7 @@ public interface VaultConnector extends AutoCloseable, Serializable { /** * Delete secret versions from Vault. + *
* Only available for KV v2 stores. * * @param key Secret path. @@ -727,6 +760,7 @@ public interface VaultConnector extends AutoCloseable, Serializable { /** * Delete secret versions from Vault. + *
* Only available for KV v2 stores. * * @param mount Secret store mountpoint (without leading or trailing slash). @@ -854,6 +888,8 @@ public interface VaultConnector extends AutoCloseable, Serializable { */ TokenResponse lookupToken(final String token) throws VaultConnectorException; + + /** * Read credentials for MySQL backend at default mount point. *