diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/GrafanaAPIProxyService.java b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/GrafanaAPIProxyService.java index 2ba5cdd830..5bdf335d30 100644 --- a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/GrafanaAPIProxyService.java +++ b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/GrafanaAPIProxyService.java @@ -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 diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/impl/util/GrafanaRequestHandlerUtil.java b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/impl/util/GrafanaRequestHandlerUtil.java index a40b402145..6f9f9f066d 100644 --- a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/impl/util/GrafanaRequestHandlerUtil.java +++ b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/impl/util/GrafanaRequestHandlerUtil.java @@ -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); diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/core/config/xml/bean/ValidationConfig.java b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/core/config/xml/bean/ValidationConfig.java index f6f09a8b40..b15955bbe2 100644 --- a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/core/config/xml/bean/ValidationConfig.java +++ b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/core/config/xml/bean/ValidationConfig.java @@ -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;