Skip to content

Commit 6e5c874

Browse files
committed
Merge branch '50397-refactor-log-filters' of github.com:Zacqary/kibana into 50397-refactor-log-filters
2 parents 9c39286 + 783f9ab commit 6e5c874

File tree

4,911 files changed

+104194
-88985
lines changed

Some content is hidden

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

4,911 files changed

+104194
-88985
lines changed

.eslintrc.js

Lines changed: 44 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -197,46 +197,6 @@ module.exports = {
197197
},
198198
},
199199

200-
/**
201-
* Prettier
202-
*/
203-
{
204-
files: [
205-
'.eslintrc.js',
206-
'packages/kbn-utility-types/**/*',
207-
'packages/kbn-eslint-plugin-eslint/**/*',
208-
'packages/kbn-config-schema/**/*',
209-
'packages/kbn-pm/**/*',
210-
'packages/kbn-es/**/*',
211-
'packages/elastic-datemath/**/*',
212-
'packages/kbn-i18n/**/*',
213-
'packages/kbn-dev-utils/**/*',
214-
'packages/kbn-plugin-helpers/**/*',
215-
'packages/kbn-plugin-generator/**/*',
216-
'packages/kbn-test-subj-selector/**/*',
217-
'packages/kbn-test/**/*',
218-
'packages/kbn-eslint-import-resolver-kibana/**/*',
219-
'src/legacy/server/saved_objects/**/*',
220-
'x-pack/legacy/plugins/apm/**/*',
221-
'x-pack/legacy/plugins/canvas/**/*',
222-
'**/*.{ts,tsx}',
223-
'src/legacy/core_plugins/metrics/**/*.js',
224-
],
225-
plugins: ['prettier'],
226-
rules: Object.assign(
227-
{
228-
'prettier/prettier': [
229-
'error',
230-
{
231-
endOfLine: 'auto',
232-
},
233-
],
234-
},
235-
require('eslint-config-prettier').rules,
236-
require('eslint-config-prettier/react').rules
237-
),
238-
},
239-
240200
/**
241201
* Files that require Apache 2.0 headers, settings
242202
* are overridden below for files that require Elastic
@@ -297,7 +257,8 @@ module.exports = {
297257
'src/legacy/**/*',
298258
'x-pack/**/*',
299259
'!x-pack/**/*.test.*',
300-
'src/plugins/**/(public|server)/**/*',
260+
'!x-pack/test/**/*',
261+
'(src|x-pack)/plugins/**/(public|server)/**/*',
301262
'src/core/(public|server)/**/*',
302263
],
303264
from: [
@@ -317,16 +278,35 @@ module.exports = {
317278
'!src/core/server/types',
318279
'!src/core/server/*.test.mocks.ts',
319280

320-
'src/plugins/**/public/**/*',
321-
'!src/plugins/**/public/index.{js,ts,tsx}',
322-
323-
'src/plugins/**/server/**/*',
324-
'!src/plugins/**/server/index.{js,ts,tsx}',
281+
'(src|x-pack)/plugins/**/(public|server)/**/*',
282+
'!(src|x-pack)/plugins/**/(public|server)/(index|mocks).{js,ts,tsx}',
325283
],
326284
allowSameFolder: true,
285+
errorMessage: 'Plugins may only import from top-level public and server modules.',
327286
},
328287
{
329-
target: ['src/core/**/*'],
288+
target: [
289+
'(src|x-pack)/plugins/**/*',
290+
'!(src|x-pack)/plugins/*/server/**/*',
291+
292+
'src/legacy/core_plugins/**/*',
293+
'!src/legacy/core_plugins/*/server/**/*',
294+
'!src/legacy/core_plugins/*/index.{js,ts,tsx}',
295+
296+
'x-pack/legacy/plugins/**/*',
297+
'!x-pack/legacy/plugins/*/server/**/*',
298+
'!x-pack/legacy/plugins/*/index.{js,ts,tsx}',
299+
],
300+
from: [
301+
'src/core/server',
302+
'src/core/server/**/*',
303+
'(src|x-pack)/plugins/*/server/**/*',
304+
],
305+
errorMessage:
306+
'Server modules cannot be imported into client modules or shared modules.',
307+
},
308+
{
309+
target: ['src/**/*'],
330310
from: ['x-pack/**/*'],
331311
errorMessage: 'OSS cannot import x-pack files.',
332312
},
@@ -340,6 +320,11 @@ module.exports = {
340320
],
341321
errorMessage: 'The core cannot depend on any plugins.',
342322
},
323+
{
324+
target: ['(src|x-pack)/plugins/*/public/**/*'],
325+
from: ['ui/**/*', 'uiExports/**/*'],
326+
errorMessage: 'Plugins cannot import legacy UI code.',
327+
},
343328
{
344329
from: ['src/legacy/ui/**/*', 'ui/**/*'],
345330
target: [
@@ -700,8 +685,6 @@ module.exports = {
700685
'accessor-pairs': 'error',
701686
'array-callback-return': 'error',
702687
'no-array-constructor': 'error',
703-
// This will be turned on after bug fixes are mostly completed
704-
// 'arrow-body-style': ['warn', 'as-needed'],
705688
complexity: 'warn',
706689
// This will be turned on after bug fixes are mostly completed
707690
// 'consistent-return': 'warn',
@@ -731,7 +714,6 @@ module.exports = {
731714
'no-extra-bind': 'error',
732715
'no-extra-boolean-cast': 'error',
733716
'no-extra-label': 'error',
734-
'no-floating-decimal': 'error',
735717
'no-func-assign': 'error',
736718
'no-implicit-globals': 'error',
737719
'no-implied-eval': 'error',
@@ -772,8 +754,6 @@ module.exports = {
772754
'prefer-spread': 'error',
773755
// This style will be turned on after most bugs are fixed
774756
// 'prefer-template': 'warn',
775-
// This style will be turned on after most bugs are fixed
776-
// quotes: ['warn', 'single', { avoidEscape: true }],
777757
'react/boolean-prop-naming': 'error',
778758
'react/button-has-type': 'error',
779759
'react/forbid-dom-props': 'error',
@@ -809,13 +789,10 @@ module.exports = {
809789
'react/jsx-sort-default-props': 'error',
810790
// might be introduced after the other warns are fixed
811791
// 'react/jsx-sort-props': 'error',
812-
'react/jsx-tag-spacing': 'error',
813792
// might be introduced after the other warns are fixed
814793
'react-hooks/exhaustive-deps': 'off',
815794
'require-atomic-updates': 'error',
816-
'rest-spread-spacing': ['error', 'never'],
817795
'symbol-description': 'error',
818-
'template-curly-spacing': 'error',
819796
'vars-on-top': 'error',
820797
},
821798
},
@@ -850,8 +827,6 @@ module.exports = {
850827
{
851828
files: ['x-pack/legacy/plugins/monitoring/**/*.js'],
852829
rules: {
853-
'block-spacing': ['error', 'always'],
854-
curly: ['error', 'all'],
855830
'no-unused-vars': ['error', { args: 'all', argsIgnorePattern: '^_' }],
856831
'no-else-return': 'error',
857832
},
@@ -868,7 +843,6 @@ module.exports = {
868843
files: ['x-pack/legacy/plugins/canvas/**/*.js'],
869844
rules: {
870845
radix: 'error',
871-
curly: ['error', 'all'],
872846

873847
// module importing
874848
'import/order': [
@@ -886,7 +860,6 @@ module.exports = {
886860
'react/self-closing-comp': 'error',
887861
'react/sort-comp': 'error',
888862
'react/jsx-boolean-value': 'error',
889-
'react/jsx-wrap-multilines': 'error',
890863
'react/no-unescaped-entities': ['error', { forbid: ['>', '}'] }],
891864
'react/forbid-elements': [
892865
'error',
@@ -963,5 +936,17 @@ module.exports = {
963936
'import/no-default-export': 'error',
964937
},
965938
},
939+
940+
/**
941+
* Prettier disables all conflicting rules, listing as last override so it takes precedence
942+
*/
943+
{
944+
files: ['**/*'],
945+
rules: {
946+
...require('eslint-config-prettier').rules,
947+
...require('eslint-config-prettier/react').rules,
948+
...require('eslint-config-prettier/@typescript-eslint').rules,
949+
},
950+
},
966951
],
967952
};

.github/CODEOWNERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,20 +80,19 @@
8080
/x-pack/plugins/licensing/ @elastic/kibana-platform
8181
/packages/kbn-config-schema/ @elastic/kibana-platform
8282
/src/legacy/server/config/ @elastic/kibana-platform
83-
/src/legacy/server/csp/ @elastic/kibana-platform
8483
/src/legacy/server/http/ @elastic/kibana-platform
8584
/src/legacy/server/i18n/ @elastic/kibana-platform
8685
/src/legacy/server/logging/ @elastic/kibana-platform
8786
/src/legacy/server/saved_objects/ @elastic/kibana-platform
8887
/src/legacy/server/status/ @elastic/kibana-platform
8988

9089
# Security
90+
/src/core/server/csp/ @elastic/kibana-security @elastic/kibana-platform
9191
/x-pack/legacy/plugins/security/ @elastic/kibana-security
9292
/x-pack/legacy/plugins/spaces/ @elastic/kibana-security
9393
/x-pack/plugins/spaces/ @elastic/kibana-security
9494
/x-pack/legacy/plugins/encrypted_saved_objects/ @elastic/kibana-security
9595
/x-pack/plugins/encrypted_saved_objects/ @elastic/kibana-security
96-
/src/legacy/server/csp/ @elastic/kibana-security
9796
/x-pack/plugins/security/ @elastic/kibana-security
9897
/x-pack/test/api_integration/apis/security/ @elastic/kibana-security
9998

.i18nrc.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44
"console": "src/legacy/core_plugins/console",
55
"core": "src/core",
66
"dashboardEmbeddableContainer": "src/plugins/dashboard_embeddable_container",
7-
"data": ["src/legacy/core_plugins/data", "src/plugins/data"],
7+
"data": [
8+
"src/legacy/core_plugins/data",
9+
"src/plugins/data"
10+
],
811
"embeddableApi": "src/plugins/embeddable",
12+
"embeddableExamples": "examples/embeddable_examples",
913
"share": "src/plugins/share",
1014
"esUi": "src/plugins/es_ui_shared",
1115
"devTools": "src/plugins/dev_tools",
@@ -21,7 +25,7 @@
2125
"kibana_react": "src/legacy/core_plugins/kibana_react",
2226
"kibana-react": "src/plugins/kibana_react",
2327
"kibana_utils": "src/plugins/kibana_utils",
24-
"navigation": "src/legacy/core_plugins/navigation",
28+
"navigation": "src/plugins/navigation",
2529
"newsfeed": "src/plugins/newsfeed",
2630
"regionMap": "src/legacy/core_plugins/region_map",
2731
"server": "src/legacy/server",
@@ -36,8 +40,13 @@
3640
"visTypeTagCloud": "src/legacy/core_plugins/vis_type_tagcloud",
3741
"visTypeTimeseries": "src/legacy/core_plugins/vis_type_timeseries",
3842
"visTypeVega": "src/legacy/core_plugins/vis_type_vega",
39-
"visualizations": ["src/plugins/visualizations", "src/legacy/core_plugins/visualizations"]
43+
"visualizations": [
44+
"src/plugins/visualizations",
45+
"src/legacy/core_plugins/visualizations"
46+
]
4047
},
41-
"exclude": ["src/legacy/ui/ui_render/ui_render_mixin.js"],
48+
"exclude": [
49+
"src/legacy/ui/ui_render/ui_render_mixin.js"
50+
],
4251
"translations": []
43-
}
52+
}

Gruntfile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
require('./src/setup_node_env');
2121

22-
module.exports = function (grunt) {
22+
module.exports = function(grunt) {
2323
// set the config once before calling load-grunt-config
2424
// and once during so that we have access to it via
2525
// grunt.config.get() within the config files
@@ -35,8 +35,8 @@ module.exports = function (grunt) {
3535
init: true,
3636
config: config,
3737
loadGruntTasks: {
38-
pattern: ['grunt-*', '@*/grunt-*', 'gruntify-*', '@*/gruntify-*']
39-
}
38+
pattern: ['grunt-*', '@*/grunt-*', 'gruntify-*', '@*/gruntify-*'],
39+
},
4040
});
4141

4242
// load task definitions

docs/api/spaces-management/post.asciidoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@ experimental["The underlying Spaces concepts are stable, but the APIs for managi
1616
[[spaces-api-post-request-body]]
1717
==== Request body
1818

19-
`id`::
19+
`id`::
2020
(Required, string) The space ID that is part of the Kibana URL when inside the space. You are unable to change the ID with the update operation.
2121

22-
`name`::
22+
`name`::
2323
(Required, string) The display name for the space.
2424

25-
`description`::
25+
`description`::
2626
(Optional, string) The description for the space.
2727

28-
`disabledFeatures`::
28+
`disabledFeatures`::
2929
(Optional, string array) The list of disabled features for the space. To get a list of available feature IDs, use the <<features-api-get, Features API>>.
3030

31-
`initials`::
31+
`initials`::
3232
(Optional, string) Specifies the initials shown in the space avatar. By default, the initials are automatically generated from the space name. Initials must be 1 or 2 characters.
3333

34-
`color`::
34+
`color`::
3535
(Optional, string) Specifies the hexadecimal color code used in the space avatar. By default, the color is automatically generated from the space name.
3636

37-
`imageUrl`::
37+
`imageUrl`::
3838
(Optional, string) Specifies the data-url encoded image to display in the space avatar. If specified, `initials` will not be displayed, and the `color` will be visible as the background color for transparent images.
3939
For best results, your image should be 64x64. Images will not be optimized by this API call, so care should be taken when using custom images.
40-
40+
4141
[[spaces-api-post-response-codes]]
4242
==== Response codes
4343

docs/api/using-api.asciidoc

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[[using-api]]
22
== Using the APIs
33

4-
Interact with the {kib} APIs through the `curl` command and HTTP and HTTPs protocols.
4+
Interact with the {kib} APIs through the `curl` command and HTTP and HTTPs protocols.
55

66
It is recommended that you use HTTPs on port 5601 because it is more secure.
77

@@ -34,13 +34,37 @@ For example, the following `curl` command exports a dashboard:
3434
curl -X POST -u $USER:$PASSWORD "localhost:5601/api/kibana/dashboards/export?dashboard=942dcef0-b2cd-11e8-ad8e-85441f0c2e5c"
3535
--
3636

37-
The following {kib} APIs are available:
37+
[float]
38+
[[api-request-headers]]
39+
=== Request headers
40+
41+
For all APIs, you must use a request header. The {kib} APIs support the `kbn-xsrf` and `Content-Type` headers.
42+
43+
`kbn-xsrf: true`::
44+
By default, you must use `kbn-xsrf` for all API calls, except in the following scenarios:
45+
46+
* The API endpoint uses the `GET` or `HEAD` methods
47+
48+
* The path is whitelisted using the <<settings, `server.xsrf.whitelist`>> setting
49+
50+
* XSRF protections are disabled using the `server.xsrf.disableProtection` setting
3851

39-
* <<features-api-get, Get features API>>
40-
* <<spaces-api, Kibana spaces API>>
41-
* <<role-management-api, Kibana role management APIs>>
42-
* <<saved-objects-api, Saved objects APIs>>
43-
* <<dashboard-api, Import and export dashboards APIs>>
44-
* <<logstash-configuration-management-api, Logstash configuration mangaement APIs>>
45-
* <<url-shortening-api, Shorten URL API>>
46-
* <<upgrade-assistant-api, Upgrade assistant APIs>>
52+
`Content-Type: application/json`::
53+
Applicable only when you send a payload in the API request. {kib} API requests and responses use JSON. Typically, if you include the `kbn-xsrf` header, you must also include the `Content-Type` header.
54+
55+
Request header example:
56+
57+
[source,sh]
58+
--
59+
curl -X POST \
60+
http://localhost:5601/api/spaces/space \
61+
-H 'Content-Type: application/json' \
62+
-H 'kbn-xsrf: true' \
63+
-d '{
64+
"id": "sales",
65+
"name": "Sales",
66+
"description": "This is your Sales Space!",
67+
"disabledFeatures": []
68+
}
69+
'
70+
--

docs/apm/settings.asciidoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Do not link directly to this page.
2+
// Link to the anchor in `/docs/settings/apm-settings.asciidoc` instead.
3+
[[apm-settings-in-kibana]]
4+
=== APM settings in Kibana
5+
6+
You do not need to configure any settings to use APM. It is enabled by default.
7+
If you'd like to change any of the default values,
8+
copy and paste the relevant settings below into your `kibana.yml` configuration file.
9+
10+
include::./../settings/apm-settings.asciidoc[tag=general-apm-settings]

0 commit comments

Comments
 (0)