* [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>
* 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>
* provide a list of breaking changes in licensing plugin
* Apply suggestions from code review
Co-Authored-By: Rudolf Meijering <skaapgif@gmail.com>
* add ToC
* 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
* 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>
* 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
* 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>
* 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
* 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
* 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
* 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
* 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
* 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.