Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into client-and-server…
Browse files Browse the repository at this point in the history
…-np-dir-move
  • Loading branch information
Kerry350 committed Jan 29, 2020
2 parents ddf7a7a + 9d4414d commit cbb6c23
Show file tree
Hide file tree
Showing 354 changed files with 17,764 additions and 3,863 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
/src/dev/ @elastic/kibana-operations
/src/setup_node_env/ @elastic/kibana-operations
/src/optimize/ @elastic/kibana-operations
/src/es_archiver/ @elastic/kibana-operations
/packages/*eslint*/ @elastic/kibana-operations
/packages/*babel*/ @elastic/kibana-operations
/packages/kbn-dev-utils*/ @elastic/kibana-operations
Expand All @@ -112,6 +113,7 @@
/src/legacy/server/logging/ @elastic/kibana-platform
/src/legacy/server/saved_objects/ @elastic/kibana-platform
/src/legacy/server/status/ @elastic/kibana-platform
/src/dev/run_check_core_api_changes.ts @elastic/kibana-platform

# Security
/src/core/server/csp/ @elastic/kibana-security @elastic/kibana-platform
Expand Down
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"embeddableExamples": "examples/embeddable_examples",
"share": "src/plugins/share",
"home": "src/plugins/home",
"charts": "src/plugins/charts",
"esUi": "src/plugins/es_ui_shared",
"devTools": "src/plugins/dev_tools",
"expressions": "src/plugins/expressions",
Expand Down
34 changes: 34 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,40 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

---
This product bundles rules based on https://github.com/BlueTeamLabs/sentinel-attack
which is available under a "MIT" license. The files based on this license are:

- windows_defense_evasion_via_filter_manager.json
- windows_process_discovery_via_tasklist_command.json
- windows_priv_escalation_via_accessibility_features.json
- windows_persistence_via_application_shimming.json
- windows_execution_via_trusted_developer_utilities.json
- windows_execution_via_net_com_assemblies.json
- windows_execution_via_connection_manager.json

MIT License

Copyright (c) 2019 Edoardo Gerosa, Olaf Hartong

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---
This product includes code that is adapted from mapbox-gl-js, which is
available under a "BSD-3-Clause" license.
Expand Down
17 changes: 9 additions & 8 deletions docs/developer/add-data-guide.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,24 @@ Each tutorial contains three sets of instructions:

[float]
=== Creating a new tutorial
// TODO: update path to where the directory must be created on the new platform
1. Create a new directory in the link:https://github.com/elastic/kibana/tree/master/src/legacy/core_plugins/kibana/server/tutorials[tutorials directory].
2. In the new directory, create a file called `index.js` that exports a function.
The function must return a JavaScript object that conforms to the link:https://github.com/elastic/kibana/blob/master/src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts[tutorial schema].
// TODO: update path to where the tutorial must be registered on the new platform
3. Register the tutorial in link:https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/kibana/server/tutorials/register.js[register.js] by calling `server.newPlatform.setup.plugins.home.tutorials.registerTutorial(myFuncImportedFromIndexJs)`.
// TODO: update path to where the image assets must be added on the new platform
1. Create a new directory in the link:https://github.com/elastic/kibana/tree/master/src/plugins/home/server/tutorials[tutorials directory].
2. In the new directory, create a file called `index.ts` that exports a function.
The function must return a function object that conforms to the `TutorialSchema` interface link:https://github.com/elastic/kibana/blob/master/src/plugins/home/server/services/tutorials/lib/tutorial_schema.ts[tutorial schema].
3. Register the tutorial in link:https://github.com/elastic/kibana/blob/master/src/plugins/home/server/tutorials/register.ts[register.ts] by adding it to the `builtInTutorials`.
// TODO update path once assets are migrated
4. Add image assets to the link:https://github.com/elastic/kibana/tree/master/src/legacy/core_plugins/kibana/public/home/tutorial_resources[tutorial_resources directory].
5. Run Kibana locally to preview the tutorial.
6. Create a PR and go through the review process to get the changes approved.

If you are creating a new plugin and the tutorial is only related to that plugin, you can also place the `TutorialSchema` object into your plugin folder. Add `home` to the `requiredPlugins` list in your `kibana.json` file.
Then register the tutorial object by calling `home.tutorials.registerTutorial(tutorialObject)` in the `setup` lifecycle of your server plugin.

[float]
==== Variables
String values can contain variables that are substituted when rendered. Variables are specified by `{}`.
For example: `{config.docs.version}` is rendered as `6.2` when running the tutorial in Kibana 6.2.

link:https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/kibana/public/home/components/tutorial/replace_template_strings.js#L23[Provided variables]
link:https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/kibana/public/home/np_ready/components/tutorial/replace_template_strings.js#L23[Provided variables]

[float]
==== Markdown
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeNavLink](./kibana-plugin-public.chromenavlink.md) &gt; [disableSubUrlTracking](./kibana-plugin-public.chromenavlink.disablesuburltracking.md)

## ChromeNavLink.disableSubUrlTracking property

> Warning: This API is now obsolete.
>
>
A flag that tells legacy chrome to ignore the link when tracking sub-urls

<b>Signature:</b>

```typescript
readonly disableSubUrlTracking?: boolean;
```
65 changes: 33 additions & 32 deletions docs/development/core/public/kibana-plugin-public.chromenavlink.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeNavLink](./kibana-plugin-public.chromenavlink.md)

## ChromeNavLink interface


<b>Signature:</b>

```typescript
export interface ChromeNavLink
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [active](./kibana-plugin-public.chromenavlink.active.md) | <code>boolean</code> | Indicates whether or not this app is currently on the screen. |
| [baseUrl](./kibana-plugin-public.chromenavlink.baseurl.md) | <code>string</code> | The base route used to open the root of an application. |
| [category](./kibana-plugin-public.chromenavlink.category.md) | <code>AppCategory</code> | The category the app lives in |
| [disabled](./kibana-plugin-public.chromenavlink.disabled.md) | <code>boolean</code> | Disables a link from being clickable. |
| [euiIconType](./kibana-plugin-public.chromenavlink.euiicontype.md) | <code>string</code> | A EUI iconType that will be used for the app's icon. This icon takes precendence over the <code>icon</code> property. |
| [hidden](./kibana-plugin-public.chromenavlink.hidden.md) | <code>boolean</code> | Hides a link from the navigation. |
| [icon](./kibana-plugin-public.chromenavlink.icon.md) | <code>string</code> | A URL to an image file used as an icon. Used as a fallback if <code>euiIconType</code> is not provided. |
| [id](./kibana-plugin-public.chromenavlink.id.md) | <code>string</code> | A unique identifier for looking up links. |
| [linkToLastSubUrl](./kibana-plugin-public.chromenavlink.linktolastsuburl.md) | <code>boolean</code> | Whether or not the subUrl feature should be enabled. |
| [order](./kibana-plugin-public.chromenavlink.order.md) | <code>number</code> | An ordinal used to sort nav links relative to one another for display. |
| [subUrlBase](./kibana-plugin-public.chromenavlink.suburlbase.md) | <code>string</code> | A url base that legacy apps can set to match deep URLs to an application. |
| [title](./kibana-plugin-public.chromenavlink.title.md) | <code>string</code> | The title of the application. |
| [tooltip](./kibana-plugin-public.chromenavlink.tooltip.md) | <code>string</code> | A tooltip shown when hovering over an app link. |
| [url](./kibana-plugin-public.chromenavlink.url.md) | <code>string</code> | A url that legacy apps can set to deep link into their applications. |

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-public](./kibana-plugin-public.md) &gt; [ChromeNavLink](./kibana-plugin-public.chromenavlink.md)

## ChromeNavLink interface


<b>Signature:</b>

```typescript
export interface ChromeNavLink
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [active](./kibana-plugin-public.chromenavlink.active.md) | <code>boolean</code> | Indicates whether or not this app is currently on the screen. |
| [baseUrl](./kibana-plugin-public.chromenavlink.baseurl.md) | <code>string</code> | The base route used to open the root of an application. |
| [category](./kibana-plugin-public.chromenavlink.category.md) | <code>AppCategory</code> | The category the app lives in |
| [disabled](./kibana-plugin-public.chromenavlink.disabled.md) | <code>boolean</code> | Disables a link from being clickable. |
| [disableSubUrlTracking](./kibana-plugin-public.chromenavlink.disablesuburltracking.md) | <code>boolean</code> | A flag that tells legacy chrome to ignore the link when tracking sub-urls |
| [euiIconType](./kibana-plugin-public.chromenavlink.euiicontype.md) | <code>string</code> | A EUI iconType that will be used for the app's icon. This icon takes precendence over the <code>icon</code> property. |
| [hidden](./kibana-plugin-public.chromenavlink.hidden.md) | <code>boolean</code> | Hides a link from the navigation. |
| [icon](./kibana-plugin-public.chromenavlink.icon.md) | <code>string</code> | A URL to an image file used as an icon. Used as a fallback if <code>euiIconType</code> is not provided. |
| [id](./kibana-plugin-public.chromenavlink.id.md) | <code>string</code> | A unique identifier for looking up links. |
| [linkToLastSubUrl](./kibana-plugin-public.chromenavlink.linktolastsuburl.md) | <code>boolean</code> | Whether or not the subUrl feature should be enabled. |
| [order](./kibana-plugin-public.chromenavlink.order.md) | <code>number</code> | An ordinal used to sort nav links relative to one another for display. |
| [subUrlBase](./kibana-plugin-public.chromenavlink.suburlbase.md) | <code>string</code> | A url base that legacy apps can set to match deep URLs to an application. |
| [title](./kibana-plugin-public.chromenavlink.title.md) | <code>string</code> | The title of the application. |
| [tooltip](./kibana-plugin-public.chromenavlink.tooltip.md) | <code>string</code> | A tooltip shown when hovering over an app link. |
| [url](./kibana-plugin-public.chromenavlink.url.md) | <code>string</code> | A url that legacy apps can set to deep link into their applications. |

11 changes: 11 additions & 0 deletions docs/migration/migrate_8_0.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,15 @@ specified explicitly.

*Impact:* Any workflow that involved manually clearing generated bundles will have to be updated with the new path.


[float]
[[breaking_80_reporting_changes]]
=== Reporting changes

[float]
==== Legacy job parameters are no longer supported
*Details:* POST URL snippets that were copied in Kibana 6.2 or below are no longer supported. These logs have
been deprecated with warnings that have been logged throughout 7.x. Please use Kibana UI to re-generate the
POST URL snippets if you depend on these for automated PDF reports.

// end::notable-breaking-changes[]
1 change: 1 addition & 0 deletions src/core/public/application/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ export interface LegacyApp extends AppBase {
appUrl: string;
subUrlBase?: string;
linkToLastSubUrl?: boolean;
disableSubUrlTracking?: boolean;
}

/**
Expand Down
11 changes: 11 additions & 0 deletions src/core/public/chrome/nav_links/nav_link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ export interface ChromeNavLink {
*/
readonly subUrlBase?: string;

/**
* A flag that tells legacy chrome to ignore the link when
* tracking sub-urls
*
* @internalRemarks
* This should be removed once legacy apps are gone.
*
* @deprecated
*/
readonly disableSubUrlTracking?: boolean;

/**
* Whether or not the subUrl feature should be enabled.
*
Expand Down
1 change: 1 addition & 0 deletions src/core/public/legacy/legacy_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export class LegacyPlatformService {
subUrlBase: navLink.subUrlBase,
linkToLastSubUrl: navLink.linkToLastSubUrl,
category: navLink.category,
disableSubUrlTracking: navLink.disableSubUrlTracking,
})
);

Expand Down
2 changes: 2 additions & 0 deletions src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ export interface ChromeNavLink {
readonly category?: AppCategory;
// @deprecated
readonly disabled?: boolean;
// @deprecated
readonly disableSubUrlTracking?: boolean;
readonly euiIconType?: string;
readonly hidden?: boolean;
readonly icon?: string;
Expand Down
53 changes: 53 additions & 0 deletions src/core/server/config/object_to_config_adapter.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { ObjectToConfigAdapter } from './object_to_config_adapter';

describe('ObjectToConfigAdapter', () => {
describe('#getFlattenedPaths()', () => {
it('considers arrays as final values', () => {
const data = {
string: 'string',
array: ['an', 'array'],
};
const config = new ObjectToConfigAdapter(data);

expect(config.getFlattenedPaths()).toEqual(['string', 'array']);
});

it('handles nested arrays', () => {
const data = {
string: 'string',
array: ['an', 'array'],
nested: {
number: 12,
array: [{ key: 1 }, { key: 2 }],
},
};
const config = new ObjectToConfigAdapter(data);

expect(config.getFlattenedPaths()).toEqual([
'string',
'array',
'nested.number',
'nested.array',
]);
});
});
});
17 changes: 2 additions & 15 deletions src/core/server/config/object_to_config_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import { cloneDeep, get, has, set } from 'lodash';

import { getFlattenedObject } from '../../utils';
import { Config, ConfigPath } from './';

/**
Expand All @@ -41,24 +42,10 @@ export class ObjectToConfigAdapter implements Config {
}

public getFlattenedPaths() {
return [...flattenObjectKeys(this.rawConfig)];
return Object.keys(getFlattenedObject(this.rawConfig));
}

public toRaw() {
return cloneDeep(this.rawConfig);
}
}

function* flattenObjectKeys(
obj: { [key: string]: any },
path: string = ''
): IterableIterator<string> {
if (typeof obj !== 'object' || obj === null) {
yield path;
} else {
for (const [key, value] of Object.entries(obj)) {
const newPath = path !== '' ? `${path}.${key}` : key;
yield* flattenObjectKeys(value, newPath);
}
}
}
18 changes: 18 additions & 0 deletions src/core/server/legacy/config/get_unused_config_keys.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,24 @@ describe('getUnusedConfigKeys', () => {
).toEqual(['foo.dolly']);
});

it('handles array values', async () => {
expect(
await getUnusedConfigKeys({
coreHandledConfigPaths: ['core', 'array'],
pluginSpecs: [],
disabledPluginSpecs: [],
settings: {
core: {
prop: 'value',
array: [1, 2, 3],
},
array: ['some', 'values'],
},
legacyConfig: getConfig({}),
})
).toEqual([]);
});

describe('using deprecation', () => {
it('should use the plugin deprecations provider', async () => {
expect(
Expand Down
6 changes: 6 additions & 0 deletions src/core/server/legacy/logging/appenders/legacy_appender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ export class LegacyAppender implements DisposableAppender {
legacyLoggingConfig: schema.any(),
});

/**
* Sets {@link Appender.receiveAllLevels} because legacy does its own filtering based on the legacy logging
* configuration.
*/
public readonly receiveAllLevels = true;

private readonly loggingServer: LegacyLoggingServer;

constructor(legacyLoggingConfig: Readonly<LegacyVars>) {
Expand Down
1 change: 1 addition & 0 deletions src/core/server/legacy/plugins/find_legacy_plugin_specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function getNavLinks(uiExports: LegacyUiExports, pluginSpecs: LegacyPluginSpec[]
order: typeof spec.order === 'number' ? spec.order : 0,
url: spec.url,
subUrlBase: spec.subUrlBase || spec.url,
disableSubUrlTracking: spec.disableSubUrlTracking,
icon: spec.icon,
euiIconType: spec.euiIconType,
linkToLastSub: 'linkToLastSubUrl' in spec ? spec.linkToLastSubUrl : false,
Expand Down
6 changes: 6 additions & 0 deletions src/core/server/logging/appenders/appenders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ export type AppenderConfigType = TypeOf<typeof appendersSchema>;
*/
export interface Appender {
append(record: LogRecord): void;

/**
* Used to signal to `Logger` that log level filtering should be ignored for this appender. Defaults to `false`.
* @deprecated Should be removed once the `LegacyAppender` is removed.
*/
receiveAllLevels?: boolean;
}

/**
Expand Down
Loading

0 comments on commit cbb6c23

Please sign in to comment.