Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
8313eb8
Merge remote-tracking branch 'upstream/main'
nickpeihl Mar 5, 2026
b44c576
Make dashboard endpoints public with elastic-api-version 2023-10-31
nickpeihl Mar 5, 2026
b485fd1
Merge branch 'main' into public-dashboard-api-endpoints
nreese Mar 24, 2026
80ef408
Merge branch 'main' into public-dashboard-api-endpoints
nreese Mar 26, 2026
ee94ac2
Merge branch 'main' into public-dashboard-api-endpoints
nreese Mar 31, 2026
b713965
Merge remote-tracking branch 'upstream/main' into public-dashboard-ap…
nickpeihl Apr 2, 2026
83f76b5
Update tests to use public elastic-api-version header
nickpeihl Apr 2, 2026
1e80b1d
Remove `apiVersion` fallback for export json flyout link to dev tools
nickpeihl Apr 2, 2026
321c4c3
Merge branch 'main' into public-dashboard-api-endpoints
nickpeihl Apr 3, 2026
90abbf1
Merge branch 'main' into public-dashboard-api-endpoints
nreese Apr 3, 2026
60ae752
Merge branch 'main' into public-dashboard-api-endpoints
nickpeihl Apr 6, 2026
98e4f66
Merge branch 'main' into public-dashboard-api-endpoints
nickpeihl Apr 7, 2026
8636975
Changes from node scripts/eslint_all_files --no-cache --fix
kibanamachine Apr 7, 2026
4c55171
Merge branch 'main' into public-dashboard-api-endpoints
nickpeihl Apr 7, 2026
03c2316
enable public lens api access
nickofthyme Apr 7, 2026
b24967d
Merge branch 'main' into public-dashboard-api-endpoints
nickpeihl Apr 7, 2026
9c7df6c
Merge branch 'main' into public-dashboard-api-endpoints
nickpeihl Apr 7, 2026
f1879f7
Merge branch 'main' into public-dashboard-api-endpoints
nickpeihl Apr 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/platform/plugins/shared/dashboard/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ import { DASHBOARD_GRID_COLUMN_COUNT } from './page_bundle_constants';

/** The base API path for public dashboard endpoints. */
export const DASHBOARD_API_PATH = '/api/dashboards';
export const DASHBOARD_API_VERSION = '1';
export const DASHBOARD_API_VERSION = '2023-10-31';

/** The base API path for internal dashboard endpoints. */
export const DASHBOARD_INTERNAL_API_PATH = '/internal/dashboards';
export const DASHBOARD_APP_API_PATH = `${DASHBOARD_INTERNAL_API_PATH}/app`;
export const DASHBOARD_APP_API_VERSION = '1';

export const DASHBOARD_SAVED_OBJECT_TYPE = 'dashboard';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
DASHBOARD_API_PATH,
DASHBOARD_API_VERSION,
DASHBOARD_APP_API_PATH,
DASHBOARD_APP_API_VERSION,
DASHBOARD_SAVED_OBJECT_TYPE,
} from '../../common/constants';
import type {
Expand Down Expand Up @@ -53,7 +54,7 @@ export const dashboardClient = {
accessMode?: SavedObjectAccessControl['accessMode']
) => {
return coreServices.http.post<DashboardCreateResponseBody>(DASHBOARD_APP_API_PATH, {
version: DASHBOARD_API_VERSION,
version: DASHBOARD_APP_API_VERSION,
body: JSON.stringify({
...dashboardState,
...(accessMode && { access_control: { access_mode: accessMode } }),
Expand All @@ -73,7 +74,7 @@ export const dashboardClient = {

const { body, response } = await coreServices.http
.get<DashboardReadResponseBody>(buildDashboardAppPath(id), {
version: DASHBOARD_API_VERSION,
version: DASHBOARD_APP_API_VERSION,
asResponse: true,
})
.catch((e) => {
Expand Down Expand Up @@ -116,7 +117,7 @@ export const dashboardClient = {
const updateResponse = await coreServices.http.put<DashboardUpdateResponseBody>(
buildDashboardAppPath(id),
{
version: DASHBOARD_API_VERSION,
version: DASHBOARD_APP_API_VERSION,
body: JSON.stringify(dashboardState),
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { DASHBOARD_API_PATH, DASHBOARD_API_VERSION } from '../../common/constants';
import { DASHBOARD_API_PATH } from '../../common/constants';

const DEFAULT_FILENAME_BASE = 'export';

Expand Down Expand Up @@ -41,11 +41,5 @@ export function buildExportJsonFilename(filenameBase: string, fileExtension: str
* The console will open with the HTTP verb + kbn: path, followed by a JSON body.
*/
export function buildCreateDashboardRequestForConsole(jsonBody: string): string {
// TODO remove these conditionals once the dashboard endpoints are public
// adds the `apiVersion` query parameter to the dashboard API path for internal requests
const dashboardApiPath =
DASHBOARD_API_VERSION === '1'
? `${DASHBOARD_API_PATH}?apiVersion=${DASHBOARD_API_VERSION}`
: DASHBOARD_API_PATH;
return `POST kbn:${dashboardApiPath}\n${jsonBody}`;
return `POST kbn:${DASHBOARD_API_PATH}\n${jsonBody}`;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { DASHBOARD_API_PATH, DASHBOARD_APP_API_PATH } from '../../common/constants';
import {
DASHBOARD_API_PATH,
DASHBOARD_API_VERSION,
DASHBOARD_APP_API_PATH,
DASHBOARD_APP_API_VERSION,
} from '../../common/constants';

export function getRouteConfig(isDashboardAppRequest: boolean) {
return isDashboardAppRequest
Expand All @@ -27,26 +32,19 @@ export function getRouteConfig(isDashboardAppRequest: boolean) {
},
},
} as const,
routeVersion: '1',
routeVersion: DASHBOARD_APP_API_VERSION,
}
: {
basePath: DASHBOARD_API_PATH,
routeConfig: {
// TODO change to public before FF
access: 'internal',
/**
* `enableQueryVersion` is a temporary solution for testing internal endpoints.
* Requests to these internal endpoints from Kibana Dev Tools or external clients
* should include the ?apiVersion=1 query parameter.
* This will be removed when the API is finalized and moved to a stable version.
*/
enableQueryVersion: true,
access: 'public',
description:
'This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.',
options: {
tags: ['oas-tag:Dashboards'],
availability: {
stability: 'experimental',
since: '9.4.0',
},
},
security: {
Expand All @@ -56,7 +54,6 @@ export function getRouteConfig(isDashboardAppRequest: boolean) {
},
},
} as const,
// TODO change to '2023-10-31' before FF
routeVersion: '1',
routeVersion: DASHBOARD_API_VERSION,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@

/** The base API path for dashboard endpoints (no leading slash for apiClient). */
export const DASHBOARD_API_PATH = 'api/dashboards';
export const DASHBOARD_API_VERSION = '2023-10-31';

/** Common headers for Dashboard API requests (internal API version 1) */
export const COMMON_HEADERS = {
'kbn-xsrf': 'some-xsrf-token',
'x-elastic-internal-origin': 'kibana',
'elastic-api-version': '1',
'elastic-api-version': DASHBOARD_API_VERSION,
} as const;

/** Test data paths */
Expand Down
4 changes: 2 additions & 2 deletions x-pack/platform/plugins/shared/lens/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export const LENS_EDIT_BY_VALUE = 'edit_by_value';
export const LENS_ICON = 'lensApp';
export const STAGE_ID = 'production';

export const LENS_API_VERSION = '1'; // TODO repalce with '2023-10-31' before 9.4 FF
export const LENS_API_ACCESS: RouteAccess = 'internal'; // TODO replace with 'public' before 9.4 FF
export const LENS_API_VERSION = '2023-10-31';
export const LENS_API_ACCESS: RouteAccess = 'public';
export const LENS_INTERNAL_API_VERSION = '1';
/**
* In the OpenAPISpec this represents the endpoint group name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export const registerLensVisualizationsCreateAPIRoute: RegisterAPIRouteFn = (
const createRoute = router.post({
path: LENS_VIS_API_PATH,
access: LENS_API_ACCESS,
enableQueryVersion: true,
summary: 'Create visualization',
description: 'Create a new visualization.',
options: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ export const registerLensVisualizationsDeleteAPIRoute: RegisterAPIRouteFn = (
) => {
const deleteRoute = router.delete({
path: `${LENS_VIS_API_PATH}/{id}`,
access: LENS_API_ACCESS, // to go public in 9.4
enableQueryVersion: true,
access: LENS_API_ACCESS,
summary: 'Delete visualization',
description: 'Delete a visualization by id.',
options: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export const registerLensVisualizationsGetAPIRoute: RegisterAPIRouteFn = (
const getRoute = router.get({
path: `${LENS_VIS_API_PATH}/{id}`,
access: LENS_API_ACCESS,
enableQueryVersion: true,
summary: 'Get visualization',
description: 'Get a visualization from id.',
options: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export const registerLensVisualizationsSearchAPIRoute: RegisterAPIRouteFn = (
const searchRoute = router.get({
path: LENS_VIS_API_PATH,
access: LENS_API_ACCESS,
enableQueryVersion: true,
summary: 'Search visualizations',
description: 'Get list of visualizations.',
options: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export const registerLensVisualizationsUpdateAPIRoute: RegisterAPIRouteFn = (
const updateRoute = router.put({
path: `${LENS_VIS_API_PATH}/{id}`,
access: LENS_API_ACCESS,
enableQueryVersion: true,
summary: 'Create or update visualization',
description:
'Create or update a visualization with the given id. When no visualization exists for the id, one is created.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function ({ getService }: FtrProviderContext) {
const { body, status } = await supertest
.post(DASHBOARD_API_PATH)
.set('kbn-xsrf', 'true')
.set('elastic-api-version', '1')
.set('elastic-api-version', '2023-10-31')
.send({
title: 'Sample dashboard',
});
Expand Down Expand Up @@ -48,7 +48,7 @@ export default function ({ getService }: FtrProviderContext) {
.post(DASHBOARD_API_PATH)
.set(interactiveUser.headers)
.set('kbn-xsrf', 'true')
.set('elastic-api-version', '1')
.set('elastic-api-version', '2023-10-31')
.send({
title: 'Sample dashboard',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function ({ getService }: FtrProviderContext) {
const createResponse = await supertest
.post(DASHBOARD_API_PATH)
.set('kbn-xsrf', 'true')
.set('elastic-api-version', '1')
.set('elastic-api-version', '2023-10-31')
.send({
title: 'Sample dashboard',
});
Expand All @@ -31,7 +31,7 @@ export default function ({ getService }: FtrProviderContext) {
const updateResponse = await supertest
.put(`${DASHBOARD_API_PATH}/${createResponse.body.id}`)
.set('kbn-xsrf', 'true')
.set('elastic-api-version', '1')
.set('elastic-api-version', '2023-10-31')
.send({
title: 'updated title',
});
Expand All @@ -58,7 +58,7 @@ export default function ({ getService }: FtrProviderContext) {
.post(DASHBOARD_API_PATH)
.set(interactiveUser.headers)
.set('kbn-xsrf', 'true')
.set('elastic-api-version', '1')
.set('elastic-api-version', '2023-10-31')
.send({
title: 'Sample dashboard',
});
Expand All @@ -79,7 +79,7 @@ export default function ({ getService }: FtrProviderContext) {
const updateResponse = await supertestWithAuth
.put(`${DASHBOARD_API_PATH}/${createResponse.body.id}`)
.set('kbn-xsrf', 'true')
.set('elastic-api-version', '1')
.set('elastic-api-version', '2023-10-31')
.send({
title: 'updated title',
});
Expand All @@ -89,7 +89,7 @@ export default function ({ getService }: FtrProviderContext) {
const getResponse = await supertestWithAuth
.get(`${DASHBOARD_API_PATH}/${createResponse.body.id}`)
.set('kbn-xsrf', 'true')
.set('elastic-api-version', '1')
.set('elastic-api-version', '2023-10-31')
.send();

expect(getResponse.status).to.be(200);
Expand All @@ -114,7 +114,7 @@ export default function ({ getService }: FtrProviderContext) {
.put(`${DASHBOARD_API_PATH}/${createResponse.body.id}`)
.set(interactiveUser2.headers)
.set('kbn-xsrf', 'true')
.set('elastic-api-version', '1')
.set('elastic-api-version', '2023-10-31')
.send({
title: 'updated title',
});
Expand All @@ -124,7 +124,7 @@ export default function ({ getService }: FtrProviderContext) {
const getResponse = await supertestWithAuth
.get(`${DASHBOARD_API_PATH}/${createResponse.body.id}`)
.set('kbn-xsrf', 'true')
.set('elastic-api-version', '1')
.set('elastic-api-version', '2023-10-31')
.send();

expect(getResponse.status).to.be(200);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function ({ getService }: FtrProviderContext) {
.post(`/s/${ATestSpace}${DASHBOARD_API_PATH}`)
.set('kbn-xsrf', 'xxx')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.set('elastic-api-version', '1')
.set('elastic-api-version', '2023-10-31')
.send({
title: 'Sample dashboard',
});
Expand All @@ -70,7 +70,7 @@ export default function ({ getService }: FtrProviderContext) {
.post(`/s/${ATestSpace}${DASHBOARD_API_PATH}`)
.set('kbn-xsrf', 'xxx')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.set('elastic-api-version', '1')
.set('elastic-api-version', '2023-10-31')
.send({
title: 'Sample dashboard',
});
Expand Down Expand Up @@ -99,7 +99,7 @@ export default function ({ getService }: FtrProviderContext) {
.post(`/s/${BTestSpace}${DASHBOARD_API_PATH}`)
.set('kbn-xsrf', 'xxx')
.set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana')
.set('elastic-api-version', '1')
.set('elastic-api-version', '2023-10-31')
.send({
title: 'Sample dashboard',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export const SLO_ERROR_BUDGET_ID = 'slo_error_budget';
export const SLO_BURN_RATE_EMBEDDABLE_ID = 'slo_burn_rate';
export const SLO_ALERTS_EMBEDDABLE_ID = 'slo_alerts';

/** Common headers for Dashboard API requests (internal API version 1) */
/** Common headers for Dashboard API requests */
export const COMMON_HEADERS = {
'kbn-xsrf': 'some-xsrf-token',
'x-elastic-internal-origin': 'kibana',
'elastic-api-version': '1',
'elastic-api-version': '2023-10-31',
} as const;
Loading