Skip to content

Commit 366f7d9

Browse files
committed
Disallow grafana plugin on the cse
1 parent 2e9550d commit 366f7d9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/backend/rest.ts

+7
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ export default class RestApiBackend implements Backend {
199199
'The data source specified the Checkmk Raw Edition, but a Checkmk commercial edition was detected. Some functionality may not be available. Choose commercial editions in the data source settings to enable all features.'
200200
);
201201
}
202+
if (result.data.edition === 'cse') {
203+
throw new Error('Detected Checkmk Cloud (SaaS). Can not query data from Checkmk Cloud (SaaS).');
204+
}
202205
// The REST API would be ok with other users, but the autocompleter are not
203206
if (!(await this.isAutomationUser(this.datasource.getUsername()))) {
204207
throw new Error('This data source must authenticate against Checkmk using an automation user.');
@@ -255,6 +258,10 @@ export default class RestApiBackend implements Backend {
255258

256259
// check for cloud edition header
257260
const checkmkEdition = result.headers.get('X-Checkmk-Edition');
261+
// CSE is never supported
262+
if (checkmkEdition === 'cse') {
263+
throw new Error('Cannot query data from Checkmk Cloud (SaaS).');
264+
}
258265
const allowedEditions = new Set(['cce', 'cme']);
259266
if (process.env.BUILD_EDITION === 'CLOUD' && !allowedEditions.has(checkmkEdition || '')) {
260267
throw new Error(

0 commit comments

Comments
 (0)