Commit graph

805 commits

Author SHA1 Message Date
Gerard Soldevila
754e8682d4
Introduce CLEANUP_UNKNOWN_AND_EXCLUDED step (#149931)
In the context of migrations,
https://github.com/elastic/kibana/pull/147371 avoids reindexing during
an upgrade, provided that `diffMappings === false`.

This _alternative path_ skips some key steps that are performed before
reindexing:
* `CHECK_UNKNOWN_DOCUMENTS`
* `CALCULATE_EXCLUDE_FILTERS`

These steps enrich a search query that is used during reindexing,
effectively filtering out undesired documents.

If the mappings [match](https://github.com/elastic/kibana/pull/147371)
(or they are
[compatible](https://github.com/elastic/kibana/pull/149326)) and we _no
longer reindex_, this cleanup operation does not happen, leaving
undesired documents in our system indices.

The goal of this PR is to add an extra step in the state machine
(`CLEANUP_UNKNOWN_AND_EXCLUDED`), which will actively cleanup a system
index if we're going the _skip reindexing_ path.


![image](https://user-images.githubusercontent.com/25349407/216979691-fef40638-f990-4850-bac8-ee3e58330a7f.png)

Fixes https://github.com/elastic/kibana/issues/150299

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-27 11:43:13 +01:00
Rachel Shen
d2453beee0
[Accessibility] Route changes announcement (#150461)
Co-authored-by: Constance Chen <constance.chen@elastic.co>
Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com>
2023-02-24 09:46:58 -07:00
Ahmad Bamieh
dc927d98ba
[core][http] add response file method (#151130)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-24 12:06:37 +03:00
Christiane (Tina) Heiligers
a8f10ed6cb
[Saved Objects] Adds config flag to toggle hiddenFromHttpApis SO types conditionally (#151512)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-02-22 07:59:50 -07:00
Jean-Louis Leysens
acf7d0134e
[HTTP] Versioned API router designs (#151596)
## Summary

This PR contains the initial designs for our versioned router API. This
contribution contains only types, any implementation will come in later
PRs.

Previous PR https://github.com/elastic/kibana/pull/149943

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Ahmad Bamieh <ahmadbamieh@gmail.com>
2023-02-22 05:33:43 -07:00
Luke G
d92d691946
Generate kbn/ecs with ECS 8.6.1 (#151642)
## Summary

This PR updates kbn/ecs to defintions generated with ECS 8.6.1

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-21 15:02:38 +01:00
Maja Grubic
a7293f62b5
[Custom Branding] Add custom branding settings to Global settings (#150080)
## Summary

This PR registers custom branding settings from the `custom_branding`
plugin. Once registered, these settings can be viewed under "Global
settings".

UI changes:
<img width="1761" alt="Screenshot 2023-02-06 at 19 59 19"
src="https://user-images.githubusercontent.com/1937956/217060900-7e56c8e9-7d3d-4ac5-96b6-8a8a85d3c1c3.png">

I also removed the client-side version of the `custom_branding` plugin,
as it's not needed.

With this change, it became easier to test custom branding, so I made a
few changes where logo was not showing properly or image size was wrong
or test subjects were missing.

I am working with @gchaps on the exact wording, so that might change. 

### Checklist

Delete any items that are not applicable to this PR.

- [X] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [X]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [X] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [X] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [X] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
~- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~
- [X] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [X] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>
2023-02-16 08:13:42 +01:00
Cee Chen
af25a3e073
Upgrade EUI to v75.1.0 (#151200)
## Summary

`eui@75.0.0`  `eui@75.1.0`

---

## [`75.1.0`](https://github.com/elastic/eui/tree/v75.1.0)

- Added padding to `EuiStep` title to better align with icon
([#6555](https://github.com/elastic/eui/pull/6555))
- Added a new `lineNumbers.annotations` API to `EuiCodeBlock`. This new
feature displays an informational icon next to the specified line
number(s), providing more context via popover
([#6580](https://github.com/elastic/eui/pull/6580))

**Bug fixes**

- Fixed bug in `EuiRange` where styles were applied incorrectly when
custom ticks were passed but `showTicks` were false
([#6588](https://github.com/elastic/eui/pull/6588))
- Fixed `fleetApp` and `agentApp` icons that were swapped
([#6590](https://github.com/elastic/eui/pull/6590))

**CSS-in-JS conversions**

- Converted `EuiSteps` to Emotion; Removed `$euiStepStatusColorsToFade`,
`$euiStepNumberSize`, `$euiStepNumberSmallSize`, and
`$euiStepNumberMargin`
([#6555](https://github.com/elastic/eui/pull/6555))
2023-02-15 11:17:29 -08:00
Christiane (Tina) Heiligers
4e1b4c299c
Core to SharedOX ownership Transfer: Updates code owners for handover to sharedUX (#151213)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-15 11:33:39 -07:00
Jean-Louis Leysens
5b0b09b59b
[Saved Objects] Remove deprecation notices from server SO types (#150839)
## Summary

After merging https://github.com/elastic/kibana/pull/148979 there are a
few interfaces in the server-side code that export a reference to a
deprecated SO type.

In this PR we fix them by updating a few imports to use the
non-deprecated SO type. Additionally, we resolve a potential circular
reference issue between `core-saved-objects-server` and
`core-saved-objects-api-server` by "moving" saved objects and related
types exports to `core-saved-objects-api-server`
2023-02-15 17:13:27 +01:00
Jeramy Soucy
5de13d49ac
[Saved Objects] Migrates authorization logic from repository to security extension (#148165)
Closes #147049
Closes #149897

Migrates authorization and audit logic from the Saved Objects Repository
to the Saved Objects Security Extension. This is achieved by
implementing action-specific authorization methods within the security
extension. The SO repository is no longer responsible for making any
authorization decisions, but It is still responsible to know how to call
the extension methods. I've tried to make this as straightforward as
possible such that there is a clear ownership delineation between the
repository and the extension, by keeping the interface simple and
(hopefully) obvious.

### Security Extension Interface
New Public Extension Methods:
- authorizeCreate
- authorizeBulkCreate
- authorizeUpdate
- authorizeBulkUpdate
- authorizeDelete
- authorizeBulkDelete
- authorizeGet
- authorizeBulkGet
- authorizeCheckConflicts
- authorizeRemoveReferences
- authorizeOpenPointInTime
- auditClosePointInTime
- authorizeAndRedactMultiNamespaceReferences
- authorizeAndRedactInternalBulkResolve
- authorizeUpdateSpaces
- authorizeFind
- getFindRedactTypeMap
- authorizeDisableLegacyUrlAliases (for secure spaces client)
- auditObjectsForSpaceDeletion (for secure spaces client)

Removed from public interface:
- authorize
- enforceAuthorization
- addAuditEvent

### Tests
- Most test coverage moved from `repository.security_extension.test.ts`
to `saved_objects_security_extension.test.ts`
- `repository.security_extension.test.ts` tests extension call,
parameters, and return
- Updates repository unit tests to check that all security extension
calls are made with the current space when the spaces extension is also
enabled

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: gchaps <33642766+gchaps@users.noreply.github.com>
2023-02-15 10:25:05 -05:00
Pierre Gayvallet
e64d54577e
register model version migration to the document migrator (#150842)
## Summary

Part of https://github.com/elastic/kibana/issues/150301

- Add logic to converts model version transformations to the format used
by the document migrator
- Use in when preparing migration data for the document migrator
- Improve the migration validation logic to take model versions into
account (and clean it)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-15 01:36:18 -07:00
Rachel Shen
50a4fc4916
[Shared UX] Adoption of Shared UX Route component (#150357)
## Summary

This PR removes all imports of Route from react-router-dom and
'@kbn/kibana-react-plugin/public' and instead imports Route from
@kbn/shared-ux-router.

### Context
Based on
https://github.com/elastic/kibana/issues/132629#issue-1243243678 This PR
executes steps 2 - 4:

> 2. To make the transition easier, we want to re-export other
react-router-dom exports alongside the modified' Route'.
> 3. Solutions should start using that Route component in place of the
one from react-router-dom. I.e. replace all occurrences of import { ...
} from 'react-router-dom' with import { ... } from
'@kbn/shared-ux-router'.
> 4. All manual calls to useExecutionContext are not needed anymore and
should be removed.

### Future PR

Looks like this might be getting worked on in:
https://github.com/elastic/kibana/pull/145863 (thanks!)

> Introduce an ESlint rule that ensures that react-router-dom is not
used directly in Kibana and that imports go through the new
@kbn/shared-ux-router package.

This is tangentially accomplished through
https://github.com/elastic/kibana/pull/150340 but only addresses using
Route through @kbn/kibana-react-plugin/public'


### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Tiago Costa <tiagoffcc@hotmail.com>
2023-02-14 19:25:04 +00:00
Trevor Pierce
584b2ff1e3
Upgrade EUI to v75.0.0 (#150787)
## Summary

`eui@74.0.2`  `eui@75.0.0`

___

## [`75.0.0`](https://github.com/elastic/eui/tree/v75.0.0)

- `EuiFlyout`s now automatically shard all fixed `EuiHeader`s on the
page. This means that interactions (mouse & keyboard) with items inside
`EuiHeader`s when flyouts are open will no longer trigger focus fighting
([#6566](https://github.com/elastic/eui/pull/6566))
- `EuiFlyout`s now read out detailed screen reader dialog instructions
and hints on open ([#6566](https://github.com/elastic/eui/pull/6566))

**Bug fixes**

- Fixed `EuiSelectable` options with incorrect `aria-posinset` indices
when rendered with group labels not at the start of the array
([#6571](https://github.com/elastic/eui/pull/6571))
- Fixed a bug with `EuiSearchBar` where filters with `multiSelect:
false` were not able to select a new option when an option was already
selected ([#6577](https://github.com/elastic/eui/pull/6577))

**Breaking changes**

- Removed the ability to customize the `role` prop of `EuiFlyout`s.
`EuiFlyout`s should always be dialog roles for screen reader
consistency. ([#6566](https://github.com/elastic/eui/pull/6566))
- Removed `closeButtonAriaLabel` prop from `EuiFlyout` - use
`closeButtonProps['aria-label']` instead
([#6566](https://github.com/elastic/eui/pull/6566))

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-02-14 12:04:17 -06:00
Christiane (Tina) Heiligers
8f4e5c53ff
[Saved Objects] Logs warning when deprecated SO APIs are called (#150775)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-02-13 09:32:08 -07:00
Maja Grubic
99bb6fd203
[Advanced Settings] Fix badge counter for global settings (#150869)
## Summary

This PR fixes the badge count for Global settings, which was incorrectly
showing there are results, when there were in fact none. Also, changing
the owners of the `ui-settings` related packages and plugins from core
to `shared-ux`.

<img width="1231" alt="Screenshot 2023-02-10 at 13 04 58"
src="https://user-images.githubusercontent.com/1937956/218398812-67a9f644-6319-4d1c-a2a9-15894a1e3b2c.png">




### Checklist

Delete any items that are not applicable to this PR.

~- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)~
~- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials~
~- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios~
~- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard
accessibility](https://webaim.org/techniques/keyboard/))~
~- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))~
~- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~
~- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))~
~- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)~


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-13 11:46:56 +01:00
Michael Dokolin
caee8cbe8e
[Saved Objects] Update document migrator not to bump core version on every migration (#150443) 2023-02-10 17:45:49 +01:00
Jason Stoltzfus
20a9a01cef
Upgrade EUI to v74.1.0 (#150235)
## Summary

`eui@74.0.1`  `eui@74.1.0`

___

## [`74.1.0`](https://github.com/elastic/eui/releases/tag/v74.1.0)

- Added new `EuiSkeletonText`, `EuiSkeletonTitle`, `EuiSkeletonCircle`,
and `EuiSkeletonRectangle` components
([#6502](https://github.com/elastic/eui/pull/6502))
- Updated `EuiSuperSelect` screen reader instructions to be more
specific ([#6549](https://github.com/elastic/eui/pull/6549))
- Added `error` and updated `alert` glyphs to `EuiIcon`
([#6550](https://github.com/elastic/eui/pull/6550))
- All `EuiSkeleton` components now accept an `isLoading` flag and
`children`, which automatically handles conditionally rendering loading
skeletons vs. loaded content (`children`)
([#6562](https://github.com/elastic/eui/pull/6562))
- All `EuiSkeleton` components now accept a `contentAriaLabel` prop,
which more meaningfully describes the loaded content to screen readers
([#6562](https://github.com/elastic/eui/pull/6562))
- Updated `EuiPopover` screen reader instructions for mobile and click
behaviors ([#6567](https://github.com/elastic/eui/pull/6567))

**Bug fixes**

- Fixed `EuiCard` to ensure `onClick` method only runs once when `title`
contains a React node
([#6551](https://github.com/elastic/eui/pull/6551))

**Deprecations**

- Deprecated `EuiLoadingContent` - use `EuiSkeletonText` instead
([#6557](https://github.com/elastic/eui/pull/6557))

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-02-09 13:12:35 -07:00
Julia Rechkunova
3b1ff55ac8
Address react warnings (#150680)
This PR addresses React warnings:

<details>
<summary>1. When chart is rendered on Discover page</summary>
<p>
react_devtools_backend.js:4012 Warning: Failed prop type: Invalid prop
`children` of type `array` supplied to `PseudoLocaleWrapper`, expected a
single ReactElement.
at PseudoLocaleWrapper
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.js:14195:5)
at I18nProvider
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.js:14126:3)
at CurrentEuiBreakpointProvider
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:165359:23)
at EuiThemeProvider
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:170451:22)
at EuiCacheProvider
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:142029:20)
at EuiProvider
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:142129:25)
at KibanaThemeProvider
(http://localhost:5601/qoz/9007199254740991/bundles/plugin/kibanaReact/1.0.0/kibanaReact.plugin.js:4624:3)
</p>
</details>

<details>
<summary>2. When Kibana nav is opened</summary>
<p>
react_devtools_backend.js:4012 Warning: React does not recognize the
`dataTestSubj` prop on a DOM element. If you intentionally want it to
appear in the DOM as a custom attribute, spell it as lowercase
`datatestsubj` instead. If you accidentally passed it from a parent
component, remove it from the DOM element.
    at a
at
http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:174472:73
at
http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:80747:24
at
http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:174472:73
at EuiButton
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:80550:25)
    at div
    at div
at EuiCollapsibleNavGroup
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:84295:24)
    at div
at
http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:174472:73
at EuiFlexItem
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:111981:23)
    at nav
at
http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:174472:73
    at div
at
http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:364444:59
at FocusLockUI
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:360747:71)
at
http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:361650:60
at EuiFocusTrap
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:112986:81)
at EuiPortal
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:141607:81)
at
http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:112245:24
at EuiCollapsibleNav
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:84156:17)
at CollapsibleNav
(http://localhost:5601/qoz/9007199254740991/bundles/core/core.entry.js:10856:3)
    at div
at EuiHeaderSectionItem
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:121458:26)
    at div
at EuiHeaderSection
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:121399:24)
    at div
at EuiHeader
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:120782:23)
    at div
    at header
at Header
(http://localhost:5601/qoz/9007199254740991/bundles/core/core.entry.js:11177:3)
at CurrentEuiBreakpointProvider
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:165359:23)
at EuiThemeProvider
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:170451:22)
at EuiCacheProvider
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:142029:20)
at EuiProvider
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:142129:25)
at CoreThemeProvider
(http://localhost:5601/qoz/9007199254740991/bundles/core/core.entry.js:21741:3)
at EuiContext
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:90101:24)
at PseudoLocaleWrapper
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.js:14195:5)
at IntlProvider
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.js:149376:5)
at I18nProvider
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.js:14126:3)
at I18nContext
(http://localhost:5601/qoz/9007199254740991/bundles/core/core.entry.js:16388:9)
at CoreContextProvider
(http://localhost:5601/qoz/9007199254740991/bundles/core/core.entry.js:21669:3)
</p>
</details>

<details>
<summary>3. When visiting Home > Try sample data page</summary>
<p>
Warning: Cannot update a component (`HeaderBreadcrumbs`) while rendering
a different component (`TutorialDirectoryUi`). To locate the bad
setState() call inside `TutorialDirectoryUi`, follow the stack trace as
described in https://reactjs.org/link/setstate-in-render
at TutorialDirectoryUi
(http://localhost:5601/qoz/9007199254740991/bundles/plugin/home/1.0.0/home.chunk.0.js:13055:5)
at InjectIntl
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.js:149015:7)
at Route
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:365503:29)
at Switch
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:365709:29)
at Router
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:365132:30)
at HashRouter
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:364784:35)
at PseudoLocaleWrapper
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.js:14195:5)
at IntlProvider
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.js:149376:5)
at I18nProvider
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-src/kbn-ui-shared-deps-src.js:14126:3)
at HomeApp
(http://localhost:5601/qoz/9007199254740991/bundles/plugin/home/1.0.0/home.chunk.0.js:10827:3)
at SampleDataCardKibanaProvider
(http://localhost:5601/qoz/9007199254740991/bundles/plugin/home/1.0.0/home.chunk.0.js:6565:3)
at SampleDataTabKibanaProvider
(http://localhost:5601/qoz/9007199254740991/bundles/plugin/home/1.0.0/home.chunk.0.js:7107:3)
at Provider
(http://localhost:5601/qoz/9007199254740991/bundles/plugin/kibanaReact/1.0.0/kibanaReact.plugin.js:1794:15)
at CurrentEuiBreakpointProvider
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:165359:23)
at EuiThemeProvider
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:170451:22)
at EuiCacheProvider
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:142029:20)
at EuiProvider
(http://localhost:5601/qoz/9007199254740991/bundles/kbn-ui-shared-deps-npm/kbn-ui-shared-deps-npm.dll.js:142129:25)
at KibanaThemeProvider
(http://localhost:5601/qoz/9007199254740991/bundles/plugin/kibanaReact/1.0.0/kibanaReact.plugin.js:4624:3)
    at div
at RedirectAppLinks
(http://localhost:5601/qoz/9007199254740991/bundles/plugin/kibanaReact/1.0.0/kibanaReact.plugin.js:1415:3)
</p>
</details>
2023-02-09 08:20:11 -07:00
Rudolf Meijering
111d9d1f87
Cleanup enabled: false saved objects mappings (#149102)
## Summary

Clean up saved object mappings to reduce the field count and make
mappings more future-proof.

This PR attempts to remove all `enabled: false` mappings. It's not
possible to toggle the `enabled` property so it becomes impossible to
ever query over a disabled field. `type: 'object', enabled: 'false'`
also provides worse validation since it's possible to index a string
into such an object. So using `dynamic: false, properties: {}` provides
better validation and is more future-proof allowing us to query over
these fields should the need arise.

Since these fields can't be queried over it should be safe to remove
these mappings but please review and/or test to ensure there's no
regressions. If your plugin every relied on the lack of validation for
being able to ingest a `string` field into an `type: 'object', enabled:
'false'` field this PR would now cause failures.

Related: https://github.com/elastic/dev/issues/2189


### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2023-02-09 04:14:12 -07:00
Alejandro Fernández Haro
94085525a9
[SO PIT Finder] Ensure mandatory sort fields (#150574)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Resolves https://github.com/elastic/kibana/issues/150310
2023-02-09 11:23:20 +01:00
Spencer
1b85815402
[packages] migrate all plugins to packages (#148130)
Fixes https://github.com/elastic/kibana/issues/149344

This PR migrates all plugins to packages automatically. It does this
using `node scripts/lint_packages` to automatically migrate
`kibana.json` files to `kibana.jsonc` files. By doing this automatically
we can simplify many build and testing procedures to only support
packages, and not both "packages" and "synthetic packages" (basically
pointers to plugins).

The majority of changes are in operations related code, so we'll be
having operations review this before marking it ready for review. The
vast majority of the code owners are simply pinged because we deleted
all `kibana.json` files and replaced them with `kibana.jsonc` files, so
we plan on leaving the PR ready-for-review for about 24 hours before
merging (after feature freeze), assuming we don't have any blockers
(especially from @elastic/kibana-core since there are a few core
specific changes, though the majority were handled in #149370).

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-02-08 21:06:50 -06:00
Pierre Gayvallet
91ff710050
Preliminary DocumentMigrator cleanup (#150529)
Related to https://github.com/elastic/kibana/issues/150301

This PR tend to do some preliminary cleanup before diving into the
actual implementation. I'm mostly extracting things from the (way too
big and hard to read) document migrator, to increase readability,
maintainability and testability (note: I did not add additional unit
test for the extracted files, as I did not change the impl and as we'll
be rewriting them all soon enough - it would just have been a loss of
time)

- Move the document migrator from
`packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core`
to it's dedicated folder `document_migrator` folder
- Extract all the bits not directly performing the document
transformation (e.g building the migration map, validation, utils) to
their dedicated files
- Only moving things around. No concrete code (apart from types) was
modified, to ease managing conflicts with
https://github.com/elastic/kibana/pull/150443
2023-02-08 15:17:39 +01:00
Jean-Louis Leysens
e770455173
[Saved Objects] Update resolve doc comment (#150540)
## Summary

Per title
2023-02-08 05:15:48 -07:00
Pierre Gayvallet
7136039305
Introduce the SO versionModel API (#150149)
## Summary

Fix https://github.com/elastic/kibana/issues/150297

First step toward managed upgrades

This PR adds the types that will be used for the new SO model version
API, and adds the new properties to the `SavedObjectsType` type.

The implementation is outside of scope of the PR and will be implemented
in a future PR.

The PR also adapt the `check_registered_types` test to trigger a review
when the attributes of `SavedObjectsType` introduced in this PR are
changed.
2023-02-07 09:14:26 -07:00
Thomas Watson
50444bbd59
Change default value of csp.disableUnsafeEval to 'true' (#150157)
This change ensures that the `unsafe-eval` source expression isn't included in
the Kibana Content Security Policy (CSP) by default.

Users can set `csp.disableUnsafeEval: false` to reintroduce `unsafe-eval`.
However, since this config option is deprecated as of this commit, it's
recommended to instead set `csp.script_src: ['unsafe-eval']`.

Closes #150156
2023-02-07 07:07:13 -05:00
Christos Nasikas
7423b70b8a
[Cases] Create internal endpoint to get all participants of the case (#149663)
## Summary

This PR adds an internal API to get all users involved in a case. The
response returns the case's participants, the assignees, and the
unassigned users. A participant is considered anyone that made an action
to the case. The participants' array may contain an assignee and
vise-versa. Each user has `email`, `full_name`, `username`, and
`profile_uid`. All fields are optional. The endpoint will get all known
profiles using the security plugin. The profile information takes
precedence. The API will fall back to the information kept in the user
action if the profile uid is not valid.

**Endpoint:**
`GET /internal/cases/<case_id>/_users`

<details>
<summary>Example Response</summary>

```
{
    "participants": [
        {
            "email": null,
            "full_name": null,
            "username": "elastic",
            "profile_uid": "u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"
        },
       {
            "email": "fuzzy_marten@profiles.elastic.co",
            "full_name": "Fuzzy Marten",
            "username": "fuzzy_marten",
            "profile_uid": "u_3OgKOf-ogtr8kJ5B0fnRcqzXs2aQQkZLtzKEEFnKaYg_0"
        },
    ],
    "assignees": [
        {
            "email": "fuzzy_marten@profiles.elastic.co",
            "full_name": "Fuzzy Marten",
            "username": "fuzzy_marten",
            "profile_uid": "u_3OgKOf-ogtr8kJ5B0fnRcqzXs2aQQkZLtzKEEFnKaYg_0"
        },
        {
            "email": "misty_mackerel@profiles.elastic.co",
            "full_name": "Misty Mackerel",
            "username": "misty_mackerel",
            "profile_uid": "u_BXf_iGxcnicv4l-3-ER7I-XPpfanAFAap7uls86xV7A_0"
        }
    ],
    "unassignedUsers": [
        {
            "email": "valid_chimpanzee@profiles.elastic.co",
            "full_name": "Valid Chimpanzee",
            "username": "valid_chimpanzee",
            "profile_uid": "u_wEtPffVJIgxWIN8W79Rp84bbORN6x0wKiJ5eTsQvpBA_0"
        }
    ]
}
```

</details>

### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### For maintainers

- [x] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2023-02-06 08:55:18 -07:00
Shahzad
1ba94ec11c
[Synthetics] Remove synthetics ui feature flag (#149115)
Fixes https://github.com/elastic/kibana/issues/148969
2023-02-06 05:15:00 -07:00
Thomas Watson
4a1373c46f
Improve security of links using target=_blank (#150049) 2023-02-02 13:10:43 +01:00
Rachel Shen
a32b5a450a
[Custom Branding] Replace EuiLoadingElastic with EuiLoadingSpinner (#149253) 2023-01-31 11:54:42 -07:00
Maja Grubic
3592cebe6e
[Custom Branding] Fetch custom branding on unauthenticated pages (#149207)
## Summary
Addresses: https://github.com/elastic/kibana/issues/148898

This PR adds custom branding to the login page. In order to do so,
`customBranding` plugin utilizes the saved object client with
`SECURITY_EXTENSION_ID` excluded. This PR also adds the appropriate
license check for fetching of custom branding.


I've also added some minor fixes to `template.tsx` and
`loading_indicator.tsx` as there were some errors in the logic and the
places that I've missed in the first iteration.

### Checklist

Delete any items that are not applicable to this PR.

- [X] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [X]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [X] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [X] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [X] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
~- [X] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)~
- [X] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [X] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-31 10:01:35 +01:00
Spencer
376bed5d16
implement "plugin" package type (#149370)
This PR updates the core discovery logic to support loading plugins from
packages. This logic is additive, so that the existing plugins in the
repo and third-party plugins can continue to be loaded via the existing
mechanism, but with https://github.com/elastic/kibana/pull/148130 we
will be automatically migrating all plugins in the repo to packages,
which will use this logic.

The logic is already in-use in that PR, and was developed there, but
extracted here for easier review.

The logic is relatively simple, where a list of packages in the repo are
attached to the core `Env` and then filtered by core before converting
all plugin packages to `PluginWrapper`. The `PluginWrapper` still
exposes the plugin manifest to the rest of the code, and it is used in
many places, so rather than making changes to the `PluginWrapper` I'm
faking a legacy plugin manifest with the plugin package manifest.

@elastic/kibana-core: I'm going to need some help identifying what we
need to get test coverage for. This is a pretty simple addition to the
core IMO, and if it didn't work then nothing would work, so I'm pretty
confident in it, but would still appreciate your feedback.
2023-01-30 10:47:53 -07:00
Juan Pablo Djeredjian
6cc9855495
[Security Solution] Write and read Rule Execution Logs from rule instead of saved object (#147035)
**Addresses:** https://github.com/elastic/kibana/issues/130966
**Based on:** https://github.com/elastic/kibana/issues/135127

## Summary

This PR deprecates the Sidecar SO of type `siem-detection-engine-rule-execution-info` in favour of storing Rule Execution Logging data within the rule itself, making use of the work previously done in the Alerting Framework:
- https://github.com/elastic/kibana/pull/140882
- https://github.com/elastic/kibana/pull/147278

Work done:
- **Pass execution statuses and metrics from rule executors to the Framework:** through the use of `RuleMonitoringService` and `RuleResultService` from within the rule execution log client for executor. `x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/client_for_executors/client.ts`
- **Fetch execution statuses and metrics from rules themselves instead of the sidecar `siem-detection-engine-rule-execution-info` saved objects**: through the use of the new function `createRuleExecutionSummary` in `x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/logic/rule_execution_log/create_rule_execution_summary.ts`, which extracts last execution information from the rule itself.
- **Remove the siem-detection-engine-rule-execution-info saved objects type from the codebase. Mark it as deleted in Kibana Core:** added `siem-detection-engine-rule-execution-info` to `packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/unused_types.ts`; and got rid of the related Saved Object client.
- **Make sure to keep backward compatibility in the Detection API endpoints and rule execution events we write into the Event Log**: API compatibility is maintained. No breaking changes.


### Checklist

- [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials
- [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
2023-01-27 16:35:47 +01:00
Christiane (Tina) Heiligers
04affacf80
[uiSettings] improves browser-side public types (#149645)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
fix https://github.com/elastic/kibana/issues/137609
2023-01-27 08:02:22 -07:00
Christiane (Tina) Heiligers
b9f31afc23
Flags core mocks packages as devOnly (#149466)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Fix https://github.com/elastic/kibana/issues/145064
2023-01-26 08:46:06 -07:00
Luke Gmys
2862d4bdb7
Replace ecs package with ecs-typescript generated code (#148804) 2023-01-26 07:10:32 +01:00
Rudolf Meijering
201fabc63f
Fix core app routes (#149462)
## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.


### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2023-01-25 12:13:34 -07:00
Jean-Louis Leysens
631675ba39
[Saved Objects] Import SO types from server rather than common to avoid deprecation (#149289)
## Summary

After merging https://github.com/elastic/kibana/pull/148979 there are a
number of imports that can be fixed immediately to address our new
deprecation notice.

## To Core reviewers

The package `core-saved-objects-server` is using types from
`core-saved-objects-api-server` which creates a circular dependency when
using `SavedObject` type from it's new home in
`core-saved-object-server`:

`core-saved-objects-server` -> `core-saved-objects-api-server` ->
`core-saved-objects-server`

One solution is that we can create a new package
`packages/core/saved-objects/core-saved-objects-server-shared` that will
only hold the `SavedObject` type and a select few others. I'm not sure
what the best approach here is. I have left
`core-saved-objects-api-server` unchanged for now (i.e., it is still
importing `SavedObject` from `common` which is deprecated).

Any input would be greatly appreciated!

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-25 05:38:05 -07:00
ofiriro3
cb599840e3
[Cloud Posture] - Deprecate csp rule remove migration object (#148530) 2023-01-24 05:50:54 -07:00
Rudolf Meijering
cfee703139
Bump elasticsearch-js to 8.6.0-canary.3 (#148521)
## Summary

Bump elasticsearch-js to 8.6.0-canary.3 to unblock
https://github.com/elastic/kibana/issues/145653

The updated version of elasticsearch-js comes with some type changes
that causes typescript type checking to fail. I've fixed the type errors
that were obvious/easy but left todo's for some types which were harder
for me to figure out. If any of these todo's are in your team's code,
please contribute directly to the branch to fix them.


### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Thom Heymann <thom.heymann@elastic.co>
Co-authored-by: weltenwort <stuermer@weltenwort.de>
2023-01-24 05:49:30 -07:00
Alejandro Fernández Haro
4c626f16c0
Unskip Execution Context FTRs (#149070)
Resolves https://github.com/elastic/kibana/issues/112102
2023-01-23 18:33:53 -07:00
Christiane (Tina) Heiligers
f7b25f5e46
[Saved Objects] Provide ability to remove SO type from global SO HTTP API without hiding from the client (#149166)
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
resolves https://github.com/elastic/kibana/issues/147150
2023-01-23 15:04:24 -07:00
Christiane (Tina) Heiligers
188009f937
[deprecations] Remove/update core-api deprecations targeted for removal by 8.8 (#147723)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2023-01-22 13:41:55 -07:00
Bree Hall
e564eb31e2
Upgrade EUI to 73.0.0 (#149079)
eui@72.2.0  eui@73.0.0

---

**Bug fixes**

- Fixed `EuiDataGrid` a11y errors within toolbar popovers containing
draggable elements with interactive children
([#6517](https://github.com/elastic/eui/pull/6517))
- Fixed several styling bugs within `EuiDataGrid`'s sorting toolbar
popover ([#6517](https://github.com/elastic/eui/pull/6517))

**Breaking changes**

- `EuiToolTip`s now internally enforce only showing **one** tooltip at a
time (the most recently triggered tooltip). This primarily affects
scenarios where users are focused on a tooltip toggle via click, and
then hover onto another tooltip toggle.
([#6520](https://github.com/elastic/eui/pull/6520))
2023-01-19 16:17:30 -05:00
Tiago Costa
e38350f7f9
chore(NA): upgrades uuid to v9.0.0 (#149135)
This PR upgrades uuid into its latest version `9.0.0`.
The previous default used version `v4` was kept where it was previously
used and places using `v1` or `v5` are still using it.

In this latest version they removed the deep import feature and as we
are not using tree shaking it increased our bundles by a significant
size. As such, I've moved this dependency into the `ui-shared-deps-npm`
bundle.

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-19 19:48:07 +00:00
Jeramy Soucy
c5faa31faf
[Saved Objects] Fixes namespace argument to encryption calls in repository update method (#149074)
Closes #149037.

## Summary

The namespace argument in Saved Object Repository Update method's call
to optionallyEncryptAttributes was being supplied by an unqualified
optional parameter. This means that when the namespace option was not
defined, the current namespace was not being passed to the encrypt
method. This PR updates the argument to the qualified namespace
determined by the optional parameter and the Spaces Extension's
getCurrentNamespace method.

Unit tests have also been updated to catch this case should it occur in
the future. The same consideration will be made for security extension
unit tests in [PR
148165](https://github.com/elastic/kibana/pull/148165).

## Testing
To test, follow the instructions given in [the
issue](https://github.com/elastic/kibana/issues/149037).
2023-01-19 12:10:31 -05:00
Jean-Louis Leysens
0b74e6cd75
[Saved Objects] Fix deprecated Browser SO types (#149195)
## Summary

* Re-exporting SO types from `common` inside server code
* Deprecated individual APIs on interfaces, not just interfaces, to make
deprecation visible to consumers
* Deprecates the `savedObjects` prop on the `CoreStart` interface too
2023-01-19 05:23:31 -07:00
spalger
e3dff93c97
[codeowners] rename global experience to @elastic/appex-sharedux 2023-01-18 10:02:49 -07:00
Jean-Louis Leysens
bbf19cab6e
[Saved Objects] Browser-side client deprecation notice (#148979)
## Summary

In the near future we will remove Saved Object (SO) HTTP APIs. This PR
deprecates all browser-side SO types and interfaces.

General comments on the approach taken here:

* Add a deprecation notice that links to a GitHub issue that can be
referenced by all teams
* Do not break existing imports/exports
* Mocks are also an indication of SO browser-side use, added deprecation
notices
* Some common types must also be deprecated, some may remain. For those
to be removed they are moved to a separate file, with a deprecated
type-alias re-exported

## Notes to reviewers

* Easiest way to get an overview of the changes is to have the file-tree
open in the "Files changed" view
* Are there any other ways browser-side code can get knowledge of Saved
Objects?
* Please go through some client code and test that the DX is working as
expected (the GitHub issue is discoverable)

## Related
* https://github.com/elastic/kibana/issues/147150
* https://github.com/elastic/dev/issues/2194

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-18 04:03:23 -07:00
Jonathan Buttner
92418a6362
[Cases] API to return a case's connectors information (#147295)
This PR implements a new internal API to return the information relating
to all the connectors used throughout a case's lifespan.

Fixes: https://github.com/elastic/kibana/issues/134346

```
GET http://localhost:5601/internal/cases/<case id>/_connectors

Response

{
    "my-jira": {
        "name": "preconfigured-jira",
        "type": ".jira",
        "fields": {
            "issueType": "10001",
            "parent": null,
            "priority": null
        },
        "id": "my-jira",
        "needsToBePushed": true,
        "hasBeenPushed": false
    }
}
```

<details><summary>cURL example</summary>

```
curl --location --request GET 'http://localhost:5601/internal/cases/ae038370-91d9-11ed-97ce-c35961718f7b/_connectors' \
--header 'kbn-xsrf: hello' \
--header 'Authorization: Basic <token>' \
--data-raw ''
```

Response
```
{
    "my-jira": {
        "name": "preconfigured-jira",
        "type": ".jira",
        "fields": {
            "issueType": "10001",
            "parent": null,
            "priority": null
        },
        "id": "my-jira",
        "needsToBePushed": true,
        "hasBeenPushed": false
    }
}
```

</details>


Notable changes:
- Refactored the user actions service to move the functions that create
user actions (builders etc) to its own class `UserActionPersister`
- Refactored the `CaseUserActionService` class to pull the saved object
client, logger, and other fields passed to each function via parameters
to be wrapped in a `context` member field within the class
- Plumbed in `savedObjectsService.createSerializer` to transform a raw
elasticsearch document into the saved object representation
- Added new internal `_connectors` route and `getConnectors` client
function
- Refactored the integration tests by extracting the connector related
utility functions into their own file

## Needs to be pushed algorithm

To determine whether a case needs to be pushed for a certain connector
we follow this algorithm:
- Get all unique connectors
  - For each connector
- Find the most recent user action contain the connector's fields, this
will be in the most recent `connector` user action or if the connector
was configured only once when the case was initially created it'll be on
the `create_case` user action
    - Grab the most recent push user action if it exists
- For each push search for the connector fields that were used in that
push
- Get the most recent user action that would cause a push to occur
(title, description, tags, or comment change)
- For each connector
  - If a push does not exist, we need to push
- If a push exists but the fields do not match the field of the most
recent connector fields, we need to push because the fields changed
- If the timestamp of the most recent user action is more recent than
that of the last push (aka the user changed something since we last
pushed) we need to push

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-01-17 15:21:36 -05:00