Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into task/redux-saga-m…
Browse files Browse the repository at this point in the history
…iddleware
  • Loading branch information
paul-tavares committed Jan 14, 2020
2 parents b155be6 + ea82503 commit 4c090a3
Show file tree
Hide file tree
Showing 708 changed files with 48,938 additions and 27,647 deletions.
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@
/x-pack/test/alerting_api_integration @elastic/kibana-alerting-services
/x-pack/test/plugin_api_integration/plugins/task_manager @elastic/kibana-alerting-services
/x-pack/test/plugin_api_integration/test_suites/task_manager @elastic/kibana-alerting-services
/x-pack/legacy/plugins/triggers_actions_ui/ @elastic/kibana-alerting-services
/x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/ @elastic/kibana-alerting-services
/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/ @elastic/kibana-alerting-services

# Design
**/*.scss @elastic/kibana-design
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ returns `basePath` value, specific for an incoming request.
<b>Signature:</b>

```typescript
get: (request: KibanaRequest<unknown, unknown, unknown, any> | LegacyRequest) => string;
get: (request: LegacyRequest | KibanaRequest<unknown, unknown, unknown, any>) => string;
```
4 changes: 2 additions & 2 deletions docs/development/core/server/kibana-plugin-server.basepath.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ The constructor for this class is marked as internal. Third-party code should no

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [get](./kibana-plugin-server.basepath.get.md) | | <code>(request: KibanaRequest&lt;unknown, unknown, unknown, any&gt; &#124; LegacyRequest) =&gt; string</code> | returns <code>basePath</code> value, specific for an incoming request. |
| [get](./kibana-plugin-server.basepath.get.md) | | <code>(request: LegacyRequest &#124; KibanaRequest&lt;unknown, unknown, unknown, any&gt;) =&gt; string</code> | returns <code>basePath</code> value, specific for an incoming request. |
| [prepend](./kibana-plugin-server.basepath.prepend.md) | | <code>(path: string) =&gt; string</code> | Prepends <code>path</code> with the basePath. |
| [remove](./kibana-plugin-server.basepath.remove.md) | | <code>(path: string) =&gt; string</code> | Removes the prepended basePath from the <code>path</code>. |
| [serverBasePath](./kibana-plugin-server.basepath.serverbasepath.md) | | <code>string</code> | returns the server's basePath<!-- -->See [BasePath.get](./kibana-plugin-server.basepath.get.md) for getting the basePath value for a specific request |
| [set](./kibana-plugin-server.basepath.set.md) | | <code>(request: KibanaRequest&lt;unknown, unknown, unknown, any&gt; &#124; LegacyRequest, requestSpecificBasePath: string) =&gt; void</code> | sets <code>basePath</code> value, specific for an incoming request. |
| [set](./kibana-plugin-server.basepath.set.md) | | <code>(request: LegacyRequest &#124; KibanaRequest&lt;unknown, unknown, unknown, any&gt;, requestSpecificBasePath: string) =&gt; void</code> | sets <code>basePath</code> value, specific for an incoming request. |

Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ sets `basePath` value, specific for an incoming request.
<b>Signature:</b>

```typescript
set: (request: KibanaRequest<unknown, unknown, unknown, any> | LegacyRequest, requestSpecificBasePath: string) => void;
set: (request: LegacyRequest | KibanaRequest<unknown, unknown, unknown, any>, requestSpecificBasePath: string) => void;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [UiSettingsParams](./kibana-plugin-server.uisettingsparams.md) &gt; [deprecation](./kibana-plugin-server.uisettingsparams.deprecation.md)

## UiSettingsParams.deprecation property

optional deprecation information. Used to generate a deprecation warning.

<b>Signature:</b>

```typescript
deprecation?: DeprecationSettings;
```
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ export interface UiSettingsParams
| Property | Type | Description |
| --- | --- | --- |
| [category](./kibana-plugin-server.uisettingsparams.category.md) | <code>string[]</code> | used to group the configured setting in the UI |
| [deprecation](./kibana-plugin-server.uisettingsparams.deprecation.md) | <code>DeprecationSettings</code> | optional deprecation information. Used to generate a deprecation warning. |
| [description](./kibana-plugin-server.uisettingsparams.description.md) | <code>string</code> | description provided to a user in UI |
| [name](./kibana-plugin-server.uisettingsparams.name.md) | <code>string</code> | title in the UI |
| [optionLabels](./kibana-plugin-server.uisettingsparams.optionlabels.md) | <code>Record&lt;string, string&gt;</code> | text labels for 'select' type UI element |
| [options](./kibana-plugin-server.uisettingsparams.options.md) | <code>string[]</code> | array of permitted values for this setting |
| [readonly](./kibana-plugin-server.uisettingsparams.readonly.md) | <code>boolean</code> | a flag indicating that value cannot be changed |
| [requiresPageReload](./kibana-plugin-server.uisettingsparams.requirespagereload.md) | <code>boolean</code> | a flag indicating whether new value applying requires page reloading |
| [type](./kibana-plugin-server.uisettingsparams.type.md) | <code>UiSettingsType</code> | defines a type of UI element [UiSettingsType](./kibana-plugin-server.uisettingstype.md) |
| [validation](./kibana-plugin-server.uisettingsparams.validation.md) | <code>ImageValidation &#124; StringValidation</code> | |
| [value](./kibana-plugin-server.uisettingsparams.value.md) | <code>SavedObjectAttribute</code> | default value to fall back to if a user doesn't provide any |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [UiSettingsParams](./kibana-plugin-server.uisettingsparams.md) &gt; [validation](./kibana-plugin-server.uisettingsparams.validation.md)

## UiSettingsParams.validation property

<b>Signature:</b>

```typescript
validation?: ImageValidation | StringValidation;
```
3 changes: 2 additions & 1 deletion docs/management/advanced-options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ Refresh the page to apply the changes.
=== Search settings

[horizontal]
`courier:batchSearches`:: When disabled, dashboard panels will load individually, and search requests will terminate when
`courier:batchSearches`:: **Deprecated in 7.6. Starting in 8.0, this setting will be optimized internally.**
When disabled, dashboard panels will load individually, and search requests will terminate when
users navigate away or update the query. When enabled, dashboard panels will load together when all of the data is loaded,
and searches will not terminate.
`courier:customRequestPreference`:: {ref}/search-request-body.html#request-body-search-preference[Request preference]
Expand Down
40 changes: 36 additions & 4 deletions docs/setup/production.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
* <<configuring-kibana-shield>>
* <<csp-strict-mode>>
* <<enabling-ssl>>
* <<load-balancing>>
* <<load-balancing-es>>
* <<load-balancing-kibana>>
* <<high-availability>>
* <<memory>>

Expand All @@ -18,7 +19,7 @@ While Kibana isn't terribly resource intensive, we still recommend running Kiban
separate from your Elasticsearch data or master nodes. To distribute Kibana
traffic across the nodes in your Elasticsearch cluster, you can run Kibana
and an Elasticsearch client node on the same machine. For more information, see
<<load-balancing, Load Balancing Across Multiple Elasticsearch Nodes>>.
<<load-balancing-es, Load balancing across multiple Elasticsearch nodes>>.

[float]
[[configuring-kibana-shield]]
Expand Down Expand Up @@ -63,7 +64,7 @@ csp.strict: true
See <<configuring-tls>>.

[float]
[[load-balancing]]
[[load-balancing-es]]
=== Load Balancing Across Multiple Elasticsearch Nodes
If you have multiple nodes in your Elasticsearch cluster, the easiest way to distribute Kibana requests
across the nodes is to run an Elasticsearch _Coordinating only_ node on the same machine as Kibana.
Expand Down Expand Up @@ -110,9 +111,40 @@ transport.tcp.port: 9300 - 9400
elasticsearch.hosts: ["http://localhost:9200"]
--------

[float]
[[load-balancing-kibana]]
=== Load balancing across multiple Kibana instances
To serve multiple Kibana installations behind a load balancer, you must change the configuration. See {kibana-ref}/settings.html[Configuring Kibana] for details on each setting.

Settings unique across each Kibana instance:
--------
server.uuid
server.name
--------

Settings unique across each host (for example, running multiple installations on the same virtual machine):
--------
logging.dest
path.data
pid.file
server.port
--------

Settings that must be the same:
--------
xpack.security.encryptionKey //decrypting session cookies
xpack.reporting.encryptionKey //decrypting reports stored in Elasticsearch
--------

Separate configuration files can be used from the command line by using the `-c` flag:
--------
bin/kibana -c config/instance1.yml
bin/kibana -c config/instance2.yml
--------

[float]
[[high-availability]]
=== High Availability Across Multiple Elasticsearch Nodes
=== High availability across multiple Elasticsearch nodes
Kibana can be configured to connect to multiple Elasticsearch nodes in the same cluster. In situations where a node becomes unavailable,
Kibana will transparently connect to an available node and continue operating. Requests to available hosts will be routed in a round robin fashion.

Expand Down
40 changes: 25 additions & 15 deletions docs/user/security/reporting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -125,23 +125,33 @@ the {reporting} endpoints to authorized users. This requires that you:

. Enable {security} on your {es} cluster. For more information,
see {ref}/security-getting-started.html[Getting Started with Security].
. Configure an SSL certificate for Kibana. For more information, see
<<using-kibana-with-security>>.
. Configure {watcher} to trust the Kibana server's certificate by adding it to
the {watcher} truststore on each node:
.. Import the {kib} server certificate into the {watcher} truststore using
Java Keytool:
. Configure TLS/SSL encryption for the {kib} server. For more information, see
<<configuring-tls>>.
. Specify the {kib} server's CA certificate chain in `elasticsearch.yml`:
+
[source,shell]
---------------------------------------------------------
keytool -importcert -keystore watcher-truststore.jks -file server.crt
---------------------------------------------------------
+
NOTE: If the truststore doesn't already exist, it is created.
--
If you are using your own CA to sign the {kib} server certificate, then you need
to specify the CA certificate chain in {es} to properly establish trust in TLS
connections between {watcher} and {kib}. If your CA certificate chain is
contained in a PKCS #12 trust store, specify it like so:

[source,yaml]
--------------------------------------------------------------------------------
xpack.http.ssl.truststore.path: "/path/to/your/truststore.p12"
xpack.http.ssl.truststore.type: "PKCS12"
xpack.http.ssl.truststore.password: "optional decryption password"
--------------------------------------------------------------------------------

Otherwise, if your CA certificate chain is in PEM format, specify it like so:

[source,yaml]
--------------------------------------------------------------------------------
xpack.http.ssl.certificate_authorities: ["/path/to/your/cacert1.pem", "/path/to/your/cacert2.pem"]
--------------------------------------------------------------------------------

For more information, see {ref}/notification-settings.html#ssl-notification-settings[the {watcher} HTTP TLS/SSL Settings].
--

.. Make sure the `xpack.http.ssl.truststore.path` setting in
`elasticsearch.yml` specifies the location of the {watcher}
truststore.
. Add one or more users who have the permissions
necessary to use {kib} and {reporting}. For more information, see
<<secure-reporting>>.
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/chrome/chrome_service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class ChromeService {
)
)
);
this.isVisible$ = combineLatest(this.appHidden$, this.toggleHidden$).pipe(
this.isVisible$ = combineLatest([this.appHidden$, this.toggleHidden$]).pipe(
map(([appHidden, toggleHidden]) => !(appHidden || toggleHidden)),
takeUntil(this.stop$)
);
Expand Down
10 changes: 4 additions & 6 deletions src/core/public/chrome/ui/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import {
} from '../..';
import { HttpStart } from '../../../http';
import { ChromeHelpExtension } from '../../chrome_service';
import { ApplicationStart, InternalApplicationStart } from '../../../application/types';
import { InternalApplicationStart } from '../../../application/types';

// Providing a buffer between the limit and the cut off index
// protects from truncating just the last couple (6) characters
Expand Down Expand Up @@ -108,7 +108,7 @@ function extendRecentlyAccessedHistoryItem(
};
}

function extendNavLink(navLink: ChromeNavLink, urlForApp: ApplicationStart['getUrlForApp']) {
function extendNavLink(navLink: ChromeNavLink) {
if (navLink.legacy) {
return {
...navLink,
Expand All @@ -118,7 +118,7 @@ function extendNavLink(navLink: ChromeNavLink, urlForApp: ApplicationStart['getU

return {
...navLink,
href: urlForApp(navLink.id),
href: navLink.baseUrl,
};
}

Expand Down Expand Up @@ -229,9 +229,7 @@ class HeaderUI extends Component<Props, State> {
appTitle,
isVisible,
forceNavigation,
navLinks: navLinks.map(navLink =>
extendNavLink(navLink, this.props.application.getUrlForApp)
),
navLinks: navLinks.map(extendNavLink),
recentlyAccessed: recentlyAccessed.map(ra =>
extendRecentlyAccessedHistoryItem(navLinks, ra, this.props.basePath)
),
Expand Down
3 changes: 3 additions & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ export class DocLinksService {
date: {
dateMath: `${ELASTICSEARCH_DOCS}common-options.html#date-math`,
},
management: {
kibanaSearchSettings: `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/advanced-options.html#kibana-search-settings`,
},
},
});
}
Expand Down
105 changes: 105 additions & 0 deletions src/core/public/rendering/app_containers.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { BehaviorSubject } from 'rxjs';
import { act } from 'react-dom/test-utils';
import { mount } from 'enzyme';
import React from 'react';

import { AppWrapper, AppContainer } from './app_containers';

describe('AppWrapper', () => {
it('toggles the `hidden-chrome` class depending on the chrome visibility state', () => {
const chromeVisible$ = new BehaviorSubject<boolean>(true);

const component = mount(<AppWrapper chromeVisible$={chromeVisible$}>app-content</AppWrapper>);
expect(component.getDOMNode()).toMatchInlineSnapshot(`
<div
class="app-wrapper"
>
app-content
</div>
`);

act(() => chromeVisible$.next(false));
component.update();
expect(component.getDOMNode()).toMatchInlineSnapshot(`
<div
class="app-wrapper hidden-chrome"
>
app-content
</div>
`);

act(() => chromeVisible$.next(true));
component.update();
expect(component.getDOMNode()).toMatchInlineSnapshot(`
<div
class="app-wrapper"
>
app-content
</div>
`);
});
});

describe('AppContainer', () => {
it('adds classes supplied by chrome', () => {
const appClasses$ = new BehaviorSubject<string[]>([]);

const component = mount(<AppContainer classes$={appClasses$}>app-content</AppContainer>);
expect(component.getDOMNode()).toMatchInlineSnapshot(`
<div
class="application"
>
app-content
</div>
`);

act(() => appClasses$.next(['classA', 'classB']));
component.update();
expect(component.getDOMNode()).toMatchInlineSnapshot(`
<div
class="application classA classB"
>
app-content
</div>
`);

act(() => appClasses$.next(['classC']));
component.update();
expect(component.getDOMNode()).toMatchInlineSnapshot(`
<div
class="application classC"
>
app-content
</div>
`);

act(() => appClasses$.next([]));
component.update();
expect(component.getDOMNode()).toMatchInlineSnapshot(`
<div
class="application"
>
app-content
</div>
`);
});
});
Loading

0 comments on commit 4c090a3

Please sign in to comment.