deprecate default methods to read specific database credentials (#92)
All checks were successful
CI / build-with-it (11, 1.2.0) (push) Successful in 57s
CI / build-with-it (11, 1.19.0) (push) Successful in 1m3s
CI / build-with-it (17, 1.2.0) (push) Successful in 57s
CI / build-with-it (17, 1.19.0) (push) Successful in 1m4s
CI / build-with-it (21, 1.2.0) (push) Successful in 54s
CI / build-with-it (true, 21, 1.19.0) (push) Successful in 1m2s

The interface has some methods to read database credentials from
specific mountpoints like "mysql". While ann database mounts share
the same credential endpoints, the mount point itself can have any
name. Let's clean up some methods of low benefit and deprecate the
convenience methods.

Trivial replacement is `getDbCredentials()` with explicit mount point,
if it's actually mounted on that path.
This commit is contained in:
Stefan Kalscheuer 2025-03-09 11:31:02 +01:00
parent f50f5c5de7
commit d329af2c67
Signed by: stefan
GPG Key ID: 3887EC2A53B55430
2 changed files with 14 additions and 3 deletions

View File

@ -1,5 +1,8 @@
## unreleased
### Deprecations
* `read...Credentials()` methods for specific database mounts (#92)
### Dependencies
* Updated Jackson to 2.18.3 (#90)

View File

@ -681,7 +681,9 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* @return the credentials response
* @throws VaultConnectorException on error
* @since 0.5.0
* @deprecated use {@link #readDbCredentials(String, String)} your MySQL mountpoint
*/
@Deprecated(since = "1.5.0", forRemoval = true)
default CredentialsResponse readMySqlCredentials(final String role) throws VaultConnectorException {
return readDbCredentials(role, "mysql");
}
@ -693,7 +695,9 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* @return the credentials response
* @throws VaultConnectorException on error
* @since 0.5.0
* @deprecated use {@link #readDbCredentials(String, String)} your PostgreSQL mountpoint
*/
@Deprecated(since = "1.5.0", forRemoval = true)
default CredentialsResponse readPostgreSqlCredentials(final String role) throws VaultConnectorException {
return readDbCredentials(role, "postgresql");
}
@ -705,28 +709,32 @@ public interface VaultConnector extends AutoCloseable, Serializable {
* @return the credentials response
* @throws VaultConnectorException on error
* @since 0.5.0
* @deprecated use {@link #readDbCredentials(String, String)} your MSSQL mountpoint
*/
@Deprecated(since = "1.5.0", forRemoval = true)
default CredentialsResponse readMsSqlCredentials(final String role) throws VaultConnectorException {
return readDbCredentials(role, "mssql");
}
/**
* Read credentials for MSSQL backend at default mount point.
* Read credentials for MongoDB backend at default mount point.
*
* @param role the role name
* @return the credentials response
* @throws VaultConnectorException on error
* @since 0.5.0
* @deprecated use {@link #readDbCredentials(String, String)} your MongoDB mountpoint
*/
@Deprecated(since = "1.5.0", forRemoval = true)
default CredentialsResponse readMongoDbCredentials(final String role) throws VaultConnectorException {
return readDbCredentials(role, "mongodb");
}
/**
* Read credentials for SQL backends.
* Read credentials for database backends.
*
* @param role the role name
* @param mount mount point of the SQL backend
* @param mount mount point of the database backend
* @return the credentials response
* @throws VaultConnectorException on error
* @since 0.5.0