use of com.mendmix.gateway.model.BizSystemModule in project jeesuite-libs by vakinge.
the class GatewayReactiveCustomAuthnHandler method customAuthentication.
@Override
public boolean customAuthentication(ServerWebExchange exchange) {
BizSystemModule module = RuequestHelper.getCurrentModule(exchange);
ServerHttpRequest request = exchange.getRequest();
if (module.getAnonUriMatcher() != null && module.getAnonUriMatcher().match(request.getPath().value())) {
return true;
}
boolean pass = request.getHeaders().containsKey(GatewayConstants.X_SIGN_HEADER);
if (!pass) {
pass = isIpWhilelistAccess(request);
}
if (!pass) {
pass = isInternalTrustedAccess(request);
}
if (!pass) {
pass = isCrossClusterTrustedAccess(request);
}
return pass;
}
use of com.mendmix.gateway.model.BizSystemModule in project jeesuite-libs by vakinge.
the class GatewaySecurityDecisionProvider method getAllApiPermissions.
@Override
public List<ApiPermission> getAllApiPermissions() {
Collection<BizSystemModule> modules = CurrentSystemHolder.getModules();
List<ApiPermission> result = new ArrayList<>();
Collection<ApiInfo> apis;
ApiPermission apiPermission;
for (BizSystemModule module : modules) {
if (module.getApiInfos() == null)
continue;
apis = module.getApiInfos().values();
for (ApiInfo apiInfo : apis) {
apiPermission = new ApiPermission();
apiPermission.setGrantType(apiInfo.getPermissionType().name());
apiPermission.setHttpMethod(apiInfo.getMethod());
apiPermission.setUri(apiInfo.getUrl());
result.add(apiPermission);
}
}
return result;
}
Aggregations