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