Skip to content

Commit 3011e16

Browse files
Merge branch 'master' into feature/host-isolation-exception-artifact-generation
2 parents 9a14580 + 4dcb09d commit 3011e16

File tree

313 files changed

+4103
-16558
lines changed

Some content is hidden

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

313 files changed

+4103
-16558
lines changed

docs/settings/spaces-settings.asciidoc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77

88
By default, spaces is enabled in {kib}. To secure spaces, <<security-settings-kb,enable security>>.
99

10-
`xpack.spaces.enabled`::
11-
deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported and it will not be possible to disable this plugin."]
12-
To enable spaces, set to `true`.
13-
The default is `true`.
14-
1510
`xpack.spaces.maxSpaces`::
1611
The maximum number of spaces that you can use with the {kib} instance. Some {kib} operations
1712
return all spaces using a single `_search` from {es}, so you must

docs/spaces/index.asciidoc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,6 @@ image::images/spaces-configure-landing-page.png["Configure space-level landing p
109109

110110
[float]
111111
[[spaces-delete-started]]
112-
=== Disable and version updates
113-
114-
Spaces are automatically enabled in {kib}. If you don't want use this feature,
115-
you can disable it. For more information, refer to <<spaces-settings-kb,Spaces settings in {kib}>>.
116-
117-
When you upgrade {kib}, the default space contains all of your existing saved objects.
118-
112+
=== Disabling spaces
119113

114+
Starting in {kib} 8.0, the Spaces feature cannot be disabled.

src/core/server/elasticsearch/elasticsearch_config.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ describe('deprecations', () => {
322322
const { messages } = applyElasticsearchDeprecations({ username: 'elastic' });
323323
expect(messages).toMatchInlineSnapshot(`
324324
Array [
325-
"Setting [${CONFIG_PATH}.username] to \\"elastic\\" is deprecated. You should use the \\"kibana_system\\" user instead.",
325+
"Kibana is configured to authenticate to Elasticsearch with the \\"elastic\\" user. Use a service account token instead.",
326326
]
327327
`);
328328
});
@@ -331,7 +331,7 @@ describe('deprecations', () => {
331331
const { messages } = applyElasticsearchDeprecations({ username: 'kibana' });
332332
expect(messages).toMatchInlineSnapshot(`
333333
Array [
334-
"Setting [${CONFIG_PATH}.username] to \\"kibana\\" is deprecated. You should use the \\"kibana_system\\" user instead.",
334+
"Kibana is configured to authenticate to Elasticsearch with the \\"kibana\\" user. Use a service account token instead.",
335335
]
336336
`);
337337
});
@@ -350,7 +350,7 @@ describe('deprecations', () => {
350350
const { messages } = applyElasticsearchDeprecations({ ssl: { key: '' } });
351351
expect(messages).toMatchInlineSnapshot(`
352352
Array [
353-
"Setting [${CONFIG_PATH}.ssl.key] without [${CONFIG_PATH}.ssl.certificate] is deprecated. This has no effect, you should use both settings to enable TLS client authentication to Elasticsearch.",
353+
"Use both \\"elasticsearch.ssl.key\\" and \\"elasticsearch.ssl.certificate\\" to enable Kibana to use Mutual TLS authentication with Elasticsearch.",
354354
]
355355
`);
356356
});
@@ -359,7 +359,7 @@ describe('deprecations', () => {
359359
const { messages } = applyElasticsearchDeprecations({ ssl: { certificate: '' } });
360360
expect(messages).toMatchInlineSnapshot(`
361361
Array [
362-
"Setting [${CONFIG_PATH}.ssl.certificate] without [${CONFIG_PATH}.ssl.key] is deprecated. This has no effect, you should use both settings to enable TLS client authentication to Elasticsearch.",
362+
"Use both \\"elasticsearch.ssl.certificate\\" and \\"elasticsearch.ssl.key\\" to enable Kibana to use Mutual TLS authentication with Elasticsearch.",
363363
]
364364
`);
365365
});

src/core/server/elasticsearch/elasticsearch_config.ts

Lines changed: 60 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import { schema, TypeOf } from '@kbn/config-schema';
1010
import { readPkcs12Keystore, readPkcs12Truststore } from '@kbn/crypto';
11+
import { i18n } from '@kbn/i18n';
1112
import { Duration } from 'moment';
1213
import { readFileSync } from 'fs';
1314
import { ConfigDeprecationProvider } from 'src/core/server';
@@ -171,49 +172,82 @@ export const configSchema = schema.object({
171172
});
172173

173174
const deprecations: ConfigDeprecationProvider = () => [
174-
(settings, fromPath, addDeprecation) => {
175+
(settings, fromPath, addDeprecation, { branch }) => {
175176
const es = settings[fromPath];
176177
if (!es) {
177178
return;
178179
}
179-
if (es.username === 'elastic') {
180-
addDeprecation({
181-
configPath: `${fromPath}.username`,
182-
message: `Setting [${fromPath}.username] to "elastic" is deprecated. You should use the "kibana_system" user instead.`,
183-
correctiveActions: {
184-
manualSteps: [`Replace [${fromPath}.username] from "elastic" to "kibana_system".`],
185-
},
186-
});
187-
} else if (es.username === 'kibana') {
180+
181+
if (es.username === 'elastic' || es.username === 'kibana') {
182+
const username = es.username;
188183
addDeprecation({
189184
configPath: `${fromPath}.username`,
190-
message: `Setting [${fromPath}.username] to "kibana" is deprecated. You should use the "kibana_system" user instead.`,
191-
correctiveActions: {
192-
manualSteps: [`Replace [${fromPath}.username] from "kibana" to "kibana_system".`],
193-
},
194-
});
195-
}
196-
if (es.ssl?.key !== undefined && es.ssl?.certificate === undefined) {
197-
addDeprecation({
198-
configPath: `${fromPath}.ssl.key`,
199-
message: `Setting [${fromPath}.ssl.key] without [${fromPath}.ssl.certificate] is deprecated. This has no effect, you should use both settings to enable TLS client authentication to Elasticsearch.`,
185+
title: i18n.translate('core.deprecations.elasticsearchUsername.title', {
186+
defaultMessage: 'Using "elasticsearch.username: {username}" is deprecated',
187+
values: { username },
188+
}),
189+
message: i18n.translate('core.deprecations.elasticsearchUsername.message', {
190+
defaultMessage:
191+
'Kibana is configured to authenticate to Elasticsearch with the "{username}" user. Use a service account token instead.',
192+
values: { username },
193+
}),
194+
level: 'warning',
195+
documentationUrl: `https://www.elastic.co/guide/en/elasticsearch/reference/${branch}/service-accounts.html`,
200196
correctiveActions: {
201197
manualSteps: [
202-
`Set [${fromPath}.ssl.certificate] in your kibana configs to enable TLS client authentication to Elasticsearch.`,
198+
i18n.translate('core.deprecations.elasticsearchUsername.manualSteps1', {
199+
defaultMessage:
200+
'Use the elasticsearch-service-tokens CLI tool to create a new service account token for the "elastic/kibana" service account.',
201+
}),
202+
i18n.translate('core.deprecations.elasticsearchUsername.manualSteps2', {
203+
defaultMessage: 'Add the "elasticsearch.serviceAccountToken" setting to kibana.yml.',
204+
}),
205+
i18n.translate('core.deprecations.elasticsearchUsername.manualSteps3', {
206+
defaultMessage:
207+
'Remove "elasticsearch.username" and "elasticsearch.password" from kibana.yml.',
208+
}),
203209
],
204210
},
205211
});
206-
} else if (es.ssl?.certificate !== undefined && es.ssl?.key === undefined) {
212+
}
213+
214+
const addSslDeprecation = (existingSetting: string, missingSetting: string) => {
207215
addDeprecation({
208-
configPath: `${fromPath}.ssl.certificate`,
209-
message: `Setting [${fromPath}.ssl.certificate] without [${fromPath}.ssl.key] is deprecated. This has no effect, you should use both settings to enable TLS client authentication to Elasticsearch.`,
216+
configPath: existingSetting,
217+
title: i18n.translate('core.deprecations.elasticsearchSSL.title', {
218+
defaultMessage: 'Using "{existingSetting}" without "{missingSetting}" has no effect',
219+
values: { existingSetting, missingSetting },
220+
}),
221+
message: i18n.translate('core.deprecations.elasticsearchSSL.message', {
222+
defaultMessage:
223+
'Use both "{existingSetting}" and "{missingSetting}" to enable Kibana to use Mutual TLS authentication with Elasticsearch.',
224+
values: { existingSetting, missingSetting },
225+
}),
226+
level: 'warning',
227+
documentationUrl: `https://www.elastic.co/guide/en/kibana/${branch}/elasticsearch-mutual-tls.html`,
210228
correctiveActions: {
211229
manualSteps: [
212-
`Set [${fromPath}.ssl.key] in your kibana configs to enable TLS client authentication to Elasticsearch.`,
230+
i18n.translate('core.deprecations.elasticsearchSSL.manualSteps1', {
231+
defaultMessage: 'Add the "{missingSetting}" setting to kibana.yml.',
232+
values: { missingSetting },
233+
}),
234+
i18n.translate('core.deprecations.elasticsearchSSL.manualSteps2', {
235+
defaultMessage:
236+
'Alternatively, if you don\'t want to use Mutual TLS authentication, remove "{existingSetting}" from kibana.yml.',
237+
values: { existingSetting },
238+
}),
213239
],
214240
},
215241
});
216-
} else if (es.logQueries === true) {
242+
};
243+
244+
if (es.ssl?.key !== undefined && es.ssl?.certificate === undefined) {
245+
addSslDeprecation(`${fromPath}.ssl.key`, `${fromPath}.ssl.certificate`);
246+
} else if (es.ssl?.certificate !== undefined && es.ssl?.key === undefined) {
247+
addSslDeprecation(`${fromPath}.ssl.certificate`, `${fromPath}.ssl.key`);
248+
}
249+
250+
if (es.logQueries === true) {
217251
addDeprecation({
218252
configPath: `${fromPath}.logQueries`,
219253
message: `Setting [${fromPath}.logQueries] is deprecated and no longer used. You should set the log level to "debug" for the "elasticsearch.queries" context in "logging.loggers".`,

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,6 @@ kibana_vars=(
366366
xpack.securitySolution.packagerTaskInterval
367367
xpack.securitySolution.prebuiltRulesFromFileSystem
368368
xpack.securitySolution.prebuiltRulesFromSavedObjects
369-
xpack.spaces.enabled
370369
xpack.spaces.maxSpaces
371370
xpack.task_manager.index
372371
xpack.task_manager.max_attempts

src/plugins/inspector/public/views/requests/components/request_selector.tsx

Lines changed: 41 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -13,142 +13,82 @@ import { i18n } from '@kbn/i18n';
1313

1414
import {
1515
EuiBadge,
16-
EuiButtonEmpty,
17-
EuiContextMenuPanel,
18-
EuiContextMenuItem,
16+
EuiComboBox,
17+
EuiComboBoxOptionOption,
1918
EuiFlexGroup,
2019
EuiFlexItem,
2120
EuiLoadingSpinner,
22-
EuiPopover,
23-
EuiTextColor,
2421
EuiToolTip,
2522
} from '@elastic/eui';
2623

2724
import { RequestStatus } from '../../../../common/adapters';
2825
import { Request } from '../../../../common/adapters/request/types';
2926

30-
interface RequestSelectorState {
31-
isPopoverOpen: boolean;
32-
}
33-
3427
interface RequestSelectorProps {
3528
requests: Request[];
3629
selectedRequest: Request;
37-
onRequestChanged: Function;
30+
onRequestChanged: (request: Request) => void;
3831
}
3932

40-
export class RequestSelector extends Component<RequestSelectorProps, RequestSelectorState> {
33+
export class RequestSelector extends Component<RequestSelectorProps> {
4134
static propTypes = {
4235
requests: PropTypes.array.isRequired,
4336
selectedRequest: PropTypes.object.isRequired,
4437
onRequestChanged: PropTypes.func,
4538
};
4639

47-
state = {
48-
isPopoverOpen: false,
49-
};
40+
handleSelected = (selectedOptions: Array<EuiComboBoxOptionOption<string>>) => {
41+
const selectedOption = this.props.requests.find(
42+
(request) => request.id === selectedOptions[0].value
43+
);
5044

51-
togglePopover = () => {
52-
this.setState((prevState: RequestSelectorState) => ({
53-
isPopoverOpen: !prevState.isPopoverOpen,
54-
}));
45+
if (selectedOption) {
46+
this.props.onRequestChanged(selectedOption);
47+
}
5548
};
5649

57-
closePopover = () => {
58-
this.setState({
59-
isPopoverOpen: false,
50+
renderRequestCombobox() {
51+
const options = this.props.requests.map((item) => {
52+
const hasFailed = item.status === RequestStatus.ERROR;
53+
const testLabel = item.name.replace(/\s+/, '_');
54+
55+
return {
56+
'data-test-subj': `inspectorRequestChooser${testLabel}`,
57+
label: hasFailed
58+
? `${item.name} ${i18n.translate('inspector.requests.failedLabel', {
59+
defaultMessage: ' (failed)',
60+
})}`
61+
: item.name,
62+
value: item.id,
63+
};
6064
});
61-
};
62-
63-
renderRequestDropdownItem = (request: Request, index: number) => {
64-
const hasFailed = request.status === RequestStatus.ERROR;
65-
const inProgress = request.status === RequestStatus.PENDING;
6665

6766
return (
68-
<EuiContextMenuItem
69-
key={index}
70-
icon={request === this.props.selectedRequest ? 'check' : 'empty'}
71-
onClick={() => {
72-
this.props.onRequestChanged(request);
73-
this.closePopover();
74-
}}
75-
toolTipContent={request.description}
76-
toolTipPosition="left"
77-
data-test-subj={`inspectorRequestChooser${request.name}`}
78-
>
79-
<EuiTextColor color={hasFailed ? 'danger' : 'default'}>
80-
{request.name}
81-
82-
{hasFailed && (
83-
<FormattedMessage id="inspector.requests.failedLabel" defaultMessage=" (failed)" />
84-
)}
85-
86-
{inProgress && (
87-
<EuiLoadingSpinner
88-
size="s"
89-
aria-label={i18n.translate('inspector.requests.requestInProgressAriaLabel', {
90-
defaultMessage: 'Request in progress',
91-
})}
92-
className="insRequestSelector__menuSpinner"
93-
/>
94-
)}
95-
</EuiTextColor>
96-
</EuiContextMenuItem>
97-
);
98-
};
99-
100-
renderRequestDropdown() {
101-
const button = (
102-
<EuiButtonEmpty
103-
iconType="arrowDown"
104-
iconSide="right"
105-
size="s"
106-
onClick={this.togglePopover}
67+
<EuiComboBox
10768
data-test-subj="inspectorRequestChooser"
108-
>
109-
{this.props.selectedRequest.name}
110-
</EuiButtonEmpty>
111-
);
112-
113-
return (
114-
<EuiPopover
69+
fullWidth={true}
11570
id="inspectorRequestChooser"
116-
button={button}
117-
isOpen={this.state.isPopoverOpen}
118-
closePopover={this.closePopover}
119-
panelPaddingSize="none"
120-
anchorPosition="downLeft"
121-
repositionOnScroll
122-
>
123-
<EuiContextMenuPanel
124-
items={this.props.requests.map(this.renderRequestDropdownItem)}
125-
data-test-subj="inspectorRequestChooserMenuPanel"
126-
/>
127-
</EuiPopover>
71+
isClearable={false}
72+
onChange={this.handleSelected}
73+
options={options}
74+
prepend="Request"
75+
selectedOptions={[
76+
{
77+
label: this.props.selectedRequest.name,
78+
value: this.props.selectedRequest.id,
79+
},
80+
]}
81+
singleSelection={{ asPlainText: true }}
82+
/>
12883
);
12984
}
13085

13186
render() {
13287
const { selectedRequest, requests } = this.props;
13388

13489
return (
135-
<EuiFlexGroup alignItems="center" gutterSize="xs">
136-
<EuiFlexItem grow={false}>
137-
<strong>
138-
<FormattedMessage id="inspector.requests.requestLabel" defaultMessage="Request:" />
139-
</strong>
140-
</EuiFlexItem>
141-
<EuiFlexItem grow={true}>
142-
{requests.length <= 1 && (
143-
<div
144-
className="insRequestSelector__singleRequest"
145-
data-test-subj="inspectorRequestName"
146-
>
147-
{selectedRequest.name}
148-
</div>
149-
)}
150-
{requests.length > 1 && this.renderRequestDropdown()}
151-
</EuiFlexItem>
90+
<EuiFlexGroup alignItems="center">
91+
<EuiFlexItem grow={true}>{requests.length && this.renderRequestCombobox()}</EuiFlexItem>
15292
<EuiFlexItem grow={false}>
15393
{selectedRequest.status !== RequestStatus.PENDING && (
15494
<EuiToolTip

src/plugins/vis_types/table/common/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ export interface TableVisParams {
2424
showTotal: boolean;
2525
totalFunc: AggTypes;
2626
percentageCol: string;
27+
autoFitRowToContent?: boolean;
2728
row?: boolean;
2829
}

src/plugins/vis_types/table/public/__snapshots__/table_vis_fn.test.ts.snap

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)