I don't know, how to approach a solution for the following scenario.
We have a new requirement to remove DB Password from properties even though it's encrypted with Jasypt library or some other algorithms.
Instead of storing the password in properties or LDAP, we need to fetch it dynamically from Cyberark.
Password may expire in a day or two or in a week or in a month. It totally depends on Password expiration policy.
We have multiple projects. Some are web-based and some are standalone. We want to write a generic solution.
How to override getConnection
method of any data source like Spring data source, Apache Basic data source (it support extending class), C3P0, DBCP or HikariCP without impacting their behavior and setting the password before hitting super.getConnection()
?
super.getConnection(); // Here max attempt will be 3
Spring supports method replacement, but I don't know what will be the impact on the connection pooling framework.
Let me know if you need more details.
PasswordRenewalDatasource
and wrap the data database's nativeDatasource
- when the password expries (ideally before it does) renew the underlyingDatasrouce
. Pass thePasswordRenewalDatasource
to your connection pool. – JohnnajohnniedataSourceClassName
- then configure as normal, you will all need to pass the renewal properties. – JohnnajohnnieProperties.load()
. Aspect will check if property name haspassword
in it (or you could use any other more suitable check) and then go to Cyberark to get actual password – Bracey