github에서 보안이슈로 권고한 jackson json library 버전 수정 및 잡다한 내용 수정

This commit is contained in:
Terry Chang
2018-10-17 17:11:36 +09:00
parent bd577ec699
commit 4ad17e3ca8
6 changed files with 102 additions and 98 deletions

View File

@@ -37,7 +37,7 @@
<log4jdbc.version>1.16</log4jdbc.version> <log4jdbc.version>1.16</log4jdbc.version>
<!-- Jackson Json Version --> <!-- Jackson Json Version -->
<jackson.version>2.5.1</jackson.version> <jackson.version>2.9.7</jackson.version>
<!-- jackson.version>1.9.13</jackson.version --> <!-- jackson.version>1.9.13</jackson.version -->
</properties> </properties>
<dependencies> <dependencies>

View File

@@ -66,31 +66,34 @@ public class XplatformReflectionUtils {
calendar.set(Calendar.DAY_OF_MONTH, Integer.parseInt(day, 10)); calendar.set(Calendar.DAY_OF_MONTH, Integer.parseInt(day, 10));
} else { // DataTypes.DATE 타입에 8자리 숫자가 들어와야 하는데 그러지 않은 것이므로 예외처리 대상이다 } else { // DataTypes.DATE 타입에 8자리 숫자가 들어와야 하는데 그러지 않은 것이므로 예외처리 대상이다
throw new IllegalArgumentException("dataType must be 8 characters in Xplatform DATE type");
} }
} else if(dataType == DataTypes.TIME) { } else if(dataType == DataTypes.TIME) {
if(columnValue.length() > 6) { if(columnValue.length() >= 6) {
String hour = columnValue.substring(0, 2); String hour = columnValue.substring(0, 2);
String minute = columnValue.substring(2, 4); String minute = columnValue.substring(2, 4);
String second = columnValue.substring(4, 6); String second = columnValue.substring(4, 6);
String milisecond = columnValue.substring(6, 9);
calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour, 10)); calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour, 10));
calendar.set(Calendar.MINUTE, Integer.parseInt(minute, 10)); calendar.set(Calendar.MINUTE, Integer.parseInt(minute, 10));
calendar.set(Calendar.SECOND, Integer.parseInt(second, 10)); calendar.set(Calendar.SECOND, Integer.parseInt(second, 10));
calendar.set(Calendar.MILLISECOND, Integer.parseInt(milisecond, 10));
} else { // DataTypes.DATE 타입에 6자리 이상의 숫자가 들어와야 하는데 그러지 않은 것이므로 예외처리 대상이다
if(columnValue.length() > 6) {
String milisecond = columnValue.substring(6);
calendar.set(Calendar.MILLISECOND, Integer.parseInt(milisecond, 10));
}
} else { // DataTypes.DATE 타입에 6자리 이상의 숫자가 들어와야 하는데 그러지 않은 것이므로 예외처리 대상이다
throw new IllegalArgumentException("dataType must be 6 characters in Xplatform TIME type");
} }
} else if(dataType == DataTypes.DATE_TIME) { } else if(dataType == DataTypes.DATE_TIME) {
if(columnValue.length() == 17) { if(columnValue.length() >= 14) {
String year = columnValue.substring(0, 4); String year = columnValue.substring(0, 4);
String month = columnValue.substring(4, 6); String month = columnValue.substring(4, 6);
String day = columnValue.substring(6, 8); String day = columnValue.substring(6, 8);
String hour = columnValue.substring(8, 10); String hour = columnValue.substring(8, 10);
String minute = columnValue.substring(10, 12); String minute = columnValue.substring(10, 12);
String second = columnValue.substring(12, 14); String second = columnValue.substring(12, 14);
String milisecond = columnValue.substring(14);
calendar.set(Calendar.YEAR, Integer.parseInt(year, 10)); calendar.set(Calendar.YEAR, Integer.parseInt(year, 10));
calendar.set(Calendar.MONTH, Integer.parseInt(month, 10) - 1); calendar.set(Calendar.MONTH, Integer.parseInt(month, 10) - 1);
@@ -98,10 +101,14 @@ public class XplatformReflectionUtils {
calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour, 10)); calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour, 10));
calendar.set(Calendar.MINUTE, Integer.parseInt(minute, 10)); calendar.set(Calendar.MINUTE, Integer.parseInt(minute, 10));
calendar.set(Calendar.SECOND, Integer.parseInt(second, 10)); calendar.set(Calendar.SECOND, Integer.parseInt(second, 10));
if(columnValue.length() > 14) {
String milisecond = columnValue.substring(14);
calendar.set(Calendar.MILLISECOND, Integer.parseInt(milisecond, 10)); calendar.set(Calendar.MILLISECOND, Integer.parseInt(milisecond, 10));
}
} else { // DataTypes.DATE 타입에 14자리 이상의 숫자가 들어와야 하는데 그러지 않은 것이므로 예외처리 대상이다 } else { // DataTypes.DATE 타입에 14자리 이상의 숫자가 들어와야 하는데 그러지 않은 것이므로 예외처리 대상이다
throw new IllegalArgumentException("dataType must be 14 charactersin Xplatform DATE_TIME type");
} }
} }

View File

@@ -82,9 +82,7 @@ public class XplatformArgumentResolver implements HandlerMethodArgumentResolver
Class<?> type = parameter.getParameterType(); Class<?> type = parameter.getParameterType();
Annotation[] annotations = parameter.getParameterAnnotations(); Annotation[] annotations = parameter.getParameterAnnotations();
HttpServletRequest request = (HttpServletRequest)webRequest.getNativeRequest(); HttpServletRequest request = webRequest.getNativeRequest(HttpServletRequest.class);
// HttpServletRequest request = webRequest.getNativeRequest(HttpServletRequest.class);
// PlatformRequest platformRequest = new HttpPlatformRequest(request, "utf-8");
DataSetList dataSetList = null; DataSetList dataSetList = null;
VariableList variableList = null; VariableList variableList = null;
@@ -121,7 +119,7 @@ public class XplatformArgumentResolver implements HandlerMethodArgumentResolver
} else if(annotationClass.equals(RequestDataSet.class)) { // @RequestDataSet 어노테이션에 대한 처리 } else if(annotationClass.equals(RequestDataSet.class)) { // @RequestDataSet 어노테이션에 대한 처리
RequestDataSet requestDataSet = (RequestDataSet)annotation; RequestDataSet requestDataSet = (RequestDataSet)annotation;
String dataSetName = requestDataSet.name(); String dataSetName = requestDataSet.name();
if(!StringUtils.hasText(dataSetName)) { // DataSet 이름이 빠진것이므로 이거는 예외처리 진행하자 if(!StringUtils.hasText(dataSetName)) { // DataSet 이름이 빠진경우
result = WebArgumentResolver.UNRESOLVED; result = WebArgumentResolver.UNRESOLVED;
} else { } else {
DataSet dataSet = dataSetList.get(dataSetName); DataSet dataSet = dataSetList.get(dataSetName);
@@ -180,7 +178,7 @@ public class XplatformArgumentResolver implements HandlerMethodArgumentResolver
} else { } else {
result = variable.getObject(); result = variable.getObject();
} }
} else { // 특정 변수 이름이 없으면 VO로 매핑하는 것이기 때문에 오히려 이런 경우 자바의 데이터타입과는 매핑을 할 수 없다 } else { // 특정 변수 이름이 없으면 List, Set, Map 또는 VO로 매핑하는 것이기 때문에 오히려 이런 경우 자바의 데이터타입과는 매핑을 할 수 없다
List<String> keyList = variableList.keyList(); List<String> keyList = variableList.keyList();
if(Collection.class.isAssignableFrom(type)) { if(Collection.class.isAssignableFrom(type)) {
@@ -221,6 +219,7 @@ public class XplatformArgumentResolver implements HandlerMethodArgumentResolver
for(String key : keyList) { for(String key : keyList) {
Field keyField = ReflectionUtils.findField(type, key); Field keyField = ReflectionUtils.findField(type, key);
if(keyField == null) continue;
ReflectionUtils.makeAccessible(keyField); ReflectionUtils.makeAccessible(keyField);
Class<?> keyFieldType = keyField.getType(); Class<?> keyFieldType = keyField.getType();

View File

@@ -18,6 +18,4 @@ public class XplatformViewResolver extends AbstractTemplateViewResolver {
return view; return view;
} }
} }

View File

@@ -12,8 +12,8 @@
<targetPlatform>Windows,CE,Linux</targetPlatform> <targetPlatform>Windows,CE,Linux</targetPlatform>
</customer> </customer>
<date> <date>
<activation>2018-08-01</activation> <activation>2018-10-01</activation>
<term unit="month">2</term> <term unit="month">2</term>
</date> </date>
<key>RDUTZJQZYZVS42PMV7NP4WGXE53J4VWM9</key> <key>X9SNZZ4F8D2WSUDUCFFWVYPQCBYA4NXH7</key>
</license> </license>