Fix formatting issues

pull/396/head
Sasini Sandamali 6 months ago
parent 4606ec9cd8
commit 3474c50901

@ -108,20 +108,20 @@ public interface GrafanaAPIProxyService {
Response frontendMetrics(JsonObject body, @Context HttpHeaders headers, @Context UriInfo requestUriInfo);
@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/user/auth-tokens/rotate")
@ApiOperation(
produces = MediaType.APPLICATION_JSON,
httpMethod = "POST",
value = "Rotate authentication tokens",
tags = "Analytics",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = SCOPE, value = "grafana:api:view")
})
}
)
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/user/auth-tokens/rotate")
@ApiOperation(
produces = MediaType.APPLICATION_JSON,
httpMethod = "POST",
value = "Rotate authentication tokens",
tags = "Analytics",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = SCOPE, value = "grafana:api:view")
})
}
)
Response rotateAuthToken(JsonObject body, @Context HttpHeaders headers, @Context UriInfo requestUriInfo);
@GET

@ -124,7 +124,7 @@ public class GrafanaRequestHandlerUtil {
public static GrafanaPanelIdentifier getPanelIdentifier(HttpHeaders headers) throws RefererNotValid, GrafanaManagementException {
String referer = headers.getHeaderString(GrafanaConstants.REFERER_HEADER);
if(referer == null) {
if (referer == null) {
String errMsg = "Request does not contain Referer header";
log.error(errMsg);
throw new RefererNotValid(errMsg);
@ -139,8 +139,8 @@ public class GrafanaRequestHandlerUtil {
}
boolean dashboardIntegrationConfig = configuration.getValidationConfig().getDashboardIntegration();
GrafanaPanelIdentifier panelIdentifier = GrafanaUtil.getPanelIdentifierFromReferer(referer);
if(!dashboardIntegrationConfig) {
if(panelIdentifier.getDashboardId() == null ||
if (!dashboardIntegrationConfig) {
if (panelIdentifier.getDashboardId() == null ||
panelIdentifier.getPanelId() == null || panelIdentifier.getOrgId() == null) {
String errMsg = "Referer must contain dashboardId, panelId, and orgId";
log.error(errMsg);

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
* Copyright (c) 2018 - 2024, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved.
*
* Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
@ -20,7 +20,7 @@ package io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.config.xml.be
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name="ValidationConfig")
@XmlRootElement(name = "ValidationConfig")
public class ValidationConfig {
private boolean dsQueryValidation;
private boolean dashboardIntegration;

Loading…
Cancel
Save