Skip to content

Commit

Permalink
Merge branch 'master' into docs__add-ingest-proc-desc-e-j
Browse files Browse the repository at this point in the history
  • Loading branch information
jrodewig committed Sep 4, 2020
2 parents 5c10a71 + fef21ab commit c8ed625
Show file tree
Hide file tree
Showing 175 changed files with 6,735 additions and 1,043 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
Binary file modified docs/visualize/images/lens_drag_drop.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
23 changes: 0 additions & 23 deletions src/core/tsconfig.json

This file was deleted.

4 changes: 2 additions & 2 deletions src/dev/build/tasks/create_archives_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ export const CreateArchives: Task = {
});

metrics.push({
group: `${build.isOss() ? 'oss ' : ''}distributable file count`,
id: 'total',
group: 'distributable file count',
id: build.isOss() ? 'oss' : 'default',
value: fileCount,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,18 @@ import { EuiCheckboxGroupIdToSelectedMap } from '@elastic/eui/src/components/for
import React, { useState, ReactElement } from 'react';
import ReactDOM from 'react-dom';
import angular from 'angular';
import deepEqual from 'fast-deep-equal';

import { Observable, pipe, Subscription, merge } from 'rxjs';
import { filter, map, debounceTime, mapTo, startWith, switchMap } from 'rxjs/operators';
import {
filter,
map,
debounceTime,
mapTo,
startWith,
switchMap,
distinctUntilChanged,
} from 'rxjs/operators';
import { History } from 'history';
import { SavedObjectSaveOpts } from 'src/plugins/saved_objects/public';
import { NavigationPublicPluginStart as NavigationStart } from 'src/plugins/navigation/public';
Expand Down Expand Up @@ -279,6 +288,12 @@ export class DashboardAppController {
const updateIndexPatternsOperator = pipe(
filter((container: DashboardContainer) => !!container && !isErrorEmbeddable(container)),
map(getDashboardIndexPatterns),
distinctUntilChanged((a, b) =>
deepEqual(
a.map((ip) => ip.id),
b.map((ip) => ip.id)
)
),
// using switchMap for previous task cancellation
switchMap((panelIndexPatterns: IndexPattern[]) => {
return new Observable((observer) => {
Expand Down Expand Up @@ -405,17 +420,29 @@ export class DashboardAppController {
) : null;
};

outputSubscription = new Subscription();
outputSubscription.add(
dashboardContainer
.getOutput$()
.pipe(
mapTo(dashboardContainer),
startWith(dashboardContainer), // to trigger initial index pattern update
updateIndexPatternsOperator
outputSubscription = merge(
// output of dashboard container itself
dashboardContainer.getOutput$(),
// plus output of dashboard container children,
// children may change, so make sure we subscribe/unsubscribe with switchMap
dashboardContainer.getOutput$().pipe(
map(() => dashboardContainer!.getChildIds()),
distinctUntilChanged(deepEqual),
switchMap((newChildIds: string[]) =>
merge(
...newChildIds.map((childId) =>
dashboardContainer!.getChild(childId).getOutput$()
)
)
)
.subscribe()
);
)
)
.pipe(
mapTo(dashboardContainer),
startWith(dashboardContainer), // to trigger initial index pattern update
updateIndexPatternsOperator
)
.subscribe();

inputSubscription = dashboardContainer.getInput$().subscribe(() => {
let dirty = false;
Expand Down
Loading

0 comments on commit c8ed625

Please sign in to comment.