Skip to content

Commit 40f6c5c

Browse files
committed
Merge remote-tracking branch 'origin/master' into add-formatters
2 parents aeefd35 + ccbb286 commit 40f6c5c

180 files changed

Lines changed: 5989 additions & 1157 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
# Kibana Alerting Services
130130
/x-pack/legacy/plugins/alerting/ @elastic/kibana-alerting-services
131131
/x-pack/legacy/plugins/actions/ @elastic/kibana-alerting-services
132+
/x-pack/plugins/event_log/ @elastic/kibana-alerting-services
132133
/x-pack/plugins/task_manager/ @elastic/kibana-alerting-services
133134
/x-pack/test/alerting_api_integration/ @elastic/kibana-alerting-services
134135
/x-pack/test/plugin_api_integration/plugins/task_manager/ @elastic/kibana-alerting-services

docs/setup/settings.asciidoc

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -229,23 +229,25 @@ Kibana, the server needs to be CORS-enabled so Kibana can download the file.
229229
The following example shows a valid regionmap configuration.
230230
+
231231
--
232-
map.regionmap:
232+
map
233233
includeElasticMapsService: false
234-
layers:
235-
- name: "Departments of France"
236-
url: "http://my.cors.enabled.server.org/france_departements.geojson"
237-
attribution: "INRAP"
238-
fields:
239-
- name: "department"
234+
regionmap:
235+
layers:
236+
- name: "Departments of France"
237+
url: "http://my.cors.enabled.server.org/france_departements.geojson"
238+
attribution: "INRAP"
239+
fields:
240+
- name: "department"
240241
description: "Full department name"
241-
- name: "INSEE"
242+
- name: "INSEE"
242243
description: "INSEE numeric identifier"
243244
--
244245

245-
[[regionmap-ES-map]]`map.regionmap.includeElasticMapsService:`:: Turns on or off
246+
[[regionmap-ES-map]]`map.includeElasticMapsService:`:: Turns on or off
246247
whether layers from the Elastic Maps Service should be included in the vector
247248
layer option list. Supported on Elastic Cloud Enterprise. By turning this off,
248-
only the layers that are configured here will be included. The default is `true`.
249+
only the layers that are configured here will be included. The default is `true`.
250+
This also affects whether tile-service from the Elastic Maps Service will be available.
249251

250252
[[regionmap-attribution]]`map.regionmap.layers[].attribution:`:: Optional.
251253
References the originating source of the geojson file. Supported on {ece}.

docs/user/security/securing-communications/index.asciidoc

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
<titleabbrev>Encrypting communications</titleabbrev>
55
++++
66

7-
{kib} supports Transport Layer Security (TLS/SSL) encryption for all forms of data-in-transit. Browsers send traffic to {kib} and {kib}
8-
sends traffic to {es}. These communications are configured separately.
7+
{kib} supports Transport Layer Security (TLS/SSL) encryption for all forms of
8+
data-in-transit. Browsers send traffic to {kib} and {kib} sends traffic to {es}.
9+
These communications are configured separately.
910

1011
[[configuring-tls-browser-kib]]
1112
==== Encrypting traffic between the browser and {kib}
@@ -78,15 +79,18 @@ NOTE: To perform this step, you must
7879
{ref}/configuring-security.html[enable the {es} {security-features}] or you
7980
must have a proxy that provides an HTTPS endpoint for {es}.
8081

81-
. Specify the HTTPS URL in the `elasticsearch.hosts` setting in the {kib} configuration file, `kibana.yml`:
82+
. Specify the HTTPS URL in the `elasticsearch.hosts` setting in the {kib}
83+
configuration file, `kibana.yml`:
8284
+
8385
--
8486
[source,yaml]
8587
--------------------------------------------------------------------------------
8688
elasticsearch.hosts: ["https://<your_elasticsearch_host>.com:9200"]
8789
--------------------------------------------------------------------------------
8890

89-
Using the HTTPS protocol results in a default `elasticsearch.ssl.verificationMode` option of `full`, which utilizes hostname verification.
91+
Using the HTTPS protocol results in a default
92+
`elasticsearch.ssl.verificationMode` option of `full`, which utilizes hostname
93+
verification.
9094

9195
For more information, see <<settings,{kib} configuration settings>>.
9296
--
@@ -95,24 +99,32 @@ For more information, see <<settings,{kib} configuration settings>>.
9599
+
96100
--
97101

98-
If you are using your own CA to sign certificates for {es}, then you need to specify the CA certificate chain in {kib} to properly establish
99-
trust in TLS connections. If your CA certificate chain is contained in a PKCS #12 trust store, specify it like so:
102+
If you are using your own CA to sign certificates for {es}, then you need to
103+
specify the CA certificate chain in {kib} to properly establish trust in TLS
104+
connections. If your CA certificate chain is contained in a PKCS #12 trust store,
105+
specify it like so:
100106

101107
[source,yaml]
102108
--------------------------------------------------------------------------------
103109
elasticsearch.ssl.truststore.path: "/path/to/your/truststore.p12"
104110
elasticsearch.ssl.truststore.password: "optional decryption password"
105111
--------------------------------------------------------------------------------
106112

107-
Otherwise, if your CA certificate chain is in PEM format, specify each certificate like so:
113+
Otherwise, if your CA certificate chain is in PEM format, specify each
114+
certificate like so:
108115

109116
[source,yaml]
110117
--------------------------------------------------------------------------------
111118
elasticsearch.ssl.certificateAuthorities: ["/path/to/your/cacert1.pem", "/path/to/your/cacert2.pem"]
112119
--------------------------------------------------------------------------------
113120

121+
TIP: You can use the {ref}/certutil.html[`elasticsearch-certutil http` command]
122+
to generate a PEM format x.509 certificate for the {es} CA. It also provides
123+
detailed configuration details in readme files.
124+
114125
--
115126

116-
. (Optional) If the Elastic {monitor-features} are enabled, configure {kib} to connect to the {es} monitoring cluster via HTTPS. The steps
117-
are the same as above, but each setting is prefixed by `xpack.monitoring.`. For example, `xpack.monitoring.elasticsearch.hosts`,
127+
. (Optional) If the Elastic {monitor-features} are enabled, configure {kib} to
128+
connect to the {es} monitoring cluster via HTTPS. The steps are the same as
129+
above, but each setting is prefixed by `xpack.monitoring.`. For example, `xpack.monitoring.elasticsearch.hosts`,
118130
`xpack.monitoring.elasticsearch.ssl.truststore.path`, etc.

src/core/MIGRATION.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,10 +1193,11 @@ In server code, `core` can be accessed from either `server.newPlatform` or `kbnS
11931193
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
11941194
| `server.config()` | [`initializerContext.config.create()`](/docs/development/core/server/kibana-plugin-server.plugininitializercontext.config.md) | Must also define schema. See _[how to configure plugin](#configure-plugin)_ |
11951195
| `server.route` | [`core.http.createRouter`](/docs/development/core/server/kibana-plugin-server.httpservicesetup.createrouter.md) | [Examples](./MIGRATION_EXAMPLES.md#route-registration) |
1196+
| `server.renderApp()` / `server.renderAppWithDefaultConfig()` | [`context.rendering.render()`](/docs/development/core/server/kibana-plugin-server.iscopedrenderingclient.render.md) | [Examples](./MIGRATION_EXAMPLES.md#render-html-content) |
11961197
| `request.getBasePath()` | [`core.http.basePath.get`](/docs/development/core/server/kibana-plugin-server.httpservicesetup.basepath.md) | |
11971198
| `server.plugins.elasticsearch.getCluster('data')` | [`context.elasticsearch.dataClient`](/docs/development/core/server/kibana-plugin-server.iscopedclusterclient.md) | |
11981199
| `server.plugins.elasticsearch.getCluster('admin')` | [`context.elasticsearch.adminClient`](/docs/development/core/server/kibana-plugin-server.iscopedclusterclient.md) | |
1199-
| `server.plugins.elasticsearch.createCluster(...)` | [`core.elasticsearch.createClient`](/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.createclient.md) | |
1200+
| `server.plugins.elasticsearch.createCluster(...)` | [`core.elasticsearch.createClient`](/docs/development/core/server/kibana-plugin-server.elasticsearchservicesetup.createclient.md) | |
12001201
| `server.savedObjects.setScopedSavedObjectsClientFactory` | [`core.savedObjects.setClientFactory`](/docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.setclientfactory.md) | |
12011202
| `server.savedObjects.addScopedSavedObjectsClientWrapperFactory` | [`core.savedObjects.addClientWrapper`](/docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.addclientwrapper.md) | |
12021203
| `server.savedObjects.getSavedObjectsRepository` | [`core.savedObjects.createInternalRepository`](/docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.createinternalrepository.md) [`core.savedObjects.createScopedRepository`](/docs/development/core/server/kibana-plugin-server.savedobjectsservicesetup.createscopedrepository.md) | |

src/core/MIGRATION_EXAMPLES.md

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ APIs to their New Platform equivalents.
1616
- [Accessing Services](#accessing-services)
1717
- [Chrome](#chrome)
1818
- [Updating an application navlink](#updating-application-navlink)
19-
19+
- [Chromeless Applications](#chromeless-applications)
20+
- [Render HTML Content](#render-html-content)
21+
2022
## Configuration
2123

2224
### Declaring config schema
@@ -518,4 +520,83 @@ export class MyPlugin implements Plugin {
518520
},
519521
});
520522
}
521-
```
523+
```
524+
525+
## Chromeless Applications
526+
527+
In Kibana, a "chromeless" application is one where the primary Kibana UI components
528+
such as header or navigation can be hidden. In the legacy platform these were referred to
529+
as "hidden" applications, and were set via the `hidden` property in a Kibana plugin.
530+
Chromeless applications are also not displayed in the left navbar.
531+
532+
To mark an application as chromeless, specify `chromeless: false` when registering your application
533+
to hide the chrome UI when the application is mounted:
534+
535+
```ts
536+
application.register({
537+
id: 'chromeless',
538+
chromeless: true,
539+
async mount(context, params) {
540+
/* ... */
541+
},
542+
});
543+
```
544+
545+
If you wish to render your application at a route that does not follow the `/app/${appId}` pattern,
546+
this can be done via the `appRoute` property. Doing this currently requires you to register a server
547+
route where you can return a bootstrapped HTML page for your application bundle. Instructions on
548+
registering this server route is covered in the next section: [Render HTML Content](#render-html-content).
549+
550+
```ts
551+
application.register({
552+
id: 'chromeless',
553+
appRoute: '/chromeless',
554+
chromeless: true,
555+
async mount(context, params) {
556+
/* ... */
557+
},
558+
});
559+
```
560+
561+
## Render HTML Content
562+
563+
You can return a blank HTML page bootstrapped with the core application bundle from an HTTP route handler
564+
via the `rendering` context. You may wish to do this if you are rendering a chromeless application with a
565+
custom application route or have other custom rendering needs.
566+
567+
```ts
568+
router.get(
569+
{ path: '/chromeless', validate: false },
570+
(context, request, response) => {
571+
const { http, rendering } = context.core;
572+
573+
return response.ok({
574+
body: await rendering.render(), // generates an HTML document
575+
headers: {
576+
'content-security-policy': http.csp.header,
577+
},
578+
});
579+
}
580+
);
581+
```
582+
583+
You can also specify to exclude user data from the bundle metadata. User data
584+
comprises all UI Settings that are *user provided*, then injected into the page.
585+
You may wish to exclude fetching this data if not authorized or to slim the page
586+
size.
587+
588+
```ts
589+
router.get(
590+
{ path: '/', validate: false },
591+
(context, request, response) => {
592+
const { http, rendering } = context.core;
593+
594+
return response.ok({
595+
body: await rendering.render({ includeUserSettings: false }),
596+
headers: {
597+
'content-security-policy': http.csp.header,
598+
},
599+
});
600+
}
601+
);
602+
```

src/dev/build/tasks/os_packages/docker_generator/resources/bin/kibana-docker

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ kibana_vars=(
5959
path.data
6060
pid.file
6161
regionmap
62-
regionmap.includeElasticMapsService
6362
server.basePath
6463
server.customResponseHeaders
6564
server.defaultRoute

src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_app_controller.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -480,18 +480,21 @@ export class DashboardAppController {
480480
language:
481481
localStorage.get('kibana.userQueryLanguage') || config.get('search:queryLanguage'),
482482
},
483-
[]
483+
queryFilter.getGlobalFilters()
484484
);
485485
// Making this method sync broke the updates.
486486
// Temporary fix, until we fix the complex state in this file.
487-
setTimeout(queryFilter.removeAll, 0);
487+
setTimeout(() => {
488+
queryFilter.setFilters(queryFilter.getGlobalFilters());
489+
}, 0);
488490
};
489491

490492
const updateStateFromSavedQuery = (savedQuery: SavedQuery) => {
491-
dashboardStateManager.applyFilters(
492-
savedQuery.attributes.query,
493-
savedQuery.attributes.filters || []
494-
);
493+
const savedQueryFilters = savedQuery.attributes.filters || [];
494+
const globalFilters = queryFilter.getGlobalFilters();
495+
const allFilters = [...globalFilters, ...savedQueryFilters];
496+
497+
dashboardStateManager.applyFilters(savedQuery.attributes.query, allFilters);
495498
if (savedQuery.attributes.timefilter) {
496499
timefilter.setTime({
497500
from: savedQuery.attributes.timefilter.from,
@@ -504,7 +507,7 @@ export class DashboardAppController {
504507
// Making this method sync broke the updates.
505508
// Temporary fix, until we fix the complex state in this file.
506509
setTimeout(() => {
507-
queryFilter.setFilters(savedQuery.attributes.filters || []);
510+
queryFilter.setFilters(allFilters);
508511
}, 0);
509512
};
510513

src/legacy/core_plugins/kibana/public/discover/np_ready/angular/discover.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,15 +1000,17 @@ function discoverController(
10001000
query: '',
10011001
language: localStorage.get('kibana.userQueryLanguage') || config.get('search:queryLanguage'),
10021002
};
1003-
filterManager.removeAll();
1003+
filterManager.setFilters(filterManager.getGlobalFilters());
10041004
$state.save();
10051005
$scope.fetch();
10061006
};
10071007

10081008
const updateStateFromSavedQuery = savedQuery => {
10091009
$state.query = savedQuery.attributes.query;
10101010
$state.save();
1011-
filterManager.setFilters(savedQuery.attributes.filters || []);
1011+
const savedQueryFilters = savedQuery.attributes.filters || [];
1012+
const globalFilters = filterManager.getGlobalFilters();
1013+
filterManager.setFilters([...globalFilters, ...savedQueryFilters]);
10121014

10131015
if (savedQuery.attributes.timefilter) {
10141016
timefilter.setTime({

src/legacy/core_plugins/kibana/public/visualize/np_ready/editor/editor.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ function VisualizeAppController(
501501
language:
502502
localStorage.get('kibana.userQueryLanguage') || uiSettings.get('search:queryLanguage'),
503503
};
504-
queryFilter.removeAll();
504+
queryFilter.setFilters(queryFilter.getGlobalFilters());
505505
$state.save();
506506
$scope.fetch();
507507
};
@@ -510,7 +510,9 @@ function VisualizeAppController(
510510
$state.query = savedQuery.attributes.query;
511511
$state.save();
512512

513-
queryFilter.setFilters(savedQuery.attributes.filters || []);
513+
const savedQueryFilters = savedQuery.attributes.filters || [];
514+
const globalFilters = queryFilter.getGlobalFilters();
515+
queryFilter.setFilters([...globalFilters, ...savedQueryFilters]);
514516

515517
if (savedQuery.attributes.timefilter) {
516518
timefilter.setTime({

x-pack/legacy/plugins/actions/server/lib/action_executor.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
savedObjectsClientMock,
1414
loggingServiceMock,
1515
} from '../../../../../../src/core/server/mocks';
16+
import { createEventLoggerMock } from '../../../../../plugins/event_log/server/event_logger.mock';
1617

1718
const actionExecutor = new ActionExecutor();
1819
const savedObjectsClient = savedObjectsClientMock.create();
@@ -58,6 +59,7 @@ actionExecutor.initialize({
5859
getServices,
5960
actionTypeRegistry,
6061
encryptedSavedObjectsPlugin,
62+
eventLogger: createEventLoggerMock(),
6163
});
6264

6365
beforeEach(() => jest.resetAllMocks());

0 commit comments

Comments
 (0)