마지막으로 Play Plugin을 작성하여이 문제를 해결했습니다. Play 플러그인을 작성하는 것도 매우 쉽습니다. 더 해독 방법이 없기 때문에 - 유일한 단점은 내가 org.jasypt.util.password.StrongPasswordEncryptor를 사용할 수 없습니다 때문이다
package plugin;
import java.util.Properties;
import org.jasypt.util.text.StrongTextEncryptor;
import play.Play;
import play.PlayPlugin;
public class DBPasswordInject extends PlayPlugin {
@Override
public void onConfigurationRead() {
StrongTextEncryptor strongTextEncryptor = new StrongTextEncryptor();
strongTextEncryptor.setPassword("$Look##$2");// this password has been used to encrypt
String encryptedPassword = Play.configuration.getProperty("db.pass");
String decrypted = strongTextEncryptor.decrypt(encryptedPassword);
Play.configuration.setProperty("db.pass", decrypted); //override
super.onConfigurationRead();
}
}
: 다음은 샘플 코드입니다.
재미있는 질문입니다. [Play Google 그룹] (http://groups.google.com/group/play-framework)에 게시하여 최대 범위를 확보 할 수도 있습니다. – tmbrggmn