+
-
+
{
))}
-
+
);
diff --git a/packages/core/http/core-http-router-server-internal/src/request.ts b/packages/core/http/core-http-router-server-internal/src/request.ts
index aa134c21ae95a..8c31635feb8c2 100644
--- a/packages/core/http/core-http-router-server-internal/src/request.ts
+++ b/packages/core/http/core-http-router-server-internal/src/request.ts
@@ -223,11 +223,10 @@ export class CoreKibanaRequest<
options,
};
}
- /** infer route access from path if not declared */
+ /** set route access to internal if not declared */
private getAccess(request: RawRequest): 'internal' | 'public' {
return (
- ((request.route?.settings as RouteOptions)?.app as KibanaRouteOptions)?.access ??
- (request.path.startsWith('/internal') ? 'internal' : 'public')
+ ((request.route?.settings as RouteOptions)?.app as KibanaRouteOptions)?.access ?? 'internal'
);
}
diff --git a/packages/core/http/core-http-router-server-mocks/src/router.mock.ts b/packages/core/http/core-http-router-server-mocks/src/router.mock.ts
index e82a51a14a332..4272cf130b38e 100644
--- a/packages/core/http/core-http-router-server-mocks/src/router.mock.ts
+++ b/packages/core/http/core-http-router-server-mocks/src/router.mock.ts
@@ -73,7 +73,7 @@ function createKibanaRequestMock({
routeTags,
routeAuthRequired,
validation = {},
- kibanaRouteOptions = { xsrfRequired: true, access: 'public' },
+ kibanaRouteOptions = { xsrfRequired: true, access: 'internal' },
kibanaRequestState = {
requestId: '123',
requestUuid: '123e4567-e89b-12d3-a456-426614174000',
diff --git a/packages/core/http/core-http-server-internal/src/http_server.test.ts b/packages/core/http/core-http-server-internal/src/http_server.test.ts
index 886349e0ea940..675d7e4fffcef 100644
--- a/packages/core/http/core-http-server-internal/src/http_server.test.ts
+++ b/packages/core/http/core-http-server-internal/src/http_server.test.ts
@@ -836,12 +836,12 @@ test('allows declaring route access to flag a route as public or internal', asyn
registerRouter(router);
await server.start();
- await supertest(innerServer.listener).get('/with-access').expect(200, { access });
+ await supertest(innerServer.listener).get('/with-access').expect(200, { access: 'internal' });
- await supertest(innerServer.listener).get('/without-access').expect(200, { access: 'public' });
+ await supertest(innerServer.listener).get('/without-access').expect(200, { access: 'internal' });
});
-test('infers access flag from path if not defined', async () => {
+test(`sets access flag to 'internal' if not defined`, async () => {
const { registerRouter, server: innerServer } = await server.setup(config);
const router = new Router('', logger, enhanceWithContext, routerOptions);
@@ -863,13 +863,13 @@ test('infers access flag from path if not defined', async () => {
await server.start();
await supertest(innerServer.listener).get('/internal/foo').expect(200, { access: 'internal' });
- await supertest(innerServer.listener).get('/random/foo').expect(200, { access: 'public' });
+ await supertest(innerServer.listener).get('/random/foo').expect(200, { access: 'internal' });
await supertest(innerServer.listener)
.get('/random/internal/foo')
- .expect(200, { access: 'public' });
+ .expect(200, { access: 'internal' });
await supertest(innerServer.listener)
.get('/api/foo/internal/my-foo')
- .expect(200, { access: 'public' });
+ .expect(200, { access: 'internal' });
});
test('exposes route details of incoming request to a route handler', async () => {
@@ -888,7 +888,7 @@ test('exposes route details of incoming request to a route handler', async () =>
options: {
authRequired: true,
xsrfRequired: false,
- access: 'public',
+ access: 'internal',
tags: [],
timeout: {},
},
@@ -1066,7 +1066,7 @@ test('exposes route details of incoming request to a route handler (POST + paylo
options: {
authRequired: true,
xsrfRequired: true,
- access: 'public',
+ access: 'internal',
tags: [],
timeout: {
payload: 10000,
diff --git a/packages/core/http/core-http-server-internal/src/http_server.ts b/packages/core/http/core-http-server-internal/src/http_server.ts
index 747c477d1b41d..3ed8a73a38641 100644
--- a/packages/core/http/core-http-server-internal/src/http_server.ts
+++ b/packages/core/http/core-http-server-internal/src/http_server.ts
@@ -606,7 +606,7 @@ export class HttpServer {
const kibanaRouteOptions: KibanaRouteOptions = {
xsrfRequired: route.options.xsrfRequired ?? !isSafeMethod(route.method),
- access: route.options.access ?? (route.path.startsWith('/internal') ? 'internal' : 'public'),
+ access: route.options.access ?? 'internal',
};
// Log HTTP API target consumer.
optionsLogger.debug(
diff --git a/packages/core/http/core-http-server-internal/src/lifecycle_handlers.test.ts b/packages/core/http/core-http-server-internal/src/lifecycle_handlers.test.ts
index b58fd1b299b06..9e1d0191d0f5e 100644
--- a/packages/core/http/core-http-server-internal/src/lifecycle_handlers.test.ts
+++ b/packages/core/http/core-http-server-internal/src/lifecycle_handlers.test.ts
@@ -174,7 +174,7 @@ describe('xsrf post-auth handler', () => {
path: '/some-path',
kibanaRouteOptions: {
xsrfRequired: false,
- access: 'public',
+ access: 'internal',
},
});
diff --git a/packages/core/http/core-http-server/src/router/route.ts b/packages/core/http/core-http-server/src/router/route.ts
index e2b11aec08e1a..349ad2e392453 100644
--- a/packages/core/http/core-http-server/src/router/route.ts
+++ b/packages/core/http/core-http-server/src/router/route.ts
@@ -126,9 +126,7 @@ export interface RouteConfigOptions {
* In the future, may require an incomming request to contain a specified header.
* - internal. The route is internal and intended for internal access only.
*
- * If not declared, infers access from route path:
- * - access =`internal` for '/internal' route path prefix
- * - access = `public` for everything else
+ * Defaults to 'internal' If not declared,
*/
access?: 'public' | 'internal';
diff --git a/packages/core/rendering/core-rendering-server-internal/src/views/template.tsx b/packages/core/rendering/core-rendering-server-internal/src/views/template.tsx
index bbc8109e403da..bac48c88e1b23 100644
--- a/packages/core/rendering/core-rendering-server-internal/src/views/template.tsx
+++ b/packages/core/rendering/core-rendering-server-internal/src/views/template.tsx
@@ -54,8 +54,8 @@ export const Template: FunctionComponent = ({
{/* Inject EUI reset and global styles before all other component styles */}
-
+
{/* Inject stylesheets into the before scripts so that KP plugins with bundled styles will override them */}
diff --git a/packages/kbn-check-mappings-update-cli/current_mappings.json b/packages/kbn-check-mappings-update-cli/current_mappings.json
index 689606cd5f19f..cb78e060d6edc 100644
--- a/packages/kbn-check-mappings-update-cli/current_mappings.json
+++ b/packages/kbn-check-mappings-update-cli/current_mappings.json
@@ -616,6 +616,30 @@
}
}
},
+ "tag": {
+ "properties": {
+ "name": {
+ "type": "text"
+ },
+ "description": {
+ "type": "text"
+ },
+ "color": {
+ "type": "text"
+ }
+ }
+ },
+ "search": {
+ "dynamic": false,
+ "properties": {
+ "title": {
+ "type": "text"
+ },
+ "description": {
+ "type": "text"
+ }
+ }
+ },
"alert": {
"dynamic": false,
"properties": {
@@ -874,30 +898,6 @@
}
}
},
- "tag": {
- "properties": {
- "name": {
- "type": "text"
- },
- "description": {
- "type": "text"
- },
- "color": {
- "type": "text"
- }
- }
- },
- "search": {
- "dynamic": false,
- "properties": {
- "title": {
- "type": "text"
- },
- "description": {
- "type": "text"
- }
- }
- },
"graph-workspace": {
"properties": {
"description": {
@@ -2259,6 +2259,14 @@
}
}
},
+ "infrastructure-monitoring-log-view": {
+ "dynamic": false,
+ "properties": {
+ "name": {
+ "type": "text"
+ }
+ }
+ },
"ml-job": {
"properties": {
"job_id": {
@@ -2796,6 +2804,9 @@
},
"value": {
"type": "text"
+ },
+ "relation": {
+ "type": "keyword"
}
}
},
@@ -2932,14 +2943,6 @@
"dynamic": false,
"properties": {}
},
- "infrastructure-monitoring-log-view": {
- "dynamic": false,
- "properties": {
- "name": {
- "type": "text"
- }
- }
- },
"metrics-explorer-view": {
"dynamic": false,
"properties": {}
@@ -2976,18 +2979,6 @@
}
}
},
- "enterprise_search_telemetry": {
- "dynamic": false,
- "properties": {}
- },
- "app_search_telemetry": {
- "dynamic": false,
- "properties": {}
- },
- "workplace_search_telemetry": {
- "dynamic": false,
- "properties": {}
- },
"apm-indices": {
"dynamic": false,
"properties": {}
@@ -3019,5 +3010,17 @@
"type": "text"
}
}
+ },
+ "enterprise_search_telemetry": {
+ "dynamic": false,
+ "properties": {}
+ },
+ "app_search_telemetry": {
+ "dynamic": false,
+ "properties": {}
+ },
+ "workplace_search_telemetry": {
+ "dynamic": false,
+ "properties": {}
}
}
diff --git a/packages/kbn-io-ts-utils/src/strict_keys_rt/index.test.ts b/packages/kbn-io-ts-utils/src/strict_keys_rt/index.test.ts
index 77a20a014093b..6bca714e81a8a 100644
--- a/packages/kbn-io-ts-utils/src/strict_keys_rt/index.test.ts
+++ b/packages/kbn-io-ts-utils/src/strict_keys_rt/index.test.ts
@@ -202,6 +202,11 @@ describe('strictKeysRt', () => {
{ body: { duration: false } },
],
},
+ {
+ type: t.array(t.type({ foo: t.string })),
+ passes: [[{ foo: 'bar' }], [{ foo: 'baz' }, { foo: 'bar' }]],
+ fails: [],
+ },
];
checks.forEach((check) => {
diff --git a/packages/kbn-io-ts-utils/src/strict_keys_rt/index.ts b/packages/kbn-io-ts-utils/src/strict_keys_rt/index.ts
index f0bd5bb056c00..8af4d690db0fd 100644
--- a/packages/kbn-io-ts-utils/src/strict_keys_rt/index.ts
+++ b/packages/kbn-io-ts-utils/src/strict_keys_rt/index.ts
@@ -23,7 +23,8 @@ type ParsableType =
| t.ExactType
| t.InterfaceType
| MergeType
- | t.DictionaryType;
+ | t.DictionaryType
+ | t.ArrayType;
const tags = [
'DictionaryType',
@@ -33,6 +34,7 @@ const tags = [
'PartialType',
'ExactType',
'UnionType',
+ 'ArrayType',
];
function isParsableType(type: t.Mixed): type is ParsableType {
@@ -45,6 +47,9 @@ function getHandlingTypes(type: t.Mixed, key: string, value: object): t.Mixed[]
}
switch (type._tag) {
+ case 'ArrayType':
+ return [type.type];
+
case 'DictionaryType':
return [type.codomain];
diff --git a/packages/kbn-plugin-generator/template/public/components/app.tsx.ejs b/packages/kbn-plugin-generator/template/public/components/app.tsx.ejs
index 12303d9ff0465..5702d69fba3b6 100644
--- a/packages/kbn-plugin-generator/template/public/components/app.tsx.ejs
+++ b/packages/kbn-plugin-generator/template/public/components/app.tsx.ejs
@@ -2,23 +2,15 @@ import React, { useState } from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage, I18nProvider } from '@kbn/i18n-react';
import { BrowserRouter as Router } from '@kbn/shared-ux-router';
-
-
import {
EuiButton,
EuiHorizontalRule,
- EuiPage,
- EuiPageBody,
- EuiPageContent_Deprecated as EuiPageContent,
- EuiPageContentBody_Deprecated as EuiPageContentBody,
- EuiPageContentHeader_Deprecated as EuiPageContentHeader,
- EuiPageHeader,
+ EuiPageTemplate,
EuiTitle,
EuiText,
} from '@elastic/eui';
-
-import { CoreStart } from '<%= importFromRoot('src/core/public') %>';
-import { NavigationPublicPluginStart } from '<%= importFromRoot('src/plugins/navigation/public') %>';
+import type { CoreStart } from '@kbn/core/public';
+import type { NavigationPublicPluginStart } from '@kbn/navigation-plugin/public';
import { PLUGIN_ID, PLUGIN_NAME } from '../../common';
@@ -56,57 +48,51 @@ export const <%= upperCamelCase(name) %>App = ({ basename, notifications, http,
<>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
>
diff --git a/packages/kbn-storybook/templates/index.ejs b/packages/kbn-storybook/templates/index.ejs
index e8d8d4d6df09d..b52fc548b814b 100644
--- a/packages/kbn-storybook/templates/index.ejs
+++ b/packages/kbn-storybook/templates/index.ejs
@@ -15,6 +15,7 @@
+