Browse Source

auth key 중복 체크

master
노승철 2 years ago
parent
commit
51f7ea0c5e
  1. 19
      src/main/java/com/palnet/comn/collection/AuthCollection.java

19
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<String> authkeyList = new ArrayList<String>();
private static Set<String> 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<String> keys = authkeyList.iterator();
for (Iterator<String> iterator = authkeyList.iterator(); iterator.hasNext();) {
String item = iterator.next();
if(authKey.equals(item)) {
result = true;
}
}

Loading…
Cancel
Save