From 319bddb274df2699037b0d6c49089049ebf961f6 Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Fri, 8 Nov 2024 10:35:59 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A3=BC=EC=84=9D=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/base/crypto/CryptographySupport.java | 39 ------------------- 1 file changed, 39 deletions(-) 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;