diff --git a/src/main/java/com/palnet/comn/collection/AuthCollection.java b/src/main/java/com/palnet/comn/collection/AuthCollection.java index 492719d..83864fa 100644 --- a/src/main/java/com/palnet/comn/collection/AuthCollection.java +++ b/src/main/java/com/palnet/comn/collection/AuthCollection.java @@ -1,16 +1,17 @@ package com.palnet.comn.collection; +import lombok.extern.slf4j.Slf4j; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.ArrayList; -import java.util.List; +import java.util.*; +@Slf4j public class AuthCollection { private Logger logger = LoggerFactory.getLogger(getClass()); - private static List authkeyList = new ArrayList(); + private static Set authkeyList = new HashSet<>() {}; public void reloadAuthkey() { // 인증키 하드코딩 처리 @@ -22,11 +23,13 @@ public class AuthCollection { public boolean checkAuthkey(String authKey) { boolean result = false; -// logger.debug("authKey ::: " + authKey); - - for(String key : authkeyList) { -// logger.debug("key ::: " + key); - if(authKey.equals(key)) { + +// Iterator keys = authkeyList.iterator(); + + for (Iterator iterator = authkeyList.iterator(); iterator.hasNext();) { + String item = iterator.next(); + + if(authKey.equals(item)) { result = true; } }