Commit graph

3649 commits

Author SHA1 Message Date
Poff Poffenberger
6765def84d
[Canvas] Migrate usage collector to NP plugin (#53303)
* Move canvas usage collector to NP plugin

* Removing old usage collector fom legacy Canvas plugin

* Adding types placeholder

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2019-12-30 09:16:36 -06:00
Eli Perelman
054ec7036d
Add server rendering service to enable standalone route rendering (#52161)
* Add server rendering service to enable standalone route rendering

* Update renovate config

* Move legacy rendering functionality to legacy service

* Use config for exposed variable in new platform

* Lint changes from rebase

* Rebase artifact

* Remove RenderingProvider, add tests for legacy vars implementation, review notes

* Add UI app functionality to legacy service

* Update rendering snapshots

* Update docs

* Fix up functional tests

* Clean up legacy types

* Revise types from reverting injected metadata changes

* Update translations and broken tests

* Mock legacy internals in legacy tests

* Add missing doc types

* Rename InternalRenderOptions to LegacyRenderOptions

* Remove extraneous legacy exports, review nits

* Functional tests fixes

* Rebase, attempt CI test fixes

* Only allow specified appIds in testbed rendering integration test

* Update snapshot names

* Review nits
2019-12-29 02:10:55 -06:00
Matthias Wilhelm
b921987f1a
Remove SavedObjectRegistryProvider from codebase (#53455) 2019-12-21 10:38:03 +01:00
Luke Elmers
fc8bc82fb3
Move ui/courier into data shim plugin (#52359) 2019-12-20 21:08:05 -07:00
Joe Reuter
c75cd9de19
NP Migration: Sample data (#52753) 2019-12-20 19:06:21 +01:00
Alejandro Fernández Haro
3bdbcd0d1a
[NP] Allow custom validations in HTTP Routes apart from @kbn/config-schema (#51919)
* [NP] Allow custom validations in HTTP Routes apart from @kbn/config-schema

* API docs

* Allow validate function in the route handler (run-code validation)

* Prefix RouteXXX + Params and Body Validation Aliases

* Fix test broken by lodash

* Update API docs

* Add default types for simpler manual declaration

* Add run-time validation of the RouteValidateSpec

* Expose RouteValidationError instead of SchemaTypeError

* RouteValidator as a class to match config-schema interface

* Test for not-inline handler (need to check IRouter for #47047)

* Add preValidation of the input for a safer custom validation

* Better types for RouteHandlers

* [NP] Move route validation to RouteValidator wrapper

* Use the class only internally but maintain the same API

* Fix types

* Ensure RouteValidator instance in KibanaRequest.from

* Fix validator.tests (Buffer.from instead of new Buffer)

* Default precheck should allow null values

* Also allow undefined in preChecks

* MR feedback fixes

* Provide RouteValidationResolver to the validation function

* Add functional tests

* Fix new functional tests

* Fix validator additional test

* Fix test with new resolver

* Remove unused import

* Rename ValidationResolver to ValidationResultFactory and change the interface to look more like the KibanaResponseFactory

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2019-12-20 17:53:08 +00:00
Aleh Zasypkin
e5822771e3
Use savedObjects provided by the platform instead of legacy shim. (#53679) 2019-12-20 18:42:42 +01:00
Kevin Logan
2f3ca65886
[Endpoint] Register endpoint app (#53527)
* register app, create functional test

* formatting

* update tests

* adjust test data for endpoint

* add endpoint tests for testing spaces, app enabled, disabled, etc

* linting

* add read privileges to endpoint

* rename variable since its used now

* remove deprecated context

* remove unused variable

* fix type check

* correct test suite message

Co-Authored-By: Larry Gregory <lgregorydev@gmail.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Larry Gregory <lgregorydev@gmail.com>
2019-12-20 10:31:41 -05:00
Marta Bondyra
60660fcd1e
[Discover] Refactor discover index pattern selector to Lens `C… (#51973) 2019-12-20 14:55:06 +01:00
Josh Dover
4980387c17
Refactor HttpService tests (#53033) 2019-12-19 11:38:14 -06:00
Mikhail Shustov
dd1faba7e3
provide a list of breaking changes in licensing plugin readme (#53574)
* provide a list of breaking changes in licensing plugin

* Apply suggestions from code review

Co-Authored-By: Rudolf Meijering <skaapgif@gmail.com>

* add ToC
2019-12-19 15:50:13 +01:00
Matthias Wilhelm
e9ac373bec
[Discover] Remove angular field filter template code (#53513) 2019-12-19 14:34:47 +01:00
Casper Hübertz
990ecda6b9
[APM] Improve table and other panel loading states (#53459)
Updated text loading states to animated spinners.
2019-12-19 13:51:03 +01:00
Mikhail Shustov
ba7589d603
Reduce license plugin api (#53489)
* inOneOf --> hasAtLeast. to follow to licensing hierarchical model

* adopt licensing tests

* add license mock and use it in the tests

* adopt security plugin to hasAtLeast and licensing mocks

* adopt uptime to hasAtLeast

* update readme

* add test for unknown license

* fix import in js test

* fix security plugin merge conflict

* Update x-pack/plugins/security/common/licensing/license_service.ts

Co-Authored-By: Larry Gregory <lgregorydev@gmail.com>

* Update x-pack/plugins/licensing/common/types.ts

Co-Authored-By: Josh Dover <me@joshdover.com>

* simplify tests

* remove unused import
2019-12-19 09:35:09 +01:00
Garrett Spong
26ddfb26c0
[SIEM] Adds actions and selection to Signals Table (#53101)
## Summary

This is `Part II` of `II` for adding the `Signals Table` to the main Detection Engine landing page ([meta issue](https://github.com/elastic/kibana/issues/50405)).

`Part II` includes:
* Adding `selection`, `selectAll` & `selectAllGlobal` (i.e. query select) functionality to the EventsViewer
* Includes ability to specify a fieldset when storing selection state so it can be used by custom actions
 * Introduces following new Timeline state:
    * `deletedEventIds: string[]`
    * `loadingEventIds: string[]`
    *  `selectedEventIds: Record<string, TimelineNonEcsData[]>`
    * `showCheckboxes: boolean`
    * `showRowRenderers: boolean`
* Adds Send to Timeline overflow/batch action (detailed [here](https://github.com/elastic/kibana/issues/50405#issuecomment-565470830))
* Adds Update Signal Status overflow/batch action

Resolves https://github.com/elastic/kibana/issues/51785

##### Selection / Update Signal Status
![update_signal_state](https://user-images.githubusercontent.com/2946766/70887496-61d59280-1f9b-11ea-8483-ab30e3936738.gif)

##### Send Signal to Timeline Action

### Checklist

Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR.

- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)
- [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/master/packages/kbn-i18n/README.md)
- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials
- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
- [ ] ~This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~

### For maintainers

- [ ] ~This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
- [ ] ~This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~
2019-12-18 20:45:21 -07:00
Larry Gregory
3b647b1641
Security nav control => NP (#52386)
* migrating nav control to NP

* move licensing service to common

* only retrieve user when necessary

* don't block rendering on user promise

* testing nav control registration

* moving logic to nav_control_service

* register account management in a hack

* update import location

* updating license_service to manage its own subscription to the raw license

* updating mock

* update editProfileUrl to not require full page reload if already within the kibana app

* alternate security license proposal

* adds popover test.

* switchMap -> map

* additional test case.

* Apply suggestions from code review

Co-Authored-By: Aleh Zasypkin <aleh.zasypkin@gmail.com>

* additional testing

* fix merge from master

* fixing es availability check

* fix merge from master

* switch from deprecated route


Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2019-12-18 07:17:00 -05:00
Thomas Watson
eadf8bf3d8
Update Node.js to version 10.18.0 (#52865) 2019-12-18 13:07:14 +01:00
Felix Stürmer
8863fc29a4
[Logs UI] Add setup screen for the categorization tab (#51905)
This adds the setup screen for the log entry categorization.

closes #50320 
closes #50414
2019-12-18 11:20:40 +01:00
Shahzad
862265a48e
Feature/monitor list externel linking (#53098)
* update monitor list columns

* update columns

* update snaps

* fix type

* removed unused ii8n
2019-12-18 10:20:30 +01:00
Chris Cowan
69570cde7e
[Metrics UI] Display data label on inventory based on data interval (#53054) 2019-12-17 15:48:19 -07:00
Matthew Kime
2d36b216af
move management registry to new platform (#53020)
* move management registry to new platform
2019-12-17 13:00:54 -06:00
Kerry Gallagher
18b5cf9adb
[Logs UI / Metrics UI] New Platform migration server followups (#51615) 2019-12-17 18:52:57 +00:00
Mikhail Shustov
74e1d17cf4
Support 'enterprise' license type (#52273)
* add enterprise license type to licensing plugin

* add enterprise license to x-pack plugins

* update uptime license list

* improve naming in security plugin

* update reporting licensing
2019-12-17 15:43:19 +01:00
Aleh Zasypkin
341630d5b3
Use savedObjects provided by the platform instead of legacy shim. (#53264) 2019-12-17 15:04:25 +01:00
Corey Robertson
e6a0684469
Adds maxBytes and accepts options for workpad api routes that need it (#52189) 2019-12-16 15:34:05 -05:00
Stacey Gammon
7e67d1f86c
Embeddable examples on the platform and included with --run-examples flag (#52111)
* Add a new platform embeddable example plugin

* Remove extra hello world test impl.

* cleanup

* code review updates

* Change example to highlight and have parent filter out children

* Fix deep comparison of embeddable prop

* adjust help text
2019-12-16 15:03:46 -05:00
Larry Gregory
fcdaed954e
Spaces - Client NP Migration, Phase 1 (#40856)
* shimming NP for spaces client-side plugin

* refresh active space in nav control when updated

* fix advanced settings screen

* allow npStart from unauthed routes

* use NP for deriving space management url

* remove security's usage of SpacesManager

* remove usages of ui/capabilities

* fix tests

* implement NP plugin interface

* remove hack in favor of convention in migration guide

* shim feature catalogue registration

* streamline nav control, and handle async loading more gracefully

* adding opaqueId

* fixes from merge

* fix merge from master

* fixing merge from master

* move _active_space route to NP

* moving to the NP feature catalogue registry

* moving setup to setup phase

* optimizing active space retrieval

* reverting test isolation change

* Apply suggestions from code review

Co-Authored-By: Aleh Zasypkin <aleh.zasypkin@gmail.com>

* removing unnecessary PluginInitializerContext

* updating advanced settings subtitle

* using NP anonymousPaths service

* additional nav_control_popover cleanup

* additional cleanup

* testing out onActiveSpaceChange$ property

* make the linter happy

* make the type checker happy

* fixing types

* fix merge from master

* spaces LP init should run on all pages, not just the kibana app

* address nits

* fix infra/logs, and the spaces disabled scenario

* fix typescript errors

* revert changes to infra plugin

* reintroducing activeSpace injected var for legacy plugins

* fixing react deprecation warning and unhandled promise rejection

* restore activeSpace default var

* spaces does not need to check its own enabled status

* fix from merge


Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2019-12-16 08:31:07 -05:00
Pierre Gayvallet
408139bf0b
Allow loggers to create child loggers via 'get' method (#52605)
* add 'Logger.get' method

* updates generated doc

* resolve merge conflicts
2019-12-16 10:41:14 +01:00
Eli Perelman
614bde927e
Move CSP options to new platform (#52698)
* Move CSP options to new platform

* Expose SharedGlobalConfig from root

* Derive CSP options from config

* Consolidate CSP configuration with HTTP config

* Fix outstanding config renames

* Remove legacy CSP configuration calls, migrate to platform properties

* Revise docs

* Fix test from type change

* Expose ICspConfig, consolidate and simplify CSP defaults access

* Rebase and update docs

* Remove legacy API from route definition params, review nits

* Clean up config path usages for consistency

* Regenerate docs
2019-12-13 15:57:17 -06:00
spalger
1ea9d791bc Revert "Revert "Fix wrong impor (#52994)""
This reverts commit c220d770cc.
2019-12-13 14:09:51 -07:00
spalger
c220d770cc Revert "Fix wrong impor (#52994)"
This reverts commit 6c1f248c4f.
2019-12-13 13:16:40 -07:00
Joe Portner
3e6270737a
Change session timeout values to use duration instead of number (#52520) 2019-12-13 13:58:40 -05:00
Josh Dover
ec2134d221
Add lint rule to prevent server code being imported into client (#52447) 2019-12-13 12:26:04 -06:00
Mikhail Shustov
6c1f248c4f
Fix wrong impor (#52994)
* Licensing plugin and XPackInfo uses the same license data (#52507)

* convert xpackinfo to TS

* use NP Licensing plugin in XPackInfo

* update mocks

* put license regresh hack back.

otherwise new license won't be re-fetched when signature changed. was deleted by mistake

* add functional test for legacy xpackmain

* declare setup types on client & server explicitly

* rename mock license --> licensing to match plugin name

* add tests for createLicensePoller

* fix type error

* adopt tests for xpack_info

* createXPackInfo uses new platform API

* put back error mute

* address comments

* fix renamed import

* address comment

* update tests to reduce delays

* deprecate xpack.xpack_main.xpack_api_polling_frequency_millis

* use snake_case in config

* fix wrong import
2019-12-13 18:09:36 +01:00
spalger
f67a063f1c Revert "Licensing plugin and XPackInfo uses the same license data (#52507)"
This reverts commit 2b8825603f.
2019-12-13 07:53:12 -07:00
Mikhail Shustov
2b8825603f
Licensing plugin and XPackInfo uses the same license data (#52507)
* convert xpackinfo to TS

* use NP Licensing plugin in XPackInfo

* update mocks

* put license regresh hack back.

otherwise new license won't be re-fetched when signature changed. was deleted by mistake

* add functional test for legacy xpackmain

* declare setup types on client & server explicitly

* rename mock license --> licensing to match plugin name

* add tests for createLicensePoller

* fix type error

* adopt tests for xpack_info

* createXPackInfo uses new platform API

* put back error mute

* address comments

* fix renamed import

* address comment

* update tests to reduce delays

* deprecate xpack.xpack_main.xpack_api_polling_frequency_millis

* use snake_case in config
2019-12-13 13:46:04 +01:00
Joe Reuter
c73f984e7f
Migrate graph server and licensing handling (#52279) 2019-12-13 11:33:15 +01:00
Chris Cowan
617c8d589a
[Metrics UI] Add AWS Metricsets to Inventory Models (#49983)
* Adding initial code for EC2

* Removing obsolute files; Adding EC2;

* Removing currentTimerange and replacing it with currentTime; Timerange will now be calcuated on the server

* Fixing AWS.s3 with Metrics Explorer

* Auto calculating timerange and interval based on metricset.period

* Adding S3 metricset

* Inital addition of RDS metrics

* Adding SQS and fixing a few things

* Fixing typescript error

* Adding RDS; Adjusting fields for S3; adding new formatter

* Return 60 seconds by detault

* Fixing types

* Removing i18n

* Fixing tests

* Fixing translations

* Fixes from merge

* Removing IDX from code not covered by #52354

* fixing tests

* Adding controls for crossliking; consolidating display name

* remove obsolete import

* Adding drop_last_bucket_support to TSVB models

* Changing type

* Fixing value per type

* remvoing obsolete translation

* Removing duplicate lines

* Removing icons from switcher

* Reducing boilerplate in Toolbar Items

* Changing file name
2019-12-12 13:17:30 -07:00
Melissa Alvarez
0cd5bb0ca9
[ML] DF Analytics: create classification jobs results view (#52584)
* wip: create classification results page + table and evaluate panel

* enable view link for classification jobs

* wip: fetch classification eval data

* wip: display confusion matrix in datagrid

* evaluate panel: add heatmap for cells and doc count

* Update use of loadEvalData in expanded row component

* Add metric type for evaluate endpoint and fix localization error

* handle no incorrect prediction classes case for confusion matrix. remove unused translation

* setCellProps needs to be called from a lifecycle method - wrap in useEffect

* TypeScript improvements

* fix datagrid column resize affecting results table

* allow custom prediction field for classification jobs

* ensure values are rounded correctly and add tooltip

* temp workaroun for datagrid width issues
2019-12-12 12:02:04 -07:00
Nathan Reese
eb8c0e33dd
[Maps] clean up source settings (#52644)
* [Maps] clean up source settings

* update es_search_source editor

* geo grid source

* pew pew source

* fix i18n

* doc updates for changing UI

* docs re-wording

* use correct image name

* update snapshot

* review feedback
2019-12-11 13:53:58 -07:00
Poff Poffenberger
19fec54e0b
[Canvas] Add NP routing for custom elements (#52561)
* [Canvas] Add NP routing for custom elements

* Remove unused type

* Cleanup

* Adding await to delete

* Cleanup
2019-12-11 11:59:44 -06:00
Aleh Zasypkin
2ec82d3dd9
Migrate the rest of the API endpoints to the New Platform plugin (#50695) 2019-12-11 18:35:49 +01:00
Josh Dover
a91e53f18f
Add asResponse option to HttpService methods (#52434) 2019-12-11 10:53:17 -06:00
James Gowdy
4f2a6f8362
[ML] Replacing angular routing (#51842)
* [ML] Replacing angular routing

* removing old files

* changing overview

* renaming overview route

* adding df analytics routes

* adding timeseriesexplorer route

* removing old files

* adding route for explorer

* adding access denied page

* adding module view or create redirect

* fixing job cloning

* adding breadcrumb system

* removing old breadcrumbs files

* fix include

* enabling management section

* injecting app dependencies

* fixing missed dependencies

* fixing saved searches

* fixing type errors

* removing included data start

* code clean up

* updating translations

* fixing router test failures

* fixing functional tests

* removing last use of SavedSearch

* removing comment

* fixing bug in line chart query

* improving saved search jobs

* fixing data viz functional test

* adding comment

* dealing with time range error

* removing unnecessary chrome imports

* cleaning up code

* moving resolver to own file

* changes based on review

* fixing index data viz on basic license

* fixing edit calendar

* adding create job breadcrumb

* fixing results appstate

* fixing management links

* updating new job constants file

* fixing rebase conflicts

* removing commented out code

* adding additional text to the resolver error
2019-12-11 15:58:11 +00:00
Pete Harverson
c962009df6
[ML] Adds Enterprise license to Start trial text on data viz page (#52749) 2019-12-11 15:54:05 +00:00
Aleh Zasypkin
7e27f0d35f
Decouple Authorization subsystem from Legacy API. (#52638) 2019-12-11 08:55:46 +01:00
Maja Grubic
717e40c444
Move DashboardEmptyScreen inside DashboardViewport (#51939)
* Prototyping adding Visualization to Dashboard

* i18n fixes

* Remvoing dashboard empty screen directive

* Updating test for empty dashboard screen

* Removing unused state variable

* Adding a test for DashboardViewPort

* i18n & minor fixes

* Fixing fullscreen mode view

* Fixing failing functional test (hopefully)

* Minor style fix

* Fixing EUI text, rendering empty screen OR the panels

* Fixing empty screen in fullscreen mode

* Update snapshot

* Trying to render empty screen from Angular controller

* refactor: 💡 don't pass renderEmpty through inputs

And make sure isEmptyState is not stale.

* Fixing tests after Vadim's commit

* Removing unnecessary isEmptyStateProps

* Skipping failing test

* Removing unnecessary en.json file

* Re-adding emptyState, reintroducing functional test

* Fixing ja-JP file

* Undoing my thing to the functional test
2019-12-10 15:05:05 +00:00
Frank Hassanabad
5fb59f36a0
[SIEM][Detection Engine] Fixes a bug with signalsIndex key for configuration
## Summary

* Simple small bug fix so that the `signalsIndex` works again.

Without this any developer starting up Kibana with their `xpack.siem.signalsIndex` set will get a quick crash.

Test:
Add this key to your `kibana.dev.yml`
```sh
xpack.siem.signalsIndex: .siem-signals-your-name
```

Ensure it starts up without crashing. Take the key out, ensure it starts up without crashing.

In the folder:
```sh
detection_engine/scripts
```

You can run this and get back the index you expect which is whatever you set the key to and the space you're in:

```sh
./get_signal_index.sh 
{
  "name": ".siem-signals-your-name-default"
}
```

### Checklist

Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR.

~~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~~

~~- [ ] 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/master/packages/kbn-i18n/README.md)~~

~~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~~

~~- [ ] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios~~

~~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~~

### For maintainers

~~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~

- [x] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
2019-12-09 20:50:25 -07:00
Pierre Gayvallet
c692689f21
fix import (#52555) 2019-12-09 22:18:57 +01:00
Ryland Herrick
45df5fdf42
[SIEM] Migrate backend to use New Platform services (#51144)
* Mark incoming plugin members as readonly

These cannot and should not be modifiable.

* Use env var instead of EnvironmentMode

* There doesn't appear to be an EnvMode in the new platform
* We're only using envMode to check whether we're in production
* We're already using process.env.NODE_ENV elsewhere

We can revisit this, but for now I'm simplifying things under this
assumption.

* Pass our setup context to the compose function

We're going to retrieve our router instance from this, for now.

* Remove unused static files route

I spent a few minutes trying to do this in the new platform, only to
realize that this was cargo culted from another plugin's structure and
never used.

* WIP: convert main GraphQL endpoints to New Platform

Splits the existing dual-method route into separate GET/POST
routes, while converting it to the NP routing syntax

TODO:
* Full route schema declarations
* Address context being moved off of the response object and into its
own object; callWithRequest is currently broken for this reason.

* Remove unnecesary Request type

While the defaultIndex patterns can be retrieved on the request itself,
that requires this special case of our FrameworkRequest.

In my smoke testing, the incoming `indices` argument was never different from
the one present on the request payload. Xavier had mentioned that these
might be redundant and a relic of some quick prototyping, so I'm going
to simplify this logic and delete that type under this assumption.

* Retrieve Elasticsearch client from RequestHandlerContext

In order to minimize the amount of noise on this refactor, I'm adding
the RequestHandlerContext to the existing FrameworkRequest object that
we already pass around.

This also removes some adapter methods that were cribbed from infra but
have since become unused. There are likely more.

* Use uiSettings client from RequestHandlerContext

Pulls from the new platform instead of from request.server.

* Remove unused properties from RequestFacade

One of these was obviated by the refactor to NP routing; the other may
never have been necessary.

* Remove unused interface

This is a relic that is no longer used in the codebase.

* Make error response code dynamic

* Handle GraphQL errors

Refactors to use new platform's responses instead of Boom.

Unless we intentionally do not want isGraphQLError error headers, I saw no
reason for the latter two branches of this method (and merged them).

* Fix graphiQL route

We needed to loosen the restriction on our main POST graphQL route, as
the requests coming from graphiQL do not match our normal format.

* Clean up logging

* Remove unused var injection functionality

I could not find a case where we were using these vars within the siem
app.

* Fix typo on config fetching

* Migrate to NP IndexPatterns service

* Removes unused extra parameter on callWithRequest
  * I think this was a relic from the infra code
* Clean up typings of callWithRequest
  * GenericParams is, ironically, not generic enough to handle all ES
  client calls. Instead we type it as Record<string, any> but ensure
  that our function adheres to the APICaller interface.

* Use savedObjects client in request context

These resolvers already receive a request containing the NP context, so
we can retrieve our client directly from that, now.

* Rename dependencies -> plugins to match kibana.json

* Remove unnecessary type annotation

The type of callCluster is already checked due to being passed to the
IndexPatternsFetcher constructor.

* Add siem plugin to new platform

For now this just generates a config observable with some defaults;
everything still lives in the legacy plugin.

* WIP: flattening out plugin initialization

Rather than pass our legacy API around everywhere, let's be explicit
about who needs what, and start flattening things out so that we can
move the legacy-independent stuff over.

* Pass our plugin context to initServerWithKibana

We can get the NP equivalent of `pkg.version` from
context.env.packageInfo.version, so let's do that and remove a usage of
config().

* Simplify siem configuration

As far as I can tell, the only siem config that we're using is
`xpack.siem.enabled`. The `query` was a holdover from infra, and if
we're using the `sources` queries at all, it's only with the default
values. Since our config is not typed, trying to add `sources` config
only results in runtime errors.

This removes the KibanaConfigurationAdapter entirely, and instead passes
what is effectively { sources: {} } to the SourcesConfigurationAdapter.

* Run all legacy-free setup through our plugin

Once this is vetted, we should be able to move the entire tree under the
plugin into the new platform plugin. We can inline the compose and
init_server calls into the plugin once things are vetted and stable; for
now leaving them there cuts down on the diff.

* Temporarily ignore our unused config declaration

* Fix detection engine route tests

While we're passing a properly bound route function in the app, the
tests' interfaces needed to be updated. Adds a helper method for
retrieving a bound route function from a Server object.

* Add some rudimentary schema validation to our graphQL endpoints

* Remove defunct server.config fn

The last remaining usage of this config was removed in #51985.

* Group our dev endpoints together

The graphiQL endpoint is the only thing that currently uses the GET
endpoint; everything else that talks to graphQL uses POST. For that
reason, I'm putting them in the same scope (along with annotating here)
to make that a bit clearer.

* Determine environment from plugin context

The kibana platform did and does provide this interface to check with
environment we're running in.

* Migrate xpack_main to NP features service

* Fix some issues missed in the previous merge

DE added some dependencies on both the server and request objects. Most
have NP equivalents and can be converted, but for now let's just add
them back to the Facades and convert in another PR.

Also changes one function to pull plugins from the server object, rather
than the server object living on the request (as this is how similar
functions are structured right now).

* Fix type resulting from bad merge resolution

* Fix type error due to incorrect usage of Hapi.Request

Pull elasticsearch service off our legacy server object, rather than
indirectly off the request object. Still legacy, but it's one less step
for later.
2019-12-09 15:17:29 -06:00