Skip to content

Commit

Permalink
Merge branch 'master' into prepare-alerting-so-to-sharecapable
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine committed Aug 31, 2021
2 parents 5380454 + 01e1e4a commit 76a60cf
Show file tree
Hide file tree
Showing 263 changed files with 5,483 additions and 2,507 deletions.
2 changes: 2 additions & 0 deletions .ci/Jenkinsfile_baseline_trigger
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/groovy

return

def MAXIMUM_COMMITS_TO_CHECK = 10
def MAXIMUM_COMMITS_TO_BUILD = 5

Expand Down
56 changes: 31 additions & 25 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,34 @@
# Virtual teams
/x-pack/plugins/rule_registry/ @elastic/rac

# App
/x-pack/plugins/discover_enhanced/ @elastic/kibana-app
/x-pack/plugins/lens/ @elastic/kibana-app
/x-pack/plugins/graph/ @elastic/kibana-app
/src/plugins/advanced_settings/ @elastic/kibana-app
/src/plugins/charts/ @elastic/kibana-app
/src/plugins/discover/ @elastic/kibana-app
/src/plugins/management/ @elastic/kibana-app
/src/plugins/kibana_legacy/ @elastic/kibana-app
/src/plugins/timelion/ @elastic/kibana-app
/src/plugins/vis_default_editor/ @elastic/kibana-app
/src/plugins/vis_type_metric/ @elastic/kibana-app
/src/plugins/vis_type_table/ @elastic/kibana-app
/src/plugins/vis_type_tagcloud/ @elastic/kibana-app
/src/plugins/vis_type_timelion/ @elastic/kibana-app
/src/plugins/vis_type_timeseries/ @elastic/kibana-app
/src/plugins/vis_type_vega/ @elastic/kibana-app
/src/plugins/vis_types/vislib/ @elastic/kibana-app
/src/plugins/vis_types/xy/ @elastic/kibana-app
/src/plugins/vis_types/pie/ @elastic/kibana-app
/src/plugins/visualize/ @elastic/kibana-app
/src/plugins/visualizations/ @elastic/kibana-app
/src/plugins/chart_expressions/expression_tagcloud/ @elastic/kibana-app
/src/plugins/url_forwarding/ @elastic/kibana-app
/packages/kbn-tinymath/ @elastic/kibana-app
# Data Discovery
/src/plugins/discover/ @elastic/kibana-data-discovery
/x-pack/plugins/discover_enhanced/ @elastic/kibana-data-discovery
/test/functional/apps/discover/ @elastic/kibana-data-discovery

# Vis Editors
/x-pack/plugins/lens/ @elastic/kibana-vis-editors
/x-pack/plugins/graph/ @elastic/kibana-vis-editors
/src/plugins/advanced_settings/ @elastic/kibana-vis-editors
/src/plugins/charts/ @elastic/kibana-vis-editors
/src/plugins/management/ @elastic/kibana-vis-editors
/src/plugins/kibana_legacy/ @elastic/kibana-vis-editors
/src/plugins/timelion/ @elastic/kibana-vis-editors
/src/plugins/vis_default_editor/ @elastic/kibana-vis-editors
/src/plugins/vis_type_metric/ @elastic/kibana-vis-editors
/src/plugins/vis_type_table/ @elastic/kibana-vis-editors
/src/plugins/vis_type_tagcloud/ @elastic/kibana-vis-editors
/src/plugins/vis_type_timelion/ @elastic/kibana-vis-editors
/src/plugins/vis_type_timeseries/ @elastic/kibana-vis-editors
/src/plugins/vis_type_vega/ @elastic/kibana-vis-editors
/src/plugins/vis_types/vislib/ @elastic/kibana-vis-editors
/src/plugins/vis_types/xy/ @elastic/kibana-vis-editors
/src/plugins/vis_types/pie/ @elastic/kibana-vis-editors
/src/plugins/visualize/ @elastic/kibana-vis-editors
/src/plugins/visualizations/ @elastic/kibana-vis-editors
/src/plugins/chart_expressions/expression_tagcloud/ @elastic/kibana-vis-editors
/src/plugins/url_forwarding/ @elastic/kibana-vis-editors
/packages/kbn-tinymath/ @elastic/kibana-vis-editors

# Application Services
/examples/bfetch_explorer/ @elastic/kibana-app-services
Expand Down Expand Up @@ -436,6 +439,9 @@
/x-pack/test/reporting_api_integration/ @elastic/kibana-reporting-services @elastic/kibana-app-services
/x-pack/test/reporting_functional/ @elastic/kibana-reporting-services @elastic/kibana-app-services
/x-pack/test/stack_functional_integration/apps/reporting/ @elastic/kibana-reporting-services @elastic/kibana-app-services
/docs/user/reporting @elastic/kibana-reporting-services @elastic/kibana-app-services
/docs/settings/reporting-settings.asciidoc @elastic/kibana-reporting-services @elastic/kibana-app-services
/docs/setup/configuring-reporting.asciidoc @elastic/kibana-reporting-services @elastic/kibana-app-services
#CC# /x-pack/plugins/reporting/ @elastic/kibana-reporting-services


2 changes: 1 addition & 1 deletion .github/workflows/project-assigner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
issue-mappings: |
[
{"label": "Feature:Lens", "projectNumber": 32, "columnName": "Long-term goals"},
{"label": "Feature:Discover", "projectNumber": 44, "columnName": "Inbox"},
{"label": "Team:DataDiscovery", "projectNumber": 44, "columnName": "Inbox"},
{"label": "Feature:Canvas", "projectNumber": 38, "columnName": "Inbox"},
{"label": "Feature:Dashboard", "projectNumber": 68, "columnName": "Inbox"},
{"label": "Feature:Drilldowns", "projectNumber": 68, "columnName": "Inbox"},
Expand Down
2 changes: 1 addition & 1 deletion dev_docs/building_blocks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Check out the Lens Embeddable if you wish to show users visualizations based on
and <DocLink id="kibBuildingBlocks" section="ui-actions--triggers" text="UI Actions"/>. Using the same configuration, it's also possible to link to
a prefilled Lens editor, allowing the user to drill deeper and explore their data.

**Github labels**: `Team:KibanaApp`, `Feature:Lens`
**Github labels**: `Team:VisEditors`, `Feature:Lens`

### Map Embeddable

Expand Down
13 changes: 6 additions & 7 deletions docs/settings/reporting-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -281,16 +281,15 @@ NOTE: This setting exists for backwards compatibility, but is unused and hardcod
[[reporting-advanced-settings]]
==== Security settings

[[xpack-reporting-roles-enabled]] `xpack.reporting.roles.enabled`::
deprecated:[7.14.0,This setting must be set to `false` in 8.0.] When `true`, grants users access to the {report-features} by assigning reporting roles, specified by `xpack.reporting.roles.allow`. Granting access to users this way is deprecated. Set to `false` and use {kibana-ref}/kibana-privileges.html[{kib} privileges] instead. Defaults to `true`.
With Security enabled, Reporting has two forms of access control: each user can only access their own reports, and custom roles determine who has privilege to generate reports. When Reporting is configured with <<kibana-privileges, {kib} application privileges>>, you can control the spaces and applications where users are allowed to generate reports.

[NOTE]
============================================================================
In 7.x, the default value of `xpack.reporting.roles.enabled` is `true`. To migrate users to the
new method of securing access to *Reporting*, you must set `xpack.reporting.roles.enabled: false`. In the next major version of {kib}, `false` will be the only valid configuration.
The `xpack.reporting.roles` settings are for a deprecated system of access control in Reporting. It does not allow API Keys to generate reports, and it doesn't allow {kib} application privileges. We recommend you explicitly turn off reporting's deprecated access control feature by adding `xpack.reporting.roles.enabled: false` in kibana.yml. This will enable application privileges for reporting, as described in <<grant-user-access, granting users access to reporting>>.
============================================================================

`xpack.reporting.roles.allow`::
deprecated:[7.14.0,This setting will be removed in 8.0.] Specifies the roles, in addition to superusers, that can generate reports, using the {ref}/security-api.html#security-role-apis[{es} role management APIs]. Requires `xpack.reporting.roles.enabled` to be `true`. Granting access to users this way is deprecated. Use {kibana-ref}/kibana-privileges.html[{kib} privileges] instead. Defaults to `[ "reporting_user" ]`.
[[xpack-reporting-roles-enabled]] `xpack.reporting.roles.enabled`::
deprecated:[7.14.0,The default for this setting will be `false` in an upcoming version of {kib}.] Sets access control to a set of assigned reporting roles, specified by `xpack.reporting.roles.allow`. Defaults to `true`.

NOTE: Each user has access to only their own reports.
`xpack.reporting.roles.allow`::
deprecated:[7.14.0] In addition to superusers, specifies the roles that can generate reports using the {ref}/security-api.html#security-role-apis[{es} role management APIs]. Requires `xpack.reporting.roles.enabled` to be `true`. Defaults to `[ "reporting_user" ]`.
17 changes: 12 additions & 5 deletions docs/setup/configuring-reporting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,16 @@ To troubleshoot the problem, start the {kib} server with environment variables t
[float]
[[grant-user-access]]
=== Grant users access to reporting
When security is enabled, you grant users access to generate reports with <<kibana-privileges, {kib} application privileges>>, which allow you to create custom roles that control the spaces and applications where users generate reports.

When security is enabled, access to the {report-features} is controlled by roles and <<kibana-privileges, privileges>>. With privileges, you can define custom roles that grant *Reporting* privileges as sub-features of {kib} applications. To grant users permission to generate reports and view their reports in *Reporting*, create and assign the reporting role.

[[reporting-app-users]]
NOTE: In 7.12.0 and earlier, you grant access to the {report-features} by assigning users the `reporting_user` role in {es}.
. Enable application privileges in Reporting. To enable, turn off the default user access control features in `kibana.yml`:
+
[source,yaml]
------------------------------------
xpack.reporting.roles.enabled: false
------------------------------------
+
NOTE: If you use the default settings, you can still create a custom role that grants reporting privileges. The default role is `reporting_user`. This behavior is being deprecated and does not allow application-level access controls for {report-features}, and does not allow API keys or authentication tokens to authorize report generation. Refer to <<reporting-advanced-settings, reporting security settings>> for information and caveats about the deprecated access control features.

. Create the reporting role.

Expand Down Expand Up @@ -90,10 +95,12 @@ If the *Reporting* option is unavailable, contact your administrator, or <<repor

.. Click *Update user*.

Granting the privilege to generate reports also grants the user the privilege to view their reports in *Stack Management > Reporting*. Users can only access their own reports.

[float]
[[reporting-roles-user-api]]
==== Grant access with the role API
You can also use the {ref}/security-api-put-role.html[role API] to grant access to the reporting features. Grant the reporting role to users in combination with other roles that grant read access to the data in {es}, and at least read access in the applications where users can generate reports.
With <<grant-user-access, {kib} application privileges>> enabled in Reporting, you can also use the {ref}/security-api-put-role.html[role API] to grant access to the {report-features}. Grant custom reporting roles to users in combination with other roles that grant read access to the data in {es}, and at least read access in the applications where users can generate reports.

[source, sh]
---------------------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions renovate.json5
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
extends: [
'config:base',
':disableDependencyDashboard',
],
ignorePaths: [
'**/__fixtures__/**',
Expand All @@ -12,12 +13,11 @@
baseBranches: [
'master',
'7.x',
'7.13',
'7.15',
],
prConcurrentLimit: 0,
prHourlyLimit: 0,
separateMajorMinor: false,
masterIssue: true,
rangeStrategy: 'bump',
semanticCommits: false,
vulnerabilityAlerts: {
Expand All @@ -39,7 +39,7 @@
packageNames: ['@elastic/charts'],
reviewers: ['markov00', 'nickofthyme'],
matchBaseBranches: ['master'],
labels: ['release_note:skip', 'v8.0.0', 'v7.14.0', 'auto-backport'],
labels: ['release_note:skip', 'v8.0.0', 'v7.16.0', 'auto-backport'],
enabled: true,
},
{
Expand Down Expand Up @@ -69,9 +69,9 @@
{
groupName: 'vega related modules',
packageNames: ['vega', 'vega-lite', 'vega-schema-url-parser', 'vega-tooltip'],
reviewers: ['team:kibana-app'],
reviewers: ['team:kibana-vis-editors'],
matchBaseBranches: ['master'],
labels: ['Feature:Vega', 'Team:KibanaApp'],
labels: ['Feature:Vega', 'Team:VisEditors'],
enabled: true,
},
],
Expand Down
3 changes: 3 additions & 0 deletions src/core/server/elasticsearch/client/client_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ export function parseClientOptions(
...DEFAULT_HEADERS,
...config.customHeaders,
},
// do not make assumption on user-supplied data content
// fixes https://github.com/elastic/kibana/issues/101944
disablePrototypePoisoningProtection: true,
};

if (config.pingTimeout != null) {
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/advanced_settings/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"optionalPlugins": ["home", "usageCollection"],
"requiredBundles": ["kibanaReact", "kibanaUtils", "home", "esUiShared"],
"owner": {
"name": "Kibana App",
"githubTeam": "kibana-app"
"name": "Vis Editors",
"githubTeam": "kibana-vis-editors"
}
}
4 changes: 2 additions & 2 deletions src/plugins/chart_expressions/expression_tagcloud/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"requiredBundles": ["kibanaUtils"],
"optionalPlugins": [],
"owner": {
"name": "Kibana App",
"githubTeam": "kibana-app"
"name": "Vis Editors",
"githubTeam": "kibana-vis-editors"
},
"description": "Expression Tagcloud plugin adds a `tagcloud` renderer and function to the expression plugin. The renderer will display the `Wordcloud` chart."
}
4 changes: 2 additions & 2 deletions src/plugins/charts/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"ui": true,
"requiredPlugins": ["expressions"],
"owner": {
"name": "Kibana App",
"githubTeam": "kibana-app"
"name": "Vis Editors",
"githubTeam": "kibana-vis-editors"
}
}
1 change: 1 addition & 0 deletions src/plugins/discover/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ export const MODIFY_COLUMNS_ON_SWITCH = 'discover:modifyColumnsOnSwitch';
export const SEARCH_FIELDS_FROM_SOURCE = 'discover:searchFieldsFromSource';
export const MAX_DOC_FIELDS_DISPLAYED = 'discover:maxDocFieldsDisplayed';
export const SHOW_MULTIFIELDS = 'discover:showMultiFields';
export const SEARCH_EMBEDDABLE_TYPE = 'search';
5 changes: 3 additions & 2 deletions src/plugins/discover/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
],
"optionalPlugins": ["home", "share", "usageCollection"],
"requiredBundles": ["kibanaUtils", "home", "kibanaReact", "fieldFormats"],
"extraPublicDirs": ["common"],
"owner": {
"name": "Kibana App",
"githubTeam": "kibana-app"
"name": "Data Discovery",
"githubTeam": "kibana-data-discovery"
},
"description": "This plugin contains the Discover application and the saved search embeddable."
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
* Side Public License, v 1.
*/

export const SEARCH_EMBEDDABLE_TYPE = 'search';
export { SEARCH_EMBEDDABLE_TYPE } from '../../../common/index';
2 changes: 1 addition & 1 deletion src/plugins/embeddable/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"githubTeam": "kibana-app-services"
},
"requiredPlugins": ["inspector", "uiActions"],
"extraPublicDirs": ["public/lib/test_samples"],
"extraPublicDirs": ["public/lib/test_samples", "common"],
"requiredBundles": ["savedObjects", "kibanaReact", "kibanaUtils"]
}
4 changes: 3 additions & 1 deletion src/plugins/expressions/common/execution/execution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -763,13 +763,15 @@ describe('Execution', () => {
});

test('saves duration it took to execute each function', async () => {
const startTime = Date.now();
const execution = createExecution('add val=1 | add val=2 | add val=3', {}, true);
execution.start(-1);
await execution.result.toPromise();
const duration = Date.now() - startTime;

for (const node of execution.state.get().ast.chain) {
expect(typeof node.debug?.duration).toBe('number');
expect(node.debug?.duration).toBeLessThan(100);
expect(node.debug?.duration).toBeLessThanOrEqual(duration);
expect(node.debug?.duration).toBeGreaterThanOrEqual(0);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export type ExpressionsServiceSetup = Pick<
| 'registerType'
| 'run'
| 'fork'
| 'extract'
| 'inject'
>;

export interface ExpressionExecutionParams {
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/expressions/public/mocks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ export type Start = jest.Mocked<ExpressionsStart>;

const createSetupContract = (): Setup => {
const setupContract: Setup = {
extract: jest.fn(),
fork: jest.fn(),
getFunction: jest.fn(),
getFunctions: jest.fn(),
getRenderer: jest.fn(),
getRenderers: jest.fn(),
getType: jest.fn(),
getTypes: jest.fn(),
inject: jest.fn(),
registerFunction: jest.fn(),
registerRenderer: jest.fn(),
registerType: jest.fn(),
Expand Down
2 changes: 2 additions & 0 deletions src/plugins/expressions/server/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ export type Start = jest.Mocked<ExpressionsServerStart>;

const createSetupContract = (): Setup => {
const setupContract: Setup = {
extract: jest.fn(),
fork: jest.fn(),
getFunction: jest.fn(),
getFunctions: jest.fn(),
getRenderer: jest.fn(),
getRenderers: jest.fn(),
getType: jest.fn(),
getTypes: jest.fn(),
inject: jest.fn(),
registerFunction: jest.fn(),
registerRenderer: jest.fn(),
registerType: jest.fn(),
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/home/public/application/components/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class Home extends Component<HomeProps, State> {
if (this.state.isLoading) {
this.setState({ isWelcomeEnabled: false });
}
}, 500);
}, 10000);

const hasUserIndexPattern = await this.props.hasUserIndexPattern();

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/inspector/common/adapters/request/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
* Side Public License, v 1.
*/

export { RequestStatistic, RequestStatistics, RequestStatus } from './types';
export { Request, RequestStatistic, RequestStatistics, RequestStatus } from './types';
export { RequestAdapter } from './request_adapter';
export { RequestResponder } from './request_responder';
11 changes: 8 additions & 3 deletions src/plugins/inspector/common/adapters/request/request_adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,19 @@ export class RequestAdapter extends EventEmitter {
* {@link RequestResponder#error}.
*
* @param {string} name The name of this request as it should be shown in the UI.
* @param {object} args Additional arguments for the request.
* @param {RequestParams} params Additional arguments for the request.
* @param {number} [startTime] Set an optional start time for the request
* @return {RequestResponder} An instance to add information to the request and finish it.
*/
public start(name: string, params: RequestParams = {}): RequestResponder {
public start(
name: string,
params: RequestParams = {},
startTime: number = Date.now()
): RequestResponder {
const req: Request = {
...params,
name,
startTime: Date.now(),
startTime,
status: RequestStatus.PENDING,
id: params.id ?? uuid(),
};
Expand Down
1 change: 1 addition & 0 deletions src/plugins/inspector/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

export {
Adapters,
Request,
RequestAdapter,
RequestStatistic,
RequestStatistics,
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/kibana_legacy/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"server": true,
"ui": true,
"owner": {
"name": "Kibana App",
"githubTeam": "kibana-app"
"name": "Vis Editors",
"githubTeam": "kibana-vis-editors"
}
}
4 changes: 2 additions & 2 deletions src/plugins/management/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"optionalPlugins": ["home", "share"],
"requiredBundles": ["kibanaReact", "kibanaUtils", "home"],
"owner": {
"name": "Kibana App",
"githubTeam": "kibana-app"
"name": "Vis Editors",
"githubTeam": "kibana-vis-editors"
}
}
Loading

0 comments on commit 76a60cf

Please sign in to comment.