use of io.gravitee.gateway.policy.StreamType in project gravitee-gateway by gravitee-io.
the class ApiPolicyChainResolver method calculate.
@Override
protected List<Policy> calculate(StreamType streamType, Request request, Response response, ExecutionContext executionContext) {
// Resolve the "configured" path according to the inbound request
Path path = pathResolver.resolve(request.path());
executionContext.setAttribute(ExecutionContext.ATTR_RESOLVED_PATH, path.getResolvedPath());
return path.getRules().stream().filter(rule -> rule.isEnabled() && rule.getMethods().contains(request.method())).map(rule -> create(streamType, rule.getPolicy().getName(), rule.getPolicy().getConfiguration())).filter(Objects::nonNull).collect(Collectors.toList());
}
Aggregations