Skip to content

Commit d329af2

Browse files
committed
deprecate default methods to read specific database credentials (#92)
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.
1 parent f50f5c5 commit d329af2

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## unreleased
22

3+
### Deprecations
4+
* `read...Credentials()` methods for specific database mounts (#92)
5+
36
### Dependencies
47
* Updated Jackson to 2.18.3 (#90)
58

src/main/java/de/stklcode/jvault/connector/VaultConnector.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,9 @@ default boolean createOrUpdateTokenRole(final TokenRole role) throws VaultConnec
681681
* @return the credentials response
682682
* @throws VaultConnectorException on error
683683
* @since 0.5.0
684+
* @deprecated use {@link #readDbCredentials(String, String)} your MySQL mountpoint
684685
*/
686+
@Deprecated(since = "1.5.0", forRemoval = true)
685687
default CredentialsResponse readMySqlCredentials(final String role) throws VaultConnectorException {
686688
return readDbCredentials(role, "mysql");
687689
}
@@ -693,7 +695,9 @@ default CredentialsResponse readMySqlCredentials(final String role) throws Vault
693695
* @return the credentials response
694696
* @throws VaultConnectorException on error
695697
* @since 0.5.0
698+
* @deprecated use {@link #readDbCredentials(String, String)} your PostgreSQL mountpoint
696699
*/
700+
@Deprecated(since = "1.5.0", forRemoval = true)
697701
default CredentialsResponse readPostgreSqlCredentials(final String role) throws VaultConnectorException {
698702
return readDbCredentials(role, "postgresql");
699703
}
@@ -705,28 +709,32 @@ default CredentialsResponse readPostgreSqlCredentials(final String role) throws
705709
* @return the credentials response
706710
* @throws VaultConnectorException on error
707711
* @since 0.5.0
712+
* @deprecated use {@link #readDbCredentials(String, String)} your MSSQL mountpoint
708713
*/
714+
@Deprecated(since = "1.5.0", forRemoval = true)
709715
default CredentialsResponse readMsSqlCredentials(final String role) throws VaultConnectorException {
710716
return readDbCredentials(role, "mssql");
711717
}
712718

713719
/**
714-
* Read credentials for MSSQL backend at default mount point.
720+
* Read credentials for MongoDB backend at default mount point.
715721
*
716722
* @param role the role name
717723
* @return the credentials response
718724
* @throws VaultConnectorException on error
719725
* @since 0.5.0
726+
* @deprecated use {@link #readDbCredentials(String, String)} your MongoDB mountpoint
720727
*/
728+
@Deprecated(since = "1.5.0", forRemoval = true)
721729
default CredentialsResponse readMongoDbCredentials(final String role) throws VaultConnectorException {
722730
return readDbCredentials(role, "mongodb");
723731
}
724732

725733
/**
726-
* Read credentials for SQL backends.
734+
* Read credentials for database backends.
727735
*
728736
* @param role the role name
729-
* @param mount mount point of the SQL backend
737+
* @param mount mount point of the database backend
730738
* @return the credentials response
731739
* @throws VaultConnectorException on error
732740
* @since 0.5.0

0 commit comments

Comments
 (0)