
com.venky.swf.db.model.application.ApplicationImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of swf-db Show documentation
Show all versions of swf-db Show documentation
Succinct Web Framework - Db
The newest version!
package com.venky.swf.db.model.application;
import com.venky.core.util.ObjectUtil;
import com.venky.digest.Encryptor;
import com.venky.swf.db.table.ModelImpl;
import com.venky.swf.routing.Config;
public class ApplicationImpl extends ModelImpl {
public ApplicationImpl(Application proxy){
super(proxy);
}
public String getChangeSecret(){
return "";
}
public void setChangeSecret(String secret){
if (!ObjectUtil.isVoid(secret)){
getProxy().setSecret(getEncryptedSecret(secret));
}
}
public String getEncryptedSecret(String unEncryptedSecret){
String encryptedSecret = unEncryptedSecret;
if (!ObjectUtil.isVoid(unEncryptedSecret) && Config.instance().shouldPasswordsBeEncrypted()){
Application app = getProxy();
if (app.getReflector().isVoid(app.getCreatedAt())){
app.setCreatedAt(app.getReflector().getNow());
}
long time = app.getCreatedAt().getTime();
String salt = time + "--" + app.getAppId() + "--" ;
encryptedSecret = Encryptor.encrypt(unEncryptedSecret + "--" + salt);
}
return encryptedSecret;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy