Skip to content

Commit

Permalink
Merge branch 'master' into extraSavedObjectTypesImportTest
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored May 28, 2021
2 parents 7d0be4f + e3517ed commit adc9959
Show file tree
Hide file tree
Showing 170 changed files with 8,434 additions and 3,366 deletions.
1 change: 1 addition & 0 deletions docs/developer/getting-started/monorepo-packages.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ yarn kbn watch-bazel
- @kbn/eslint-plugin-eslint
- @kbn/expect
- @kbn/i18n
- @kbn/io-ts-utils
- @kbn/legacy-logging
- @kbn/logging
- @kbn/mapbox-gl
Expand Down
46 changes: 36 additions & 10 deletions docs/settings/alert-action-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ You can configure the following settings in the `kibana.yml` file.
[cols="2*<"]
|===
| `xpack.actions.enabled`
| Feature toggle that enables Actions in {kib}. Defaults to `true`.
| Feature toggle that enables Actions in {kib}. Default: `true`.

| `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. +
Expand All @@ -50,7 +50,7 @@ You can configure the following settings in the `kibana.yml` file.

| `xpack.actions.customHostSettings` {ess-icon}
| A list of custom host settings to override existing global settings.
Defaults to an empty list. +
Default: an empty list. +
+
Each entry in the list must have a `url` property, to associate a connection
type (mail or https), hostname and port with the remaining options in the
Expand All @@ -70,6 +70,7 @@ You can configure the following settings in the `kibana.yml` file.
xpack.actions.customHostSettings:
- url: smtp://mail.example.com:465
tls:
verificationMode: 'full'
certificateAuthoritiesFiles: [ 'one.crt' ]
certificateAuthoritiesData: |
-----BEGIN CERTIFICATE-----
Expand All @@ -79,7 +80,9 @@ xpack.actions.customHostSettings:
requireTLS: true
- url: https://webhook.example.com
tls:
// legacy
rejectUnauthorized: false
verificationMode: 'none'
--

[cols="2*<"]
Expand Down Expand Up @@ -115,10 +118,16 @@ xpack.actions.customHostSettings:

| `xpack.actions.customHostSettings[n]`
`.tls.rejectUnauthorized` {ess-icon}
| A boolean value indicating whether to bypass server certificate validation.
| Deprecated. Use <<action-config-custom-host-verification-mode,`xpack.actions.customHostSettings.tls.verificationMode`>> instead. A boolean value indicating whether to bypass server certificate validation.
Overrides the general `xpack.actions.rejectUnauthorized` configuration
for requests made for this hostname/port.

|[[action-config-custom-host-verification-mode]] `xpack.actions.customHostSettings[n]`
`.tls.verificationMode`
| Controls the verification of the server certificate that {hosted-ems} receives when making an outbound SSL/TLS connection to the host server. Valid values are `full`, `certificate`, and `none`.
Use `full` to perform hostname verification, `certificate` to skip hostname verification, and `none` to skip verification. Default: `full`. <<elasticsearch-ssl-verificationMode,Equivalent {kib} setting>>. Overrides the general `xpack.actions.tls.verificationMode` configuration
for requests made for this hostname/port.

| `xpack.actions.customHostSettings[n]`
`.tls.certificateAuthoritiesFiles`
| A file name or list of file names of PEM-encoded certificate files to use
Expand All @@ -137,10 +146,10 @@ xpack.actions.customHostSettings:

| `xpack.actions`
`.preconfiguredAlertHistoryEsIndex` {ess-icon}
| Enables a preconfigured alert history {es} <<index-action-type, Index>> connector. Defaults to `false`.
| Enables a preconfigured alert history {es} <<index-action-type, Index>> connector. Default: `false`.

| `xpack.actions.preconfigured`
| Specifies preconfigured connector IDs and configs. Defaults to {}.
| Specifies preconfigured connector IDs and configs. Default: {}.

| `xpack.actions.proxyUrl` {ess-icon}
| Specifies the proxy URL to use, if using a proxy for actions. By default, no proxy is used.
Expand All @@ -152,27 +161,44 @@ xpack.actions.customHostSettings:
| Specifies hostnames which should only use the proxy, if using a proxy for actions. The value is an array of hostnames as strings. By default, no hosts will use the proxy, but if an action's hostname is in this list, the proxy will be used. The settings `xpack.actions.proxyBypassHosts` and `xpack.actions.proxyOnlyHosts` cannot be used at the same time.

| `xpack.actions.proxyHeaders` {ess-icon}
| Specifies HTTP headers for the proxy, if using a proxy for actions. Defaults to {}.
| Specifies HTTP headers for the proxy, if using a proxy for actions. Default: {}.

a|`xpack.actions.`
`proxyRejectUnauthorizedCertificates` {ess-icon}
| Set to `false` to bypass certificate validation for the proxy, if using a proxy for actions. Defaults to `true`.
| Deprecated. Use <<action-config-proxy-verification-mode,`xpack.actions.tls.proxyVerificationMode`>> instead. Set to `false` to bypass certificate validation for the proxy, if using a proxy for actions. Default: `true`.

|[[action-config-proxy-verification-mode]]
`xpack.actions[n]`
`.tls.proxyVerificationMode` {ess-icon}
| Controls the verification for the proxy server certificate that {hosted-ems} receives when making an outbound SSL/TLS connection to the proxy server. Valid values are `full`, `certificate`, and `none`.
Use `full` to perform hostname verification, `certificate` to skip hostname verification, and `none` to skip verification. Default: `full`. <<elasticsearch-ssl-verificationMode,Equivalent {kib} setting>>.

| `xpack.actions.rejectUnauthorized` {ess-icon}
| Set to `false` to bypass certificate validation for actions. Defaults to `true`. +
| Deprecated. Use <<action-config-verification-mode,`xpack.actions.tls.verificationMode`>> instead. Set to `false` to bypass certificate validation for actions. Default: `true`. +
+
As an alternative to setting `xpack.actions.rejectUnauthorized`, you can use the setting
`xpack.actions.customHostSettings` to set TLS options for specific servers.

|[[action-config-verification-mode]]
`xpack.actions[n]`
`.tls.verificationMode` {ess-icon}
| Controls the verification for the server certificate that {hosted-ems} receives when making an outbound SSL/TLS connection for actions. Valid values are `full`, `certificate`, and `none`.
Use `full` to perform hostname verification, `certificate` to skip hostname verification, and `none` to skip verification. Default: `full`. <<elasticsearch-ssl-verificationMode,Equivalent {kib} setting>>. +
+
As an alternative to setting `xpack.actions.tls.verificationMode`, you can use the setting
`xpack.actions.customHostSettings` to set TLS options for specific servers.



| `xpack.actions.maxResponseContentLength` {ess-icon}
| Specifies the max number of bytes of the http response for requests to external resources. Defaults to 1000000 (1MB).
| Specifies the max number of bytes of the http response for requests to external resources. Default: 1000000 (1MB).

| `xpack.actions.responseTimeout` {ess-icon}
| Specifies the time allowed for requests to external resources. Requests that take longer are aborted. The time is formatted as: +
+
`<count>[ms,s,m,h,d,w,M,Y]` +
+
For example, `20m`, `24h`, `7d`, `1w`. Defaults to `60s`.
For example, `20m`, `24h`, `7d`, `1w`. Default: `60s`.


|===
Expand Down
9 changes: 0 additions & 9 deletions docs/user/alerting/rule-management.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,6 @@ These operations can also be performed in bulk by multi-selecting rules and clic
[role="screenshot"]
image:images/bulk-mute-disable.png[The Manage rules button lets you mute/unmute, enable/disable, and delete in bulk]

[float]
[[importing-and-exporting-rules]]
=== Importing and exporting rules

To import and export rules, use the <<managing-saved-objects, Saved Objects Management UI>>.
After the succesful import the proper banner will be displayed:
[role="screenshot"]
image::images/rules-imported-banner.png[Rules import banner, width=50%]

[float]
=== Required permissions

Expand Down
15 changes: 13 additions & 2 deletions docs/user/dashboard/lens.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,19 @@
To create visualizations with *Lens*, you drag and drop data fields onto the visualization builder,
then *Lens* uses heuristics to apply each field.

[role="screenshot"]
image:dashboard/images/lens.png[Lens]
++++
<script type="text/javascript" async
src="https://play.vidyard.com/embed/v4.js"></script>
<img
style="width: 100%; margin: auto; display: block;"
class="vidyard-player-embed"
src="https://play.vidyard.com/G6RNjq6U9odYRCYUxY2vfq.jpg"
data-uuid="G6RNjq6U9odYRCYUxY2vfq"
data-v="4"
data-type="inline"
/>
</br>
++++

[float]
[[lens-required-choices]]
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"@kbn/mapbox-gl": "link:bazel-bin/packages/kbn-mapbox-gl/npm_module",
"@kbn/i18n": "link:bazel-bin/packages/kbn-i18n/npm_module",
"@kbn/interpreter": "link:packages/kbn-interpreter",
"@kbn/io-ts-utils": "link:packages/kbn-io-ts-utils",
"@kbn/io-ts-utils": "link:bazel-bin/packages/kbn-io-ts-utils/npm_module",
"@kbn/legacy-logging": "link:bazel-bin/packages/kbn-legacy-logging/npm_module",
"@kbn/logging": "link:bazel-bin/packages/kbn-logging/npm_module",
"@kbn/monaco": "link:bazel-bin/packages/kbn-monaco/npm_module",
Expand Down Expand Up @@ -161,6 +161,7 @@
"@mapbox/mapbox-gl-draw": "1.3.0",
"@mapbox/mapbox-gl-rtl-text": "0.2.3",
"@mapbox/vector-tile": "1.3.1",
"@reduxjs/toolkit": "^1.5.1",
"@scant/router": "^0.1.1",
"@slack/webhook": "^5.0.4",
"@turf/along": "6.0.1",
Expand All @@ -173,6 +174,7 @@
"@turf/distance": "6.0.1",
"@turf/helpers": "6.0.1",
"@turf/length": "^6.0.2",
"@types/redux-logger": "^3.0.8",
"JSONStream": "1.3.5",
"abort-controller": "^3.0.0",
"abortcontroller-polyfill": "^1.4.0",
Expand Down Expand Up @@ -365,6 +367,7 @@
"redux": "^4.0.5",
"redux-actions": "^2.6.5",
"redux-devtools-extension": "^2.13.8",
"redux-logger": "^3.0.6",
"redux-observable": "^1.2.0",
"redux-saga": "^1.1.3",
"redux-thunk": "^2.3.0",
Expand Down
1 change: 1 addition & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ filegroup(
"//packages/kbn-eslint-plugin-eslint:build",
"//packages/kbn-expect:build",
"//packages/kbn-i18n:build",
"//packages/kbn-io-ts-utils:build",
"//packages/kbn-legacy-logging:build",
"//packages/kbn-logging:build",
"//packages/kbn-mapbox-gl:build",
Expand Down
85 changes: 85 additions & 0 deletions packages/kbn-io-ts-utils/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")

PKG_BASE_NAME = "kbn-io-ts-utils"
PKG_REQUIRE_NAME = "@kbn/io-ts-utils"

SOURCE_FILES = glob(
[
"src/**/*.ts",
],
exclude = [
"**/*.test.*"
],
)

SRCS = SOURCE_FILES

filegroup(
name = "srcs",
srcs = SRCS,
)

NPM_MODULE_EXTRA_FILES = [
"package.json",
]

SRC_DEPS = [
"@npm//fp-ts",
"@npm//io-ts",
"@npm//lodash",
"@npm//tslib",
]

TYPES_DEPS = [
"@npm//@types/jest",
"@npm//@types/lodash",
"@npm//@types/node",
]

DEPS = SRC_DEPS + TYPES_DEPS

ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
],
)

ts_project(
name = "tsc",
args = ['--pretty'],
srcs = SRCS,
deps = DEPS,
declaration = True,
declaration_map = True,
incremental = True,
out_dir = "target",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
)

js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = DEPS + [":tsc"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)

pkg_npm(
name = "npm_module",
deps = [
":%s" % PKG_BASE_NAME,
]
)

filegroup(
name = "build",
srcs = [
":npm_module",
],
visibility = ["//visibility:public"],
)
7 changes: 1 addition & 6 deletions packages/kbn-io-ts-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,5 @@
"types": "./target/index.d.ts",
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0",
"private": true,
"scripts": {
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build",
"kbn:watch": "yarn build --watch"
}
"private": true
}
2 changes: 1 addition & 1 deletion packages/kbn-io-ts-utils/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"incremental": true,
"outDir": "./target",
"stripInternal": false,
"declaration": true,
Expand Down
3 changes: 0 additions & 3 deletions packages/kbn-server-route-repository/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build",
"kbn:watch": "yarn build --watch"
},
"dependencies": {
"@kbn/io-ts-utils": "link:../kbn-io-ts-utils"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ kibana_vars=(
xpack.actions.rejectUnauthorized
xpack.actions.maxResponseContentLength
xpack.actions.responseTimeout
xpack.actions.tls.verificationMode
xpack.actions.tls.proxyVerificationMode
xpack.alerts.healthCheck.interval
xpack.alerts.invalidateApiKeysTask.interval
xpack.alerts.invalidateApiKeysTask.removalDelay
Expand Down
25 changes: 24 additions & 1 deletion src/plugins/charts/common/palette.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ import {
systemPalette,
PaletteOutput,
CustomPaletteState,
CustomPaletteArguments,
} from './palette';
import { functionWrapper } from 'src/plugins/expressions/common/expression_functions/specs/tests/utils';

describe('palette', () => {
const fn = functionWrapper(palette()) as (
context: null,
args?: { color?: string[]; gradient?: boolean; reverse?: boolean }
args?: Partial<CustomPaletteArguments>
) => PaletteOutput<CustomPaletteState>;

it('results a palette', () => {
Expand All @@ -39,6 +40,18 @@ describe('palette', () => {
});
});

describe('stop', () => {
it('sets stops', () => {
const result = fn(null, { color: ['red', 'green', 'blue'], stop: [1, 2, 3] });
expect(result.params!.stops).toEqual([1, 2, 3]);
});

it('defaults to pault_tor_14 colors', () => {
const result = fn(null);
expect(result.params!.colors).toEqual(defaultCustomColors);
});
});

describe('gradient', () => {
it('sets gradient', () => {
let result = fn(null, { gradient: true });
Expand Down Expand Up @@ -69,6 +82,16 @@ describe('palette', () => {
const result = fn(null);
expect(result.params!.colors).toEqual(defaultCustomColors);
});

it('keeps the stops order pristine when set', () => {
const stops = [1, 2, 3];
const result = fn(null, {
color: ['red', 'green', 'blue'],
stop: [1, 2, 3],
reverse: true,
});
expect(result.params!.stops).toEqual(stops);
});
});
});
});
Expand Down
Loading

0 comments on commit adc9959

Please sign in to comment.