Skip to content

Commit

Permalink
Merge branch 'master' into issue-75449-bulk-update-across-spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Sep 7, 2020
2 parents c2a207a + 19bf9ed commit 0a36aa5
Show file tree
Hide file tree
Showing 139 changed files with 2,637 additions and 1,565 deletions.
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@
/src/plugins/apm_oss/ @elastic/apm-ui
/src/apm.js @watson @vigneshshanmugam

# Client Side Monitoring (lives in APM directories but owned by Uptime)
/x-pack/plugins/apm/e2e/cypress/support/step_definitions/rum @elastic/uptime
/x-pack/plugins/apm/public/application/csmApp.tsx @elastic/uptime
/x-pack/plugins/apm/public/components/app/RumDashboard @elastic/uptime
/x-pack/plugins/apm/server/lib/rum_client @elastic/uptime
/x-pack/plugins/apm/server/routes/rum_client.ts @elastic/uptime

# Beats
/x-pack/legacy/plugins/beats_management/ @elastic/beats

Expand Down
6 changes: 6 additions & 0 deletions docs/management/advanced-options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ working on big documents.
==== Machine learning

[horizontal]
`ml:anomalyDetection:results:enableTimeDefaults`:: Use the default time filter
in the *Single Metric Viewer* and *Anomaly Explorer*. If this setting is
disabled, the results for the full time range are shown.
`ml:anomalyDetection:results:timeDefaults`:: Sets the default time filter for
viewing {anomaly-job} results. This setting must contain `from` and `to` values (see {ref}/common-options.html#date-math[accepted formats]). It is ignored
unless `ml:anomalyDetection:results:enableTimeDefaults` is enabled.
`ml:fileDataVisualizerMaxFileSize`:: Sets the file size limit when importing
data in the {data-viz}. The default value is `100MB`. The highest supported
value for this setting is `1GB`.
Expand Down
6 changes: 3 additions & 3 deletions docs/settings/alert-action-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ You can configure the following settings in the `kibana.yml` file.
[cols="2*<"]
|===

| `xpack.actions.whitelistedHosts` {ess-icon}
| A list of hostnames that {kib} is allowed to connect to when built-in actions are triggered. It defaults to `[*]`, allowing any host, but keep in mind the potential for SSRF attacks when hosts are not explicitly whitelisted. An empty list `[]` can be used to block built-in actions from making any external connections. +
| `xpack.actions.allowedHosts` {ess-icon}
| A list of hostnames that {kib} is allowed to connect to when built-in actions are triggered. It defaults to `[*]`, allowing any host, but keep in mind the potential for SSRF attacks when hosts are not explicitly added to the allowed hosts. An empty list `[]` can be used to block built-in actions from making any external connections. +
+
Note that hosts associated with built-in actions, such as Slack and PagerDuty, are not automatically whitelisted. If you are not using the default `[*]` setting, you must ensure that the corresponding endpoints are whitelisted as well.
Note that hosts associated with built-in actions, such as Slack and PagerDuty, are not automatically added to allowed hosts. If you are not using the default `[*]` setting, you must ensure that the corresponding endpoints are added to the allowed hosts as well.

| `xpack.actions.enabledActionTypes` {ess-icon}
| A list of action types that are enabled. It defaults to `[*]`, enabling all types. The names for built-in {kib} action types are prefixed with a `.` and include: `.server-log`, `.slack`, `.email`, `.index`, `.pagerduty`, and `.webhook`. An empty list `[]` will disable all action types. +
Expand Down
2 changes: 1 addition & 1 deletion docs/user/alerting/action-types/email.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Email connectors have the following configuration properties:

Name:: The name of the connector. The name is used to identify a connector in the management UI connector listing, or in the connector list when configuring an action.
Sender:: The from address for all emails sent with this connector, specified in `user@host-name` format.
Host:: Host name of the service provider. If you are using the <<action-settings, `xpack.actions.whitelistedHosts`>> setting, make sure this hostname is whitelisted.
Host:: Host name of the service provider. If you are using the <<action-settings, `xpack.actions.allowedHosts`>> setting, make sure this hostname is added to the allowed hosts.
Port:: The port to connect to on the service provider.
Secure:: If true the connection will use TLS when connecting to the service provider. See https://nodemailer.com/smtp/#tls-options[nodemailer TLS documentation] for more information.
Username:: username for 'login' type authentication.
Expand Down
2 changes: 1 addition & 1 deletion docs/user/alerting/action-types/pagerduty.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ This is an irreversible action and impacts all alerts that use this connector.
PagerDuty connectors have the following configuration properties:

Name:: The name of the connector. The name is used to identify a connector in the management UI connector listing, or in the connector list when configuring an action.
API URL:: An optional PagerDuty event URL. Defaults to `https://events.pagerduty.com/v2/enqueue`. If you are using the <<action-settings, `xpack.actions.whitelistedHosts`>> setting, make sure the hostname is whitelisted.
API URL:: An optional PagerDuty event URL. Defaults to `https://events.pagerduty.com/v2/enqueue`. If you are using the <<action-settings, `xpack.actions.allowedHosts`>> setting, make sure the hostname is added to the allowed hosts.
Integration Key:: A 32 character PagerDuty Integration Key for an integration on a service, also referred to as the routing key.

[float]
Expand Down
2 changes: 1 addition & 1 deletion docs/user/alerting/action-types/slack.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The Slack action type uses https://api.slack.com/incoming-webhooks[Slack Incomin
Slack connectors have the following configuration properties:

Name:: The name of the connector. The name is used to identify a connector in the management UI connector listing, or in the connector list when configuring an action.
Webhook URL:: The URL of the incoming webhook. See https://api.slack.com/messaging/webhooks#getting_started[Slack Incoming Webhooks] for instructions on generating this URL. If you are using the <<action-settings, `xpack.actions.whitelistedHosts`>> setting, make sure the hostname is whitelisted.
Webhook URL:: The URL of the incoming webhook. See https://api.slack.com/messaging/webhooks#getting_started[Slack Incoming Webhooks] for instructions on generating this URL. If you are using the <<action-settings, `xpack.actions.allowedHosts`>> setting, make sure the hostname is added to the allowed hosts.

[float]
[[Preconfigured-slack-configuration]]
Expand Down
2 changes: 1 addition & 1 deletion docs/user/alerting/action-types/webhook.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The Webhook action type uses https://github.com/axios/axios[axios] to send a POS
Webhook connectors have the following configuration properties:

Name:: The name of the connector. The name is used to identify a connector in the management UI connector listing, or in the connector list when configuring an action.
URL:: The request URL. If you are using the <<action-settings, `xpack.actions.whitelistedHosts`>> setting, make sure the hostname is whitelisted.
URL:: The request URL. If you are using the <<action-settings, `xpack.actions.allowedHosts`>> setting, make sure the hostname is added to the allowed hosts.
Method:: HTTP request method, either `post`(default) or `put`.
Headers:: A set of key-value pairs sent as headers with the request
User:: An optional username. If set, HTTP basic authentication is used. Currently only basic authentication is supported.
Expand Down
17 changes: 8 additions & 9 deletions examples/embeddable_examples/public/book/book_embeddable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,7 @@ export class BookEmbeddable

constructor(
initialInput: BookEmbeddableInput,
private attributeService: AttributeService<
BookSavedObjectAttributes,
BookByValueInput,
BookByReferenceInput
>,
private attributeService: AttributeService<BookSavedObjectAttributes>,
{
parent,
}: {
Expand All @@ -99,18 +95,21 @@ export class BookEmbeddable
});
}

inputIsRefType = (input: BookEmbeddableInput): input is BookByReferenceInput => {
readonly inputIsRefType = (input: BookEmbeddableInput): input is BookByReferenceInput => {
return this.attributeService.inputIsRefType(input);
};

getInputAsValueType = async (): Promise<BookByValueInput> => {
readonly getInputAsValueType = async (): Promise<BookByValueInput> => {
const input = this.attributeService.getExplicitInputFromEmbeddable(this);
return this.attributeService.getInputAsValueType(input);
};

getInputAsRefType = async (): Promise<BookByReferenceInput> => {
readonly getInputAsRefType = async (): Promise<BookByReferenceInput> => {
const input = this.attributeService.getExplicitInputFromEmbeddable(this);
return this.attributeService.getInputAsRefType(input, { showSaveModal: true });
return this.attributeService.getInputAsRefType(input, {
showSaveModal: true,
saveModalTitle: this.getTitle(),
});
};

public render(node: HTMLElement) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ import {
BOOK_EMBEDDABLE,
BookEmbeddableInput,
BookEmbeddableOutput,
BookByValueInput,
BookByReferenceInput,
} from './book_embeddable';
import { CreateEditBookComponent } from './create_edit_book_component';
import { OverlayStart } from '../../../../src/core/public';
Expand Down Expand Up @@ -66,11 +64,7 @@ export class BookEmbeddableFactoryDefinition
getIconForSavedObject: () => 'pencil',
};

private attributeService?: AttributeService<
BookSavedObjectAttributes,
BookByValueInput,
BookByReferenceInput
>;
private attributeService?: AttributeService<BookSavedObjectAttributes>;

constructor(private getStartServices: () => Promise<StartServices>) {}

Expand Down Expand Up @@ -126,9 +120,7 @@ export class BookEmbeddableFactoryDefinition
private async getAttributeService() {
if (!this.attributeService) {
this.attributeService = await (await this.getStartServices()).getAttributeService<
BookSavedObjectAttributes,
BookByValueInput,
BookByReferenceInput
BookSavedObjectAttributes
>(this.type);
}
return this.attributeService!;
Expand Down
12 changes: 6 additions & 6 deletions examples/embeddable_examples/public/book/edit_book_action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ export const createEditBookAction = (getStartServices: () => Promise<StartServic
},
execute: async ({ embeddable }: ActionContext) => {
const { openModal, getAttributeService } = await getStartServices();
const attributeService = getAttributeService<
BookSavedObjectAttributes,
BookByValueInput,
BookByReferenceInput
>(BOOK_SAVED_OBJECT);
const attributeService = getAttributeService<BookSavedObjectAttributes>(BOOK_SAVED_OBJECT);
const onSave = async (attributes: BookSavedObjectAttributes, useRefType: boolean) => {
const newInput = await attributeService.wrapAttributes(attributes, useRefType, embeddable);
const newInput = await attributeService.wrapAttributes(
attributes,
useRefType,
attributeService.getExplicitInputFromEmbeddable(embeddable)
);
if (!useRefType && (embeddable.getInput() as SavedObjectEmbeddableInput).savedObjectId) {
// Set the saved object ID to null so that update input will remove the existing savedObjectId...
(newInput as BookByValueInput & { savedObjectId: unknown }).savedObjectId = null;
Expand Down
3 changes: 2 additions & 1 deletion packages/elastic-eslint-config-kibana/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ module.exports = {
'no-undef-init': 'error',
'no-unsafe-finally': 'error',
'no-unsanitized/property': 'error',
'no-unused-expressions': 'error',
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'error',
'no-unused-labels': 'error',
'no-var': 'error',
'object-shorthand': 'error',
Expand Down
1 change: 0 additions & 1 deletion src/core/server/legacy/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@

export { ensureValidConfiguration } from './ensure_valid_configuration';
export { LegacyObjectToConfigAdapter } from './legacy_object_to_config_adapter';
export { convertLegacyDeprecationProvider } from './legacy_deprecation_adapters';
106 changes: 0 additions & 106 deletions src/core/server/legacy/config/legacy_deprecation_adapters.test.ts

This file was deleted.

57 changes: 0 additions & 57 deletions src/core/server/legacy/config/legacy_deprecation_adapters.ts

This file was deleted.

Loading

0 comments on commit 0a36aa5

Please sign in to comment.