Skip to content

Commit

Permalink
fix: format code using mvn
Browse files Browse the repository at this point in the history
  • Loading branch information
chenmutime committed Dec 28, 2023
1 parent 7b14ade commit 844ff90
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
import org.apache.linkis.common.exception.WarnException;
import org.apache.linkis.datasourcemanager.common.auth.AuthContext;
import org.apache.linkis.datasourcemanager.common.domain.DataSourceParamKeyDefinition;
import org.apache.linkis.datasourcemanager.common.util.CryptoUtils;
import org.apache.linkis.datasourcemanager.core.restful.exception.BeanValidationExceptionMapper;
import org.apache.linkis.datasourcemanager.core.validate.ParameterValidateException;
import org.apache.linkis.server.Message;

import org.apache.commons.codec.binary.Base64;

import javax.validation.ConstraintViolationException;

import java.util.Arrays;
Expand Down Expand Up @@ -68,7 +69,8 @@ public static void encryptPasswordKey(
Object password = connectParams.get(keyDefinition.getKey());
if (null != password) {
connectParams.put(
keyDefinition.getKey(), CryptoUtils.object2String(String.valueOf(password)));
keyDefinition.getKey(),
new String(new Base64().encode(String.valueOf(password).getBytes())));
}
}
});
Expand All @@ -88,7 +90,8 @@ public static void decryptPasswordKey(
Object password = connectParams.get(keyDefinition.getKey());
if (null != password) {
connectParams.put(
keyDefinition.getKey(), CryptoUtils.object2String(String.valueOf(password)));
keyDefinition.getKey(),
new String(new Base64().decode(String.valueOf(password).getBytes())));
}
}
});
Expand All @@ -109,7 +112,6 @@ public static Message doAndResponse(TryOperation tryOperation, String failMessag
} catch (WarnException e) {
return Message.warn(e.getMessage());
} catch (Exception e) {
e.printStackTrace();
return Message.error(failMessage, e);
}
}
Expand Down

0 comments on commit 844ff90

Please sign in to comment.