Skip to content

Commit

Permalink
Merge branch 'kertal-2020-11-18-responsive-layout' of github.com:kert…
Browse files Browse the repository at this point in the history
…al/kibana into kertal-2020-11-18-responsive-layout
  • Loading branch information
kertal committed Dec 3, 2020
2 parents 0ebf5a7 + ee164b0 commit 6a8acc8
Show file tree
Hide file tree
Showing 71 changed files with 1,145 additions and 372 deletions.
2 changes: 1 addition & 1 deletion .ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# NOTE: This Dockerfile is ONLY used to run certain tasks in CI. It is not used to run Kibana or as a distributable.
# If you're looking for the Kibana Docker image distributable, please see: src/dev/build/tasks/os_packages/docker_generator/templates/dockerfile.template.ts

ARG NODE_VERSION=12.19.1
ARG NODE_VERSION=14.15.1

FROM node:${NODE_VERSION} AS base

Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.19.1
14.15.1
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.19.1
14.15.1
2 changes: 1 addition & 1 deletion docs/api/using-api.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ For all APIs, you must use a request header. The {kib} APIs support the `kbn-xsr
By default, you must use `kbn-xsrf` for all API calls, except in the following scenarios:

* The API endpoint uses the `GET` or `HEAD` operations
* The path is whitelisted using the <<settings-xsrf-whitelist, `server.xsrf.whitelist`>> setting
* The path is allowed using the <<settings-xsrf-allowlist, `server.xsrf.allowlist`>> setting
* XSRF protections are disabled using the <<settings-xsrf-disableProtection, `server.xsrf.disableProtection`>> setting

`Content-Type: application/json`::
Expand Down
2 changes: 1 addition & 1 deletion docs/apm/api.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ users interacting with APM APIs must have <<apm-app-api-user,sufficient privileg
By default, you must use `kbn-xsrf` for all API calls, except in the following scenarios:

* The API endpoint uses the `GET` or `HEAD` operations
* The path is whitelisted using the <<settings-xsrf-whitelist, `server.xsrf.whitelist`>> setting
* The path is allowed using the <<settings-xsrf-allowlist, `server.xsrf.allowlist`>> setting
* XSRF protections are disabled using the <<settings-xsrf-disableProtection, `server.xsrf.disableProtection`>> setting

`Content-Type: application/json`::
Expand Down
4 changes: 2 additions & 2 deletions docs/setup/settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -575,10 +575,10 @@ all http requests to https over the port configured as <<server-port, `server.po
| An array of supported protocols with versions.
Valid protocols: `TLSv1`, `TLSv1.1`, `TLSv1.2`, `TLSv1.3`. *Default: TLSv1.1, TLSv1.2, TLSv1.3*

| [[settings-xsrf-whitelist]] `server.xsrf.whitelist:`
| [[settings-xsrf-allowlist]] `server.xsrf.allowlist:`
| It is not recommended to disable protections for
arbitrary API endpoints. Instead, supply the `kbn-xsrf` header.
The <<settings-xsrf-whitelist, `server.xsrf.whitelist`>> setting requires the following format:
The <<settings-xsrf-allowlist, `server.xsrf.allowlist`>> setting requires the following format:

|===

Expand Down
14 changes: 6 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"**/@types/hapi__boom": "^7.4.1",
"**/@types/hapi__hapi": "^18.2.6",
"**/@types/hapi__mimos": "4.1.0",
"**/@types/node": "12.19.4",
"**/@types/node": "14.14.7",
"**/cross-fetch/node-fetch": "^2.6.1",
"**/deepmerge": "^4.2.2",
"**/fast-deep-equal": "^3.1.1",
Expand All @@ -98,7 +98,7 @@
"**/typescript": "4.1.2"
},
"engines": {
"node": "12.19.1",
"node": "14.15.1",
"yarn": "^1.21.1"
},
"dependencies": {
Expand All @@ -109,7 +109,7 @@
"@elastic/ems-client": "7.11.0",
"@elastic/eui": "30.2.0",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "8.1.1-kibana2",
"@elastic/good": "^9.0.1-kibana3",
"@elastic/node-crypto": "1.2.1",
"@elastic/numeral": "^2.5.0",
"@elastic/request-crypto": "1.1.4",
Expand Down Expand Up @@ -496,7 +496,7 @@
"@types/mustache": "^0.8.31",
"@types/ncp": "^2.0.1",
"@types/nock": "^10.0.3",
"@types/node": "12.19.4",
"@types/node": "14.14.7",
"@types/node-fetch": "^2.5.7",
"@types/node-forge": "^0.9.5",
"@types/nodemailer": "^6.4.0",
Expand Down Expand Up @@ -525,7 +525,6 @@
"@types/react-resize-detector": "^4.0.1",
"@types/react-router": "^5.1.7",
"@types/react-router-dom": "^5.1.5",
"@types/react-sticky": "^6.0.3",
"@types/react-test-renderer": "^16.9.1",
"@types/react-virtualized": "^9.18.7",
"@types/read-pkg": "^4.0.0",
Expand Down Expand Up @@ -722,7 +721,7 @@
"less": "npm:@elastic/[email protected]",
"license-checker": "^16.0.0",
"listr": "^0.14.1",
"lmdb-store": "^0.8.15",
"lmdb-store": "^0.9.0",
"load-grunt-config": "^3.0.1",
"loader-utils": "^1.2.3",
"log-symbols": "^2.2.0",
Expand Down Expand Up @@ -782,7 +781,6 @@
"react-router-redux": "^4.0.8",
"react-shortcuts": "^2.0.0",
"react-sizeme": "^2.3.6",
"react-sticky": "^6.0.3",
"react-syntax-highlighter": "^5.7.0",
"react-test-renderer": "^16.12.0",
"react-tiny-virtual-list": "^2.2.0",
Expand All @@ -805,7 +803,7 @@
"sass-resources-loader": "^2.0.1",
"selenium-webdriver": "^4.0.0-alpha.7",
"serve-static": "1.14.1",
"shelljs": "^0.8.3",
"shelljs": "^0.8.4",
"simple-git": "1.116.0",
"sinon": "^7.4.2",
"spawn-sync": "^1.0.15",
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 @@ -96,7 +96,7 @@ describe('#get', () => {
someNotSupportedValue: 'val',
xsrf: {
disableProtection: false,
whitelist: [],
allowlist: [],
},
},
});
Expand All @@ -119,7 +119,7 @@ describe('#get', () => {
someNotSupportedValue: 'val',
xsrf: {
disableProtection: false,
whitelist: [],
allowlist: [],
},
},
});
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-legacy-logging/src/setup_logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

// @ts-expect-error missing typedef
import good from '@elastic/good';
import { plugin as good } from '@elastic/good';
import { Server } from '@hapi/hapi';
import { LegacyLoggingConfig } from './schema';
import { getLoggingConfiguration } from './get_logging_config';
Expand Down
3 changes: 2 additions & 1 deletion packages/kbn-pm/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
],
"plugins": [
"@babel/proposal-class-properties",
"@babel/proposal-object-rest-spread"
"@babel/proposal-object-rest-spread",
"@babel/proposal-optional-chaining"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* tries to mock out simple versions of the Mocha types
*/

import EventEmitter from 'events';
import { EventEmitter } from 'events';

export interface Suite {
suites: Suite[];
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-utils/src/streams/reduce_stream.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('reduceStream', () => {
const errorStub = jest.fn();
reduce$.on('data', dataStub);
reduce$.on('error', errorStub);
const endEvent = promiseFromEvent('end', reduce$);
const closeEvent = promiseFromEvent('close', reduce$);

reduce$.write(1);
reduce$.write(2);
Expand All @@ -79,7 +79,7 @@ describe('reduceStream', () => {
reduce$.write(1000);
reduce$.end();

await endEvent;
await closeEvent;
expect(reducer).toHaveBeenCalledTimes(3);
expect(dataStub).toHaveBeenCalledTimes(0);
expect(errorStub).toHaveBeenCalledTimes(1);
Expand Down
2 changes: 1 addition & 1 deletion src/cli/cluster/cluster.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/* eslint-env jest */

// eslint-disable-next-line max-classes-per-file
import EventEmitter from 'events';
import { EventEmitter } from 'events';
import { assign, random } from 'lodash';
import { delay } from 'bluebird';

Expand Down
19 changes: 12 additions & 7 deletions src/cli/repl/__snapshots__/repl.test.js.snap

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

2 changes: 1 addition & 1 deletion src/core/public/utils/crypto/sha256.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class Sha256 {
return this;
}

digest(encoding: string): string {
digest(encoding: BufferEncoding): string {
// Suppose the length of the message M, in bits, is l
const l = this._len * 8;

Expand Down
5 changes: 3 additions & 2 deletions src/core/server/config/deprecation/core_deprecations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,13 @@ describe('core deprecations', () => {

describe('xsrfDeprecation', () => {
it('logs a warning if server.xsrf.whitelist is set', () => {
const { messages } = applyCoreDeprecations({
const { migrated, messages } = applyCoreDeprecations({
server: { xsrf: { whitelist: ['/path'] } },
});
expect(migrated.server.xsrf.allowlist).toEqual(['/path']);
expect(messages).toMatchInlineSnapshot(`
Array [
"It is not recommended to disable xsrf protections for API endpoints via [server.xsrf.whitelist]. It will be removed in 8.0 release. Instead, supply the \\"kbn-xsrf\\" header.",
"\\"server.xsrf.whitelist\\" is deprecated and has been replaced by \\"server.xsrf.allowlist\\"",
]
`);
});
Expand Down
12 changes: 1 addition & 11 deletions src/core/server/config/deprecation/core_deprecations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@ const dataPathDeprecation: ConfigDeprecation = (settings, fromPath, log) => {
return settings;
};

const xsrfDeprecation: ConfigDeprecation = (settings, fromPath, log) => {
if ((settings.server?.xsrf?.whitelist ?? []).length > 0) {
log(
'It is not recommended to disable xsrf protections for API endpoints via [server.xsrf.whitelist]. ' +
'It will be removed in 8.0 release. Instead, supply the "kbn-xsrf" header.'
);
}
return settings;
};

const rewriteBasePathDeprecation: ConfigDeprecation = (settings, fromPath, log) => {
if (has(settings, 'server.basePath') && !has(settings, 'server.rewriteBasePath')) {
log(
Expand Down Expand Up @@ -140,10 +130,10 @@ export const coreDeprecationProvider: ConfigDeprecationProvider = ({ rename, unu
unusedFromRoot('elasticsearch.startupTimeout'),
rename('cpu.cgroup.path.override', 'ops.cGroupOverrides.cpuPath'),
rename('cpuacct.cgroup.path.override', 'ops.cGroupOverrides.cpuAcctPath'),
rename('server.xsrf.whitelist', 'server.xsrf.allowlist'),
configPathDeprecation,
dataPathDeprecation,
rewriteBasePathDeprecation,
cspRulesDeprecation,
mapManifestServiceUrlDeprecation,
xsrfDeprecation,
];
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const createStartContractMock = () => {
},
xsrf: {
disableProtection: false,
whitelistConfigured: false,
allowlistConfigured: false,
},
},
logging: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ describe('CoreUsageDataService', () => {
"truststoreConfigured": false,
},
"xsrf": Object {
"allowlistConfigured": false,
"disableProtection": false,
"whitelistConfigured": false,
},
},
"logging": Object {
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/core_usage_data/core_usage_data_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export class CoreUsageDataService implements CoreService<void, CoreUsageDataStar
},
xsrf: {
disableProtection: http.xsrf.disableProtection,
whitelistConfigured: isConfigured.array(http.xsrf.whitelist),
allowlistConfigured: isConfigured.array(http.xsrf.allowlist),
},
requestId: {
allowFromAnyIp: http.requestId.allowFromAnyIp,
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/core_usage_data/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export interface CoreConfigUsageData {
};
xsrf: {
disableProtection: boolean;
whitelistConfigured: boolean;
allowlistConfigured: boolean;
};
requestId: {
allowFromAnyIp: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { TransportRequestParams, RequestBody } from '@elastic/elasticsearch/lib/

import { parseClientOptionsMock, ClientMock } from './configure_client.test.mocks';
import { loggingSystemMock } from '../../logging/logging_system.mock';
import EventEmitter from 'events';
import { EventEmitter } from 'events';
import type { ElasticsearchClientConfig } from './client_config';
import { configureClient } from './configure_client';

Expand Down

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

2 changes: 1 addition & 1 deletion src/core/server/http/cookie_session_storage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ configService.atPath.mockReturnValue(
compression: { enabled: true },
xsrf: {
disableProtection: true,
whitelist: [],
allowlist: [],
},
customResponseHeaders: {},
requestId: {
Expand Down
Loading

0 comments on commit 6a8acc8

Please sign in to comment.