|
|
@ -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);
|
|
|
|