-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3829e09
commit 045c55b
Showing
70 changed files
with
967 additions
and
504 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/main/java/egovframework/com/cmm/resolver/EgovSecurityArgumentResolver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package egovframework.com.cmm.resolver; | ||
|
||
import java.util.Iterator; | ||
|
||
import org.springframework.core.MethodParameter; | ||
import org.springframework.web.bind.support.WebDataBinderFactory; | ||
import org.springframework.web.context.request.NativeWebRequest; | ||
import org.springframework.web.method.support.HandlerMethodArgumentResolver; | ||
import org.springframework.web.method.support.ModelAndViewContainer; | ||
|
||
/** | ||
* Map타입 적용 파라미터 복호화를 위한 Custom ArgumentResolver 클래스 | ||
* | ||
* @author 표준프레임워크팀 이삼섭 | ||
* @since 2024.07.09 | ||
* @version 1.0 | ||
* @see | ||
* | ||
* <pre> | ||
* << 개정이력(Modification Information) >> | ||
* | ||
* 수정일 수정자 수정내용 | ||
* ---------- -------- --------------------------- | ||
* 2024.07.09 신용호 Map 타입에서 noteId 복호화 적용을 위한 ArgumentResolver 추가 | ||
* | ||
* </pre> | ||
*/ | ||
|
||
public class EgovSecurityArgumentResolver implements HandlerMethodArgumentResolver { | ||
|
||
@Override | ||
public boolean supportsParameter(MethodParameter parameter) { | ||
|
||
return EgovSecurityMap.class.isAssignableFrom(parameter.getParameterType()); | ||
} | ||
|
||
@Override | ||
public Object resolveArgument(MethodParameter parameter | ||
, ModelAndViewContainer mavContainer | ||
, NativeWebRequest webRequest | ||
, WebDataBinderFactory binderFactory) throws Exception { | ||
|
||
EgovSecurityMap securityMap = new EgovSecurityMap(); | ||
for(Iterator<String> iterator = webRequest.getParameterNames(); iterator.hasNext();) { | ||
String key = iterator.next(); | ||
securityMap.put(key, webRequest.getParameter(key)); | ||
} | ||
return securityMap; | ||
} | ||
|
||
} |
57 changes: 57 additions & 0 deletions
57
src/main/java/egovframework/com/cmm/resolver/EgovSecurityMap.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package egovframework.com.cmm.resolver; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import egovframework.com.cmm.web.EgovComUtlController; | ||
|
||
/** | ||
* Map타입 적용 파라미터 복호화를 위한 EgovSecurityMap 클래스 | ||
* | ||
* @author 표준프레임워크팀 신용호 | ||
* @since 2024.07.09 | ||
* @version 4.2 | ||
* @see | ||
* | ||
* <pre> | ||
* << 개정이력(Modification Information) >> | ||
* | ||
* 수정일 수정자 수정내용 | ||
* ---------- -------- --------------------------- | ||
* 2024.07.09 신용호 Map 타입에서 noteId 복호화 적용을 위한 EgovSecurityMap 추가 | ||
* | ||
* </pre> | ||
*/ | ||
|
||
public class EgovSecurityMap { | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovSecurityMap.class); | ||
Map<String, String> map = new HashMap<String, String>(); | ||
|
||
public String get(String key) { | ||
|
||
return map.get(key); | ||
} | ||
|
||
public void put(String key, String value) { | ||
// 특정 암호화된 파라미터 복호화 처리 | ||
switch (key) { | ||
case "noteId": | ||
case "noteTrnsmitId": | ||
case "noteRecptnId": | ||
case "reprtId": | ||
LOGGER.debug("===> {} : {}",key,value); | ||
value = EgovComUtlController.decryptId(value); | ||
break; | ||
} | ||
map.put(key, value); | ||
} | ||
|
||
public String toString() { | ||
return map.toString(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/egovframework/com/cmm/web/EgovCipherIdPropertyEditor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package egovframework.com.cmm.web; | ||
|
||
import java.beans.PropertyEditorSupport; | ||
import java.net.URLEncoder; | ||
import java.nio.charset.StandardCharsets; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
class EgovCipherIdPropertyEditor extends PropertyEditorSupport { | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovCipherIdPropertyEditor.class); | ||
|
||
public void setAsText(String text) throws IllegalArgumentException { | ||
LOGGER.debug("===>>> setText : "+text); | ||
String decryptText = ""; | ||
if (text != null && !"".equals(text) ) { | ||
try { | ||
String encText = URLEncoder.encode(text, StandardCharsets.UTF_8.name()); | ||
decryptText = EgovComUtlController.decryptId(encText); | ||
} catch (Exception e) { | ||
LOGGER.debug(e.getMessage()); | ||
decryptText = "CIPHER_ID_DECRIPT_EXCEPTION_01"; | ||
} | ||
} | ||
this.setValue(decryptText); | ||
|
||
} | ||
|
||
|
||
public String getAsText() { | ||
LOGGER.debug("===>>> getText : "+getValue()); | ||
return String.valueOf(getValue()); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.