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