diff --git a/src/main/java/cokr/xit/base/crypto/CryptographySupport.java b/src/main/java/cokr/xit/base/crypto/CryptographySupport.java index 7649a02..ae84813 100644 --- a/src/main/java/cokr/xit/base/crypto/CryptographySupport.java +++ b/src/main/java/cokr/xit/base/crypto/CryptographySupport.java @@ -42,8 +42,6 @@ public class CryptographySupport extends MybatisPlugin { this.cryptos = cryptos.stream().collect(Collectors.toMap(Cryptography::name, crypto -> crypto)); } - // TODO: 파라미터 추출 및 검사 방식 변경할 것: BoundSql, ParameterMapping을 사용하여 구분 및 추출 - @Override protected Object query(Executor executor, MappedStatement mappedStatement, Object obj, RowBounds rowBounds, ResultHandler resultHandler) throws SQLException { return encrypt(obj, () -> super.query(executor, mappedStatement, obj, rowBounds, resultHandler)); @@ -145,44 +143,7 @@ public class CryptographySupport extends MybatisPlugin { throw runtimeException(e); } } -/* - private void convert(Object obj, BiFunction converter) { - List targetValues = Cryptography.Config.get().getTargetValues(obj); - if (targetValues.isEmpty()) return; - try { - for (Cryptography.TargetValue target: targetValues) { - for (String cryptoDef: target.getCryptoDefs()) { - Cryptography crypto = cryptos.get(cryptoDef); - if (crypto == null) continue; - - if (obj instanceof Map) { - Map map = (Map)obj; - target.getMapKeys().stream() - .filter(key -> map.containsKey(key)) - .forEach(key -> { - Object val = map.get(key); - map.put(key, converter.apply(crypto, val)); - }); - } else { - target.getObjectProperties().stream() - .filter(property -> Property.readable(obj, property)) - .forEach(property -> { - try { - String val = Property.read(obj, property); - Property.write(obj, property, converter.apply(crypto, val)); - } catch (Exception e) { - throw runtimeException(e); - } - }); - } - } - } - } catch (Exception e) { - throw runtimeException(e); - } - } -*/ private void decrypt(Object obj) { if (!isEnabled(obj)) return;