justbk2015 opened a new pull request #11439:
URL: https://github.com/apache/shardingsphere/pull/11439
Fixes #11434.
Changes proposed in this pull request:
- add prop PROXY_BACKEND_ALGORITHM and PROXY_FRONTEND_ALGORITHM to config
password encrypt algorithm, default is NONE, that mains nothing to do
- add AES password encrypt algorithm
- anyone can implements AlgorithmSecure interface for new algorithm
examples:
add server.yaml config in props:
proxy-backend-algorithm: AES --this is for config-sharding.yaml's
dataSource password encrypt
proxy-frontend-algorithm: AES -- this is for server.yaml rule's authority
password encrypt

in config file like this:
for backend algorithm:

for frontend algorithm:

to get password, you can simple run algorithm:
---
import org.apache.shardingsphere.infra.security.AesAlgorithmSecure;
public class Main {
public static void main(String ... args) throws Exception {
String plaint = "sharding";
AesAlgorithmSecure util = new AesAlgorithmSecure();
String encryptStr = util.encrypt(plaint);
System.out.println("Encrypt: " + encryptStr);
String decrypt = util.decrypt(encryptStr);
System.out.println("Decrypt: " + decrypt);
}
}
---
result:
Encrypt: TXdQa74U8xed9457/sfIuDnuu7PI8I6hL4IWCy/B0PVopdKwEhZCacukz9k0vhaL
Decrypt: sharding
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]