minor fixes
This commit is contained in:
parent
79ba8313f7
commit
4f27a39b68
2 changed files with 8 additions and 6 deletions
|
@ -64,12 +64,14 @@ public class GraphsController extends AbstractController implements GraphsApi {
|
||||||
@Override
|
@Override
|
||||||
public Mono<ResponseEntity<GraphDescriptionsDTO>> getGraphsList(String clusterName,
|
public Mono<ResponseEntity<GraphDescriptionsDTO>> getGraphsList(String clusterName,
|
||||||
ServerWebExchange exchange) {
|
ServerWebExchange exchange) {
|
||||||
|
var context = AccessContext.builder()
|
||||||
|
.cluster(clusterName)
|
||||||
|
.operationName("getGraphsList")
|
||||||
|
.build();
|
||||||
|
|
||||||
var graphs = graphsService.getGraphs(getCluster(clusterName));
|
var graphs = graphsService.getGraphs(getCluster(clusterName));
|
||||||
return Mono.just(
|
return accessControlService.validateAccess(context).then(
|
||||||
ResponseEntity.ok(
|
Mono.just(ResponseEntity.ok(new GraphDescriptionsDTO().graphs(graphs.map(this::map).toList()))));
|
||||||
new GraphDescriptionsDTO().graphs(graphs.map(this::map).toList())
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private GraphDescriptionDTO map(GraphDescription graph) {
|
private GraphDescriptionDTO map(GraphDescription graph) {
|
||||||
|
|
|
@ -42,7 +42,7 @@ public interface MetricsSink {
|
||||||
return compoundSink(sinks);
|
return compoundSink(sinks);
|
||||||
}
|
}
|
||||||
|
|
||||||
static MetricsSink compoundSink(List<MetricsSink> sinks) {
|
private static MetricsSink compoundSink(List<MetricsSink> sinks) {
|
||||||
return metricsStream -> {
|
return metricsStream -> {
|
||||||
var materialized = metricsStream.toList();
|
var materialized = metricsStream.toList();
|
||||||
return Flux.fromIterable(sinks)
|
return Flux.fromIterable(sinks)
|
||||||
|
|
Loading…
Add table
Reference in a new issue