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); Response frontendMetrics(JsonObject body, @Context HttpHeaders headers, @Context UriInfo requestUriInfo);
@POST @POST
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON)
@Path("/user/auth-tokens/rotate") @Path("/user/auth-tokens/rotate")
@ApiOperation( @ApiOperation(
produces = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON,
httpMethod = "POST", httpMethod = "POST",
value = "Rotate authentication tokens", value = "Rotate authentication tokens",
tags = "Analytics", tags = "Analytics",
extensions = { extensions = {
@Extension(properties = { @Extension(properties = {
@ExtensionProperty(name = SCOPE, value = "grafana:api:view") @ExtensionProperty(name = SCOPE, value = "grafana:api:view")
}) })
} }
) )
Response rotateAuthToken(JsonObject body, @Context HttpHeaders headers, @Context UriInfo requestUriInfo); Response rotateAuthToken(JsonObject body, @Context HttpHeaders headers, @Context UriInfo requestUriInfo);
@GET @GET

@ -124,7 +124,7 @@ public class GrafanaRequestHandlerUtil {
public static GrafanaPanelIdentifier getPanelIdentifier(HttpHeaders headers) throws RefererNotValid, GrafanaManagementException { public static GrafanaPanelIdentifier getPanelIdentifier(HttpHeaders headers) throws RefererNotValid, GrafanaManagementException {
String referer = headers.getHeaderString(GrafanaConstants.REFERER_HEADER); String referer = headers.getHeaderString(GrafanaConstants.REFERER_HEADER);
if(referer == null) { if (referer == null) {
String errMsg = "Request does not contain Referer header"; String errMsg = "Request does not contain Referer header";
log.error(errMsg); log.error(errMsg);
throw new RefererNotValid(errMsg); throw new RefererNotValid(errMsg);
@ -139,8 +139,8 @@ public class GrafanaRequestHandlerUtil {
} }
boolean dashboardIntegrationConfig = configuration.getValidationConfig().getDashboardIntegration(); boolean dashboardIntegrationConfig = configuration.getValidationConfig().getDashboardIntegration();
GrafanaPanelIdentifier panelIdentifier = GrafanaUtil.getPanelIdentifierFromReferer(referer); GrafanaPanelIdentifier panelIdentifier = GrafanaUtil.getPanelIdentifierFromReferer(referer);
if(!dashboardIntegrationConfig) { if (!dashboardIntegrationConfig) {
if(panelIdentifier.getDashboardId() == null || if (panelIdentifier.getDashboardId() == null ||
panelIdentifier.getPanelId() == null || panelIdentifier.getOrgId() == null) { panelIdentifier.getPanelId() == null || panelIdentifier.getOrgId() == null) {
String errMsg = "Referer must contain dashboardId, panelId, and orgId"; String errMsg = "Referer must contain dashboardId, panelId, and orgId";
log.error(errMsg); 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, * Entgra (Pvt) Ltd. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * 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.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name="ValidationConfig") @XmlRootElement(name = "ValidationConfig")
public class ValidationConfig { public class ValidationConfig {
private boolean dsQueryValidation; private boolean dsQueryValidation;
private boolean dashboardIntegration; private boolean dashboardIntegration;

Loading…
Cancel
Save