update: remove white list
This commit is contained in:
@@ -109,6 +109,9 @@ public class ApiConfigService {
|
|||||||
@Autowired(required = false)
|
@Autowired(required = false)
|
||||||
private CustomAuth customAuth;
|
private CustomAuth customAuth;
|
||||||
|
|
||||||
|
@Value("${openServiceWhiteList:false}")
|
||||||
|
private boolean openServiceWhiteList = false;
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() throws Throwable {
|
public void init() throws Throwable {
|
||||||
|
|
||||||
@@ -262,8 +265,10 @@ public class ApiConfigService {
|
|||||||
private Mono<Object> canAccess(ServerWebExchange exchange, String app, String ip, String timestamp, String sign, String secretKey,
|
private Mono<Object> canAccess(ServerWebExchange exchange, String app, String ip, String timestamp, String sign, String secretKey,
|
||||||
String service, HttpMethod method, String path) {
|
String service, HttpMethod method, String path) {
|
||||||
|
|
||||||
if (!whiteListSet.contains(service)) { // TODO XXX
|
if (openServiceWhiteList) {
|
||||||
return Mono.just(Access.SERVICE_NOT_OPEN);
|
if (!whiteListSet.contains(service)) { // TODO XXX
|
||||||
|
return Mono.just(Access.SERVICE_NOT_OPEN);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ServiceConfig sc = serviceConfigMap.get(service);
|
ServiceConfig sc = serviceConfigMap.get(service);
|
||||||
if (sc == null) {
|
if (sc == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user