* 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.
* Fix filter matches index for filters with partial meta
* Abort discarded KQL value suggestion requests
* Abort server-side connection to ES
* Fix failing test
* Add automatic support for nested fields in existing filter types
* Index pattern could be undefined
* add test for handleNestedFilter function
* remove console.log
* add tests for all "getFilterField" functions
* update migrateFilters to work on full filter objects so that it doesn't
have to worry about queries that have been wrapped with `nested`
* add test to ensure fromFilters auto wraps filters on nested fields
* Add smoke test for nested filter and move filter editor tests into
their own suite for easier running and debugging
* fix bad type change
* dedupe filterToQuery logic
* fix helper that wasn't doing what it said it did
* Convert test from pre-merge to jest
* Use new time range style
* Add simple visual test for fullscreen workpads in Canvas
* Adding canvas to the config
* Adding sample data visual tests
* Refactor to use new helper method
* Reverting sample data visual test for now
* Forgot to add the awaits
Created management plugin under core_plugins.
Filled the plugin with 2 services: IndexPatternManagementService and SavedObjectsManagementService.
Removed related codes in ui/management and changed the paths.
* License Management public -> NP
* - Server to NP
- Slight update to filepicker style (center it)
* Fix snapshots and types
* Server-side: separate new and legacy dependencies [skip ci]
* Fix license upload route after refactor
* Client side: separate new from legacy dependencies
* xpackInfo -> xPackInfo
* Fix types [skip ci]
* Remove kbnUrl, autoLogout. Add history and update paths.
* Update upload license test
* Remove use of legacy chrome, remove use of k7breadcrumbs, replace some common strings with variable and use NP i18n
Moves calling the table factory out of components to avoid instantiation on every render call. Note all of this is a workaround for our own typescript version of EuiInMemoryTable. Once the original table has been migrated to TS, we should be able to remove the custom code.
* IndexPatternsContract
* types
* Expose FieldList on indexPattern contract (as its stateful)
Rename FieldListInterface to IFieldList
Remove more exports from ui/index_patterns
Fix Maps import
Move data services initialization to top level of the plugin
* Clean up mocks
* ts
* setFieldFormats from Legacy plugin
* Remove FIeldList export
* Fix checking of error type in management
* Fix security import of indexpatterns
* fix jest tests
* Fix jest tests
* Update snapshots
* Fix mocha tests
* add onPreResponse interceptor
* use onPreResponse interceptor to add license sign
* expose registerPreResponse to plugins
* refresh for license update get the most fresh license
* license plugin injects own header for signature: 'kbn-license-sig'
* add integration tests for license type and license header
* switch config to duration
* don't run interceptor on anon paths. add tests
* add functional tests for licensing plugin
* regen docs
* fix test in security due to updated mocks;
* update snapshots accoring to new mock implementation
* migrate license expired banner to NP
* add readme for the licensing plugin
* remove outdated import. licensing has separate functional tests
* add tag for test to run on CI
* regen docs
* Update x-pack/plugins/licensing/README.md
Co-Authored-By: Josh Dover <me@joshdover.com>
* update tests
* adds route to update status on a signal / query result of signals. This also adds some example curl commands in scripts/signals and updates the README with general instructions on how to use the scripts to interact with the new endpoint.
* utilizes 'mget' to allow multiple id's to be passed in. Updates relevant example curl script.
* utilizes updateByQuery instead of querying then updating individual results
* adds tests for set signals status route. Adds tests for set signals route schema. Updates schema to make status a required field.
* fixes type check failures, fixes missing import due to renaming, fixes naming of mocked elasticsearch plugin after rebasing
* removes anys from mocked es plugin, updates example comments in signals scripts
* removes undefined | null from signal status definition, updates put_signal_doc with the get_signals_index script, adds getIndex to open_close_signals_route, updates tests to mock getIndex fn, updates README with instructions to run signals scripts from inside scripts directory.
* removes null/undefined check for callWithRequest
* sets signal status query to object
* Add functional tests for plugins to x-pack (so we can do a functional test of the Resolver embeddable)
* Add Endpoint plugin
* Add Resolver embeddable
* Test that Resolver embeddable can be rendered
* Basic cleanup before refactoring for shim work
* shim WIP
* Removes the configuration adapter
* WIP more stuff
* WIP refactoring of shimming work
* WIP continues
* Logging UI now runs on top of new platform shim
* WIP continues
* Removes unused imports and variables
* Basic infra NP server shim in place
* Reimplemented graphql http error handling for infra NP server shim
* Adds new platform infra plugin to handle NP config for legacy server shim
* Basic cleanup before refactoring for shim work
* shim WIP
* Removes the configuration adapter
* WIP more stuff
* WIP refactoring of shimming work
* WIP continues
* Logging UI now runs on top of new platform shim
* WIP continues
* Removes unused imports and variables
* Basic infra NP server shim in place
* Reimplemented graphql http error handling for infra NP server shim
* Adds new platform infra plugin to handle NP config for legacy server shim
* Adds comment about duplicating full config for NP config
* Use New Platform features plugin to registerFeature()
* Re-arranging and relying on request context as uch as possible
* Refactors KibanaRequest for RequestHandlerContext
* fixes types for callWithRequest
* Moves callWithRequest method override types directly into class to get them working, need to fix this when we understand it better
* Fixes callWithRequest framework types
* Removes a few NP_TODO comments
* Fix broken imports
* Ensure GraphQL resolvers are actually passed requestContext and not the raw request, and switch to the savedObjects client via requestContext
* Remove the legacy traces of the savedObjects plugin
* Fixes TSVB access with NP raw requests and requestContext
* Remove unused getUiSettingsService (moved to requestContext)
* Migrate to new Spaces plugin
* Fix calculateMetricInterval after merged changes
* Reinstate and migrate the infrastructure metadata route
* Fix various type check errors
* Amend InfraSources lib unit tests
Mock the savedObjects client differently
* Amend MetricsExplorer API response
Renaming of variable inadvertently broke the response
* Remove GraphQLI references from feature controls tests
* Remove other GraphiQL references
* Fix security / access issue
* Add a framework level registerRoute method which always adds access tags by default
* *Temp* disable test
* Migrate the log rate validation endpoint to the new platform
Fully migrates the [Logs UI] log rate setup index validation #50008 PR to New Platform routing etc
* Amend types
* Example of how to expose APM get indices method in NP
* Fix calls to TSVB bug caused by object mutation
This is a temp fix as the TSVB NP migration will supercede this
* Converts getApmIndices function to accept saved object client, implements usage in infra
* Fix APM setup_request tests
* Fixes some unused references for linting
* Migrate all work from #50730 to NP
* Remove duplicate declaration files for rison_node and add a single source of truth at x-pack/typings/rison_node.d.ts for x-pack uses
* Moved type file back into infra plugin to bypass strange break
* Updates apm indices method signature per feedback from @elastic/apm-ui
* [Maps] use style metadata to calculate symbolization bands
* only update style meta when fields change
* load join source style meta
* use style meta data request to populate range
* apply source filter to style meta request
* fix heatmap
* only use style meta range if field supports field meta
* add fieldMetaOptions to style prperty descriptor and add migration script
* add UI for setting fieldMetaOptions.isEnabled
* clean up
* review feedback
* fix can_skip_fetch tests
* review feedback
* only show field meta popover for fields that support field meta
* avoid duplicate fields re-fetching style meta
* clean up problems when first creating grid source
* update text for enabling field meta toggle
* provide UI for setting sigma
* allow users to include global time in style meta request
* update SIEM saved objects
* add less than and greater than symbols when styling by field stats
* fix functional tests
* review feedback
* add support for date fields
* review feedback
* only show less then and greater then in legend when values will be outside of std range
* unnest VectorStyle._getFieldRange
* remove unused function
* only show style isTimeAware switch when style fields use field meta
## [SIEM] Remove placeholder from pinned event tooltips
Similar to signals, pinned timeline events should be copied from source indexes, which are subject to ILM, to separate (space-aware) indexes (with different ILM), such that pinned events can be viewed in a timeline after the events have aged out of the original indexes.
The backend APIs and UI patterns in development now for signals can likely be reused to implement the above, but until then, the placeholder tooltip text for unpinned / pinned events, which mentions persistence, should be removed from the SIEM beta.
- [x] Changed the _unpinned_ event tooltip text from (sic) `This is event is NOT persisted with the timeline` to `Unpinned event`
- [x] Changed the pinned event tooltip text from `This event is persisted with the timeline` to `Pinned event`
https://github.com/elastic/siem-team/issues/482
Part of #44151,
Continuation of #51835,
Just moves existing state related url utils to kibana_utils plugin
Also fixes small regression introduced in #51835,
When sharing hashed url directly it should show error toast instead of full page fatal error