Skip to content

Commit

Permalink
Merge branch 'master' into flaky-test-runner-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Oct 30, 2019
2 parents 5d12ed9 + 0efe6a2 commit 5e04ab8
Show file tree
Hide file tree
Showing 262 changed files with 5,224 additions and 3,116 deletions.
6 changes: 0 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,6 @@ module.exports = {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['x-pack/legacy/plugins/spaces/**/*.{js,ts,tsx}'],
rules: {
'react-hooks/exhaustive-deps': 'off',
},
},
{
files: ['x-pack/legacy/plugins/transform/**/*.{js,ts,tsx}'],
rules: {
Expand Down
8 changes: 7 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@

# App Architecture
/src/plugins/data/ @elastic/kibana-app-arch
/src/plugins/kibana_utils/ @elastic/kibana-app-arch
/src/plugins/embeddable/ @elastic/kibana-app-arch
/src/plugins/expressions/ @elastic/kibana-app-arch
/src/plugins/kibana_react/ @elastic/kibana-app-arch
/src/plugins/kibana_utils/ @elastic/kibana-app-arch
/src/plugins/navigation/ @elastic/kibana-app-arch
/src/plugins/ui_actions/ @elastic/kibana-app-arch
/src/plugins/visualizations/ @elastic/kibana-app-arch
/x-pack/plugins/advanced_ui_actions/ @elastic/kibana-app-arch

# APM
/x-pack/legacy/plugins/apm/ @elastic/apm-ui
Expand Down Expand Up @@ -56,6 +61,7 @@
/src/legacy/server/saved_objects/ @elastic/kibana-platform
/config/kibana.yml @elastic/kibana-platform
/x-pack/plugins/features/ @elastic/kibana-platform
/x-pack/plugins/licensing/ @elastic/kibana-platform

# Security
/x-pack/legacy/plugins/security/ @elastic/kibana-security
Expand Down
2 changes: 2 additions & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"common.ui": "src/legacy/ui",
"data": ["src/legacy/core_plugins/data", "src/plugins/data"],
"expressions": "src/legacy/core_plugins/expressions",
"expressions_np": "src/plugins/expressions",
"kibana_react": "src/legacy/core_plugins/kibana_react",
"navigation": "src/legacy/core_plugins/navigation",
"server": "src/legacy/server",
Expand All @@ -29,6 +30,7 @@
"kbnESQuery": "packages/kbn-es-query",
"inspector": "src/plugins/inspector",
"kibana-react": "src/plugins/kibana_react",
"visualizations": "src/plugins/visualizations",
"telemetry": "src/legacy/core_plugins/telemetry",
"esUi": "src/plugins/es_ui_shared",
"uiActions": "src/plugins/ui_actions"
Expand Down
14 changes: 2 additions & 12 deletions docs/uptime-guide/security.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ PUT /_security/role/uptime
"allow_restricted_indices" : false
}
],
"applications" : [
{
"application" : "kibana-.kibana",
"privileges" : [
"all"
],
"resources" : [
"*"
]
}
],
"transient_metadata" : {
"enabled" : true
}
Expand All @@ -52,7 +41,8 @@ PUT /_security/role/uptime
[float]
=== Assign the role to a user

Next, you'll need to create a user with both the `kibana_user`, and `uptime` roles.
Next, you'll need to create a user with both the `uptime` role, and another role with sufficient {kibana-ref}/kibana-privileges.html[Kibana privileges],
such as the `kibana_user` role.
You can do this with the following request:

["source","sh",subs="attributes,callouts"]
Expand Down
4 changes: 2 additions & 2 deletions docs/user/reporting/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ for different operating systems.

. Open {kib} in your web browser and log in. If you are running {kib}
locally, go to `http://localhost:5601`. To access {kib} and generate
reports, you need the `kibana_user` and `reporting_user` roles. For more
information, see <<secure-reporting>>.
reports, you need the `reporting_user` role, and an additional role with succifient <<kibana-privileges, Kibana privileges>>, such as the `kibana_user` role.
For more information, see <<secure-reporting>>.

. Open the dashboard, visualization, or saved search you want to include
in the report.
Expand Down
2 changes: 1 addition & 1 deletion docs/user/security/reporting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ and `kibana_user` roles:
* If you're using the `native` realm, you can assign roles through
**Management / Users** UI in Kibana or with the `user` API. For example,
the following request creates a `reporter` user that has the
`reporting_user` and `kibana_user` roles:
`reporting_user` role, and another role with sufficient <<kibana-privileges, Kibana privileges>>, such as the `kibana_user` role:
+
[source, sh]
---------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/user/security/securing-kibana.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ user you've assigned a {kib} user role. For example, you could log in as the
+
--

NOTE: This must be a user who has been assigned the `kibana_user` role.
NOTE: This must be a user who has been assigned <<kibana-privileges, Kibana privileges>>.
{kib} server credentials should only be used internally by the {kib} server.

--
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"@elastic/charts": "^13.5.9",
"@elastic/datemath": "5.0.2",
"@elastic/ems-client": "1.0.5",
"@elastic/eui": "14.7.0",
"@elastic/eui": "14.8.0",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "8.1.1-kibana2",
"@elastic/numeral": "2.3.3",
Expand Down
53 changes: 27 additions & 26 deletions src/core/server/elasticsearch/elasticsearch_config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,33 @@ import { ElasticsearchConfig, config } from './elasticsearch_config';
test('set correct defaults', () => {
const configValue = new ElasticsearchConfig(config.schema.validate({}));
expect(configValue).toMatchInlineSnapshot(`
ElasticsearchConfig {
"apiVersion": "master",
"customHeaders": Object {},
"healthCheckDelay": "PT2.5S",
"hosts": Array [
"http://localhost:9200",
],
"logQueries": false,
"password": undefined,
"pingTimeout": "PT30S",
"requestHeadersWhitelist": Array [
"authorization",
],
"requestTimeout": "PT30S",
"shardTimeout": "PT30S",
"sniffInterval": false,
"sniffOnConnectionFault": false,
"sniffOnStart": false,
"ssl": Object {
"alwaysPresentCertificate": true,
"certificateAuthorities": undefined,
"verificationMode": "full",
},
"username": undefined,
}
`);
ElasticsearchConfig {
"apiVersion": "master",
"customHeaders": Object {},
"healthCheckDelay": "PT2.5S",
"hosts": Array [
"http://localhost:9200",
],
"ignoreVersionMismatch": false,
"logQueries": false,
"password": undefined,
"pingTimeout": "PT30S",
"requestHeadersWhitelist": Array [
"authorization",
],
"requestTimeout": "PT30S",
"shardTimeout": "PT30S",
"sniffInterval": false,
"sniffOnConnectionFault": false,
"sniffOnStart": false,
"ssl": Object {
"alwaysPresentCertificate": true,
"certificateAuthorities": undefined,
"verificationMode": "full",
},
"username": undefined,
}
`);
});

test('#hosts accepts both string and array of strings', () => {
Expand Down
7 changes: 7 additions & 0 deletions src/core/server/elasticsearch/elasticsearch_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const config = {
}),
apiVersion: schema.string({ defaultValue: DEFAULT_API_VERSION }),
healthCheck: schema.object({ delay: schema.duration({ defaultValue: 2500 }) }),
ignoreVersionMismatch: schema.boolean({ defaultValue: false }),
}),
};

Expand All @@ -74,6 +75,11 @@ export class ElasticsearchConfig {
*/
public readonly healthCheckDelay: Duration;

/**
* Whether to allow kibana to connect to a non-compatible elasticsearch node.
*/
public readonly ignoreVersionMismatch: boolean;

/**
* Version of the Elasticsearch (6.7, 7.1 or `master`) client will be connecting to.
*/
Expand Down Expand Up @@ -161,6 +167,7 @@ export class ElasticsearchConfig {
public readonly customHeaders: ElasticsearchConfigType['customHeaders'];

constructor(rawConfig: ElasticsearchConfigType) {
this.ignoreVersionMismatch = rawConfig.ignoreVersionMismatch;
this.apiVersion = rawConfig.apiVersion;
this.logQueries = rawConfig.logQueries;
this.hosts = Array.isArray(rawConfig.hosts) ? rawConfig.hosts : [rawConfig.hosts];
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import dateMath from '@elastic/datemath';
import { doesKueryExpressionHaveLuceneSyntaxError } from '@kbn/es-query';

import classNames from 'classnames';
import React, { useState, useEffect } from 'react';
import React, { useState } from 'react';

import {
EuiButton,
Expand Down Expand Up @@ -78,12 +78,10 @@ function QueryBarTopRowUI(props: Props) {
const kueryQuerySyntaxLink: string = docLinks!.links.query.kueryQuerySyntax;

const queryLanguage = props.query && props.query.language;
let persistedLog: PersistedLog | undefined;

useEffect(() => {
if (!props.query) return;
persistedLog = getQueryLog(uiSettings!, storage, appName, props.query.language);
}, [queryLanguage]);
const persistedLog: PersistedLog | undefined = React.useMemo(
() => (queryLanguage ? getQueryLog(uiSettings!, storage, appName, queryLanguage) : undefined),
[queryLanguage]
);

function onClickSubmitButton(event: React.MouseEvent<HTMLButtonElement>) {
if (persistedLog && props.query) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const SaveQueryForm: FunctionComponent<Props> = ({
setSavedQueries(sortedAllSavedQueries);
};
fetchQueries();
}, []);
}, [savedQueryService]);

const savedQueryDescriptionText = i18n.translate(
'data.search.searchBar.savedQueryDescriptionText',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const SavedQueryManagementComponent: FunctionComponent<Props> = ({
if (isOpen) {
fetchCountAndSavedQueries();
}
}, [isOpen, activePage]);
}, [isOpen, activePage, savedQueryService]);

const goToPage = (pageNumber: number) => {
setActivePage(pageNumber);
Expand Down
10 changes: 7 additions & 3 deletions src/legacy/core_plugins/elasticsearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,14 @@ export default function (kibana) {
createProxy(server);

// Set up the health check service and start it.
const { start, waitUntilReady } = healthCheck(this, server, esConfig.healthCheckDelay.asMilliseconds());
const { start, waitUntilReady } = healthCheck(
this,
server,
esConfig.healthCheckDelay.asMilliseconds(),
esConfig.ignoreVersionMismatch
);
server.expose('waitUntilReady', waitUntilReady);
start();
}
},
});

}
Loading

0 comments on commit 5e04ab8

Please sign in to comment.