Skip to content

Commit

Permalink
Don't set default auth metadata provider
Browse files Browse the repository at this point in the history
  • Loading branch information
dingshuangxi888 committed Mar 22, 2024
1 parent f8f9b88 commit e3523db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ private static <V> V computeIfAbsent(String key, Function<String, ? extends V> f
}
if (result == null) {
result = function.apply(key);
INSTANCE_MAP.put(key, result);
if (result != null) {
INSTANCE_MAP.put(key, result);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import com.google.protobuf.GeneratedMessageV3;
import io.grpc.Metadata;
import io.netty.channel.ChannelHandlerContext;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.Map;
import java.util.function.Function;
import java.util.function.Supplier;
import org.apache.commons.lang3.StringUtils;
Expand All @@ -39,7 +39,7 @@

public class AuthorizationFactory {

private static final ConcurrentMap<String, Object> INSTANCE_MAP = new ConcurrentHashMap<>();
private static final Map<String, Object> INSTANCE_MAP = new HashMap<>();
private static final String PROVIDER_PREFIX = "PROVIDER_";
private static final String METADATA_PROVIDER_PREFIX = "METADATA_PROVIDER_";
private static final String EVALUATOR_PREFIX = "EVALUATOR_";
Expand Down Expand Up @@ -145,7 +145,9 @@ private static <V> V computeIfAbsent(String key, Function<String, ? extends V> f
}
if (result == null) {
result = function.apply(key);
INSTANCE_MAP.put(key, result);
if (result != null) {
INSTANCE_MAP.put(key, result);
}
}
}
}
Expand Down

0 comments on commit e3523db

Please sign in to comment.