Commit graph

82 commits

Author SHA1 Message Date
Tim Sullivan e48a5672c0
[Reporting/JobListing] fix user ID for non-security in queries (#75365)
* [Reporting/JobListing] fix user ID for non-security in queries

* fix tests

* add fn api test

* fix ci

* revert TS exploration
2020-08-19 13:52:43 -07:00
Steph Milovic 9111d50965
fix tests and enable in CI (#75313) 2020-08-19 13:15:55 -06:00
Frank Hassanabad 02fcbaa794
Fixed bug where list index privileges was returned twice instead of list item index (#75256)
## Summary

Fixes a bug where the list privileges was returning the `.list` privileges twice instead of returning it once and returning the `.items` privileges second with the call. No UI has to change as the way it was written was dynamic to grab the first key found.

This also adds the functional tests to `x-pack/scripts/functional_tests.js` which was not there originally so the end to tend tests should actually run on the CI machine where it was not running on CI before.

Adds the functional tests to the code owners file as well.

Ensure that you go to the test results page from the Jenkins build:
<img width="901" alt="Screen Shot 2020-08-18 at 1 13 18 AM" src="https://user-images.githubusercontent.com/1151048/90482180-13f7c800-e0f0-11ea-92f2-b30a8fffe84e.png">

And ensure you see the tests under:

```
X-Pack Lists Integration Tests
```

Then click through it and ensure they are shown as running and passing

### Checklist

- [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
2020-08-19 12:30:11 -06:00
Aleh Zasypkin e46e66210f
Implement Server-Side sessions (#68117) 2020-08-18 08:38:23 +02:00
Jonathan Buttner 867a672c7a
[Security Solution] Use docker for endpoint tests (#73092)
* Copying api integration tests into their own directory

* Removing api integration tests and using ingest docker image

* Fixing typo

* Fixing type errors and empty string and reenabling tests

* Rebuilding docs

* Renaming url override variable

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-27 14:13:50 -04:00
Dmitry Lemeshko 25856ed985
[code coverage] add iframe embedded and enterprise search tests (#73267) 2020-07-27 18:12:32 +02:00
Constance f7b5144e1d
New Enterprise Search Kibana plugin (#66922)
* Initial App Search in Kibana plugin work

- Initializes a new platform plugin that ships out of the box w/ x-pack
- Contains a very basic front-end that shows AS engines, error states, or a Setup Guide
- Contains a very basic server that remotely calls the AS internal engines API and returns results

* Update URL casing to match Kibana best practices

- URL casing appears to be snake_casing, but kibana.json casing appears to be camelCase

* Register App Search plugin in Home Feature Catalogue

* Add custom App Search in Kibana logo

- I haven't had much success in surfacing a SVG file via a server-side endpoint/URL, but then I realized EuiIcon supports passing in a ReactElement directly. Woo!

* Fix appSearch.host config setting to be optional

- instead of crashing folks on load

* Rename plugin to Enterprise Search

- per product decision, URL should be enterprise_search/app_search and Workplace Search should also eventually live here
- reorganize folder structure in anticipation for another workplace_search plugin/codebase living alongside app_search
- rename app.tsx/main.tsx to a standard top-level index.tsx (which will contain top-level routes/state)
- rename AS->ES files/vars where applicable
- TODO: React Router

* Set up React Router URL structure

* Convert showSetupGuide action/flag to a React Router link

- remove showSetupGuide flag
- add a new shared helper component for combining EuiButton/EuiLink with React Router behavior (https://github.com/elastic/eui/blob/master/wiki/react-router.md#react-router-51)

* Implement Kibana Chrome breadcrumbs

- create shared helper (WS will presumably also want this) for generating EUI breadcrumb objects with React Router links+click behavior
- create React component that calls chrome.setBreadcrumbs on page mount
- clean up type definitions - move app-wide props to IAppSearchProps and update most pages/views to simply import it instead of calling their own definitions

* Added server unit tests (#2)

* Added unit test for server

* PR Feedback

* Refactor top-level Kibana props to a global context state

- rather them passing them around verbosely as props, the components that need them should be able to call the useContext hook

+ Remove IAppSearchProps in favor of IKibanaContext

+ Also rename `appSearchUrl` to `enterpriseSearchUrl`, since this context will contained shared/Kibana-wide values/actions useful to both AS and WS

* Added unit tests for public (#4)

* application.test.ts

* Added Unit Test for EngineOverviewHeader

* Added Unit Test for generate_breadcrumbs

* Added Unit Test for set_breadcrumb.tsx

* Added a unit test for link_events

- Also changed link_events.tsx to link_events.ts since it's just TS, no
React
- Modified letBrowserHandleEvent so it will still return a false
boolean when target is blank

* Betterize these tests

Co-Authored-By: Constance <constancecchen@users.noreply.github.com>

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

* Add UI telemetry tracking to AS in Kibana (#5)

* Set up Telemetry usageCollection, savedObjects, route, & shared helper

- The Kibana UsageCollection plugin handles collecting our telemetry UI data (views, clicks, errors, etc.) and pushing it to elastic's telemetry servers
- That data is stored in incremented in Kibana's savedObjects lib/plugin (as well as mapped)
- When an end-user hits a certain view or action, the shared helper will ping the app search telemetry route which increments the savedObject store

* Update client-side views/links to new shared telemetry helper

* Write tests for new telemetry files

* Implement remaining unit tests (#7)

* Write tests for React Router+EUI helper components

* Update generate_breadcrumbs test

- add test suite for generateBreadcrumb() itself (in order to cover a missing branch)
- minor lint fixes
- remove unnecessary import from set_breadcrumbs test

* Write test for get_username util

+ update test to return a more consistent falsey value (null)

* Add test for SetupGuide

* [Refactor] Pull out various Kibana context mocks into separate files

- I'm creating a reusable useContext mock for shallow()ed enzyme components
+ add more documentation comments + examples

* Write tests for empty state components

+ test new usecontext shallow mock

* Empty state components: Add extra getUserName branch test

* Write test for app search index/routes

* Write tests for engine overview table

+ fix bonus bug

* Write Engine Overview tests

+ Update EngineOverview logic to account for issues found during tests :)
  - Move http to async/await syntax instead of promise syntax (works better with existing HttpServiceMock jest.fn()s)
  - hasValidData wasn't strict enough in type checking/object nest checking and was causing the app itself to crash (no bueno)

* Refactor EngineOverviewHeader test to use shallow + to full coverage

- missed adding this test during telemetry work
- switching to shallow and beforeAll reduces the test time from 5s to 4s!

* [Refactor] Pull out React Router history mocks into a test util helper

+ minor refactors/updates

* Add small tests to increase branch coverage

- mostly testing fallbacks or removing fallbacks in favor of strict type interface
- these are slightly obsessive so I'd also be fine ditching them if they aren't terribly valuable

* Address larger tech debt/TODOs (#8)

* Fix optional chaining TODO

- turns out my local Prettier wasn't up to date, completely my bad

* Fix constants TODO

- adds a common folder/architecture for others to use in the future

* Remove TODO for eslint-disable-line and specify lint rule being skipped

- hopefully that's OK for review, I can't think of any other way to sanely do this without re-architecting the entire file or DDoSing our API

* Add server-side logging to route dependencies

+ add basic example of error catching/logging to Telemetry route
+ [extra] refactor mockResponseFactory name to something slightly easier to read

* Move more Engines Overview API logic/logging to server-side

- handle data validation in the server-side
- wrap server-side API in a try/catch to account for fetch issues
- more correctly return 2xx/4xx statuses and more correctly deal with those responses in the front-end
- Add server info/error/debug logs (addresses TODO)
- Update tests + minor refactors/cleanup
    - remove expectResponseToBe200With helper (since we're now returning multiple response types) and instead make mockResponse var name more readable
    - one-line header auth
    - update tests with example error logs
    - update schema validation for `type` to be an enum of `indexed`/`meta` (more accurately reflecting API)

* Per telemetry team feedback, rename usageCollection telemetry mapping name to simpler 'app_search'

- since their mapping already nests under 'kibana.plugins'
- note: I left the savedObjects name with the '_telemetry' suffix, as there very well may be a use case for top-level generic 'app_search' saved objects

* Update Setup Guide installation instructions (#9)

Co-authored-by: Chris Cressman <chris@chriscressman.com>

* [Refactor] DRY out route test helper

* [Refactor] Rename public/test_utils to public/__mocks__

- to better follow/use jest setups and for .mock.ts suffixes

* Add platinum licensing check to Meta Engines table/call (#11)

* Licensing plugin setup

* Add LicensingContext setup

* Update EngineOverview to not hit meta engines API on platinum license

* Add Jest test helpers for future shallow/context use

* Update plugin to use new Kibana nav + URL update (#12)

* Update new nav categories to add Enterprise Search + update plugin to use new category

- per @johnbarrierwilson and Matt Riley, Enterprise Search should be under Kibana and above Observability
- Run `node scripts/check_published_api_changes.js --accept` since this new category affects public API

* [URL UPDATE] Change '/app/enterprise_search/app_search' to '/app/app_search'

- This needs to be done because App Search and Workplace search *have* to be registered as separate plugins to have 2 distinct nav links
- Currently Kibana doesn't support nested app names (see: https://github.com/elastic/kibana/issues/59190) but potentially will in the future

- To support this change, we need to update applications/index.tsx to NOT handle '/app/enterprise_search' level routing, but instead accept an async imported app component (e.g. AppSearch, WorkplaceSearch).
- AppSearch should now treat its router as root '/' instead of '/app_search'

- (Addl) Per Josh Dover's recommendation, switch to `<Router history={params.history}>` from `<BrowserRouter basename={params.appBasePath}>` since they're deprecating appBasePath

* Update breadcrumbs helper to account for new URLs

- Remove path for Enterprise Search breadcrumb, since '/app/enterprise_search' will not link anywhere meaningful for the foreseeable future, so the Enterprise Search root should not go anywhere
- Update App Search helper to go to root path, per new React Router setup

Test changes:
- Mock custom basepath for App Search tests
- Swap enterpriseSearchBreadcrumbs and appSearchBreadcrumbs test order (since the latter overrides the default mock)

* Add create_first_engine_button telemetry tracking to EmptyState

* Switch plugin URLs back to /app/enterprise_search/app_search

Now that https://github.com/elastic/kibana/pull/66455 has been merged in 🎉

* Add i18n formatted messages / translations (#13)

* Add i18n provider and formatted/i18n translated messages

* Update tests to account for new I18nProvider context + FormattedMessage components

- Add new mountWithContext helper that provides all contexts+providers used in top-level app
- Add new shallowWithIntl helper for shallow() components that dive into FormattedMessage

* Format i18n dates and numbers

+ update some mock tests to not throw react-intl invalid date messages

* Update EngineOverviewHeader to disable button on prop

* Address review feedback (#14)

* Fix Prettier linting issues

* Escape App Search API endpoint URLs

- per PR feedback
- querystring should automatically encodeURIComponent / escape query param strings

* Update server plugin.ts to use getStartServices() rather than storing local references from start()

- Per feedback: https://github.com/elastic/kibana/blob/master/src/core/CONVENTIONS.md#applications

- Note: savedObjects.registerType needs to be outside of getStartServices, or an error is thrown

- Side update to registerTelemetryUsageCollector to simplify args

- Update/fix tests to account for changes

* E2E testing (#6)

* Wired up basics for E2E testing

* Added version with App Search

* Updated naming

* Switched configuration around

* Added concept of 'fixtures'

* Figured out how to log in as the enterprise_search user

* Refactored to use an App Search service

* Added some real tests

* Added a README

* Cleanup

* More cleanup

* Error handling + README updatre

* Removed unnecessary files

* Apply suggestions from code review

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

* Update x-pack/plugins/enterprise_search/public/applications/app_search/components/engine_overview/engine_table.tsx

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

* PR feedback - updated README

* Additional lint fixes

Co-authored-by: Constance <constancecchen@users.noreply.github.com>

* Add README and CODEOWNERS (#15)

* Add plugin README and CODEOWNERS

* Fix Typescript errors (#16)

* Fix public mocks

* Fix empty states types

* Fix engine table component errors

* Fix engine overview component errors

* Fix setup guide component errors

- SetBreadcrumbs will be fixed in a separate commit

* Fix App Search index errors

* Fix engine overview header component errors

* Fix applications context index errors

* Fix kibana breadcrumb helper errors

* Fix license helper errors

*  Refactor React Router EUI link/button helpers
- in order to fix typescript errors

- this changes the component logic significantly to a react render prop, so that the Link and Button components can have different types - however, end behavior should still remain the same

* Fix telemetry helper errors

* Minor unused var cleanup in plugin files

* Fix telemetry collector/savedobjects errors

* Fix MockRouter type errors and add IRouteDependencies export

- routes will use IRouteDependencies in the next few commits

* Fix engines route errors

* Fix telemetry route errors

* Remove any type from source code

- thanks to Scotty for the inspiration

* Add eslint rules for Enterprise Search plugin

- Add checks for type any, but only on non-test files
- Disable react-hooks/exhaustive-deps, since we're already disabling it in a few files and other plugins also have it turned off

* Cover uncovered lines in engines_table and telemetry tests

* Fixed TS warnings in E2E tests (#17)

* Feedback: Convert static CSS values to EUI variables where possible

* Feedback: Flatten nested CSS where possible

- Prefer setting CSS class overrides on individual EUI components, not on a top-level page

+ Change CSS class casing from kebab-case to camelCase to better match EUI/Kibana

+ Remove unnecessary .euiPageContentHeader margin-bottom override by changing the panelPaddingSize of euiPageContent

+ Decrease engine overview table padding on mobile

* Refactor out components shared with Workplace Search (#18)

* Move getUserName helper to shared

- in preparation for Workplace Search plugin also using this helper

* Move Setup Guide layout to a shared component

* Setup Guide: add extra props for standard/native auth links

Note: It's possible this commit may be unnecessary if we can publish shared Enterprise Search security mode docs

* Update copy per feedback from copy team

* Address various telemetry issues

- saved objects: removing indexing per #43673
- add schema and generate json per #64942
- move definitions over to collectors since saved objects is mostly empty at this point, and schema throws an error when it imports an obj instead of being defined inline
- istanbul ignore saved_objects file since it doesn't have anything meaningful to test but was affecting code coverage

* Disable plugin access if a normal user does not have access to App Search (#19)

* Set up new server security dependency and configs

* Set up access capabilities

* Set up checkAccess helper/caller

* Remove NoUserState component from the public UI

- Since this is now being handled by checkAccess / normal users should never see the plugin at all if they don't have an account/access, the component is no longer needed

* Update server routes to account for new changes

- Remove login redirect catch from routes, since the access helper should now handle that for most users by disabling the plugin (superusers will see a generic cannot connect/error screen)
- Refactor out new config values to a shared mock

* Refactor Enterprise Search http call to hit/return new internal API endpoint

+ pull out the http call to a separate library for upcoming public URL work (so that other files can call it directly as well)

* [Discussion] Increase timeout but add another warning timeout for slow servers

- per recommendation/convo with Brandon

* Register feature control

* Remove no_as_account from UI telemetry

- since we're no longer tracking that in the UI

* Address PR feedback - isSuperUser check

* Public URL support for Elastic Cloud (#21)

* Add server-side public URL route

- Per feedback from Kibana platform team, it's not possible to pass info from server/ to public/ without a HTTP call :[

* Update MockRouter for routes without any payload/params

* Add client-side helper for calling the new public URL API

+ API seems to return a URL a trailing slash, which we need to omit

* Update public/plugin.ts to check and set a public URL

- relies on this.hasCheckedPublicUrl to only make the call once per page load instead of on every page nav

* Fix failing feature control tests

- Split up scenario cases as needed
- Add plugin as an exception alongside ML & Monitoring

* Address PR feedback

- version: kibana
- copy edits
- Sass vars
- code cleanup

* Casing feedback: change all plugin registration IDs from snake_case to camelCase

- note: current remainng snake_case exceptions are telemetry keys
- file names and api endpoints are snake_case per conventions

* Misc security feedback

- remove set
- remove unnecessary capabilities registration
- telemetry namespace agnostic

* Security feedback: add warn logging to telemetry collector

see https://github.com/elastic/kibana/pull/66922#discussion_r451215760
- add if statement
- pass log dependency around (this is kinda medium, should maybe refactor)
- update tests
- move test file comment to the right file (was meant for telemetry route file)

* Address feedback from Pierre

- Remove unnecessary ServerConfigType
- Remove unnecessary uiCapabilities
- Move registerTelemetryRoute / SavedObjectsServiceStart workaround
- Remove unnecessary license optional chaining

* PR feedback

Address type/typos

* Fix telemetry API call returning 415 on Chrome

- I can't even?? I swear charset=utf-8 fixed the same error a few weeks ago

* Fix failing tests

* Update Enterprise Search functional tests (without host) to run on CI

- Fix incorrect navigateToApp slug (hadn't realized this was a URL, not an ID)
- Update without_host_configured tests to run without API key
- Update README

* Address PR feedback from Pierre

- remove unnecessary authz?
- remove unnecessary content-type json headers
- add loggingSystemMock.collect(mockLogger).error assertion
- reconstrcut new MockRouter on beforeEach for better sandboxing
- fix incorrect describe()s -should be it()
- pull out reusable mockDependencies helper (renamed/extended from mockConfig) for tests that don't particularly use config/log but still want to pass type definitions
- Fix comment copy

Co-authored-by: Jason Stoltzfus <jastoltz24@gmail.com>
Co-authored-by: Chris Cressman <chris@chriscressman.com>
Co-authored-by: scottybollinger <scotty.bollinger@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-07-09 13:10:31 -07:00
Sonja Krause-Harder e91594aeb9
[Ingest Manager] Use DockerServers service in integration tests. (#69822)
* Partially disable test files.

* Use DockerServers in EPM tests.

* Only run tests when DockerServers have been set up

* Reenable ingest manager API integration tests

* Pass new test_packages to registry container

* Enable DockerServers tests in CI.

* Correctly serve filetest package for file tests.

* Add helper to skip test and log warning.

* Reenable further file tests.

* Add developer documentation about Docker in Kibana CI.

* Document use of yarn test:ftr

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-29 15:24:11 +02:00
Mikhail Shustov c8c20e4ca8
Add functional test for Kibana embedded in iframe (#68544)
* convert kbn test config into TS

* add test  for Kibana embedded in iframe

* run embedded tests in functional suite

* ignore tls errors in functional tests by default

* switch test to https

* remove env vars mutation

* allow to pass ssl config to Kibana

* pass ssl config to axios

* adopt KbnClient interfaces

* adopt KibanaServer

* use KbnRequester in security service

* set sameSiteCookies:None in test

* acceptInsecureCerts in chrome

* remove leftovers

* fix type error

* remove unnecessary field

* address comments

* refactor plugin

* refactor test

* make acceptInsecureCerts configurable

* run firefox tests on ci

* up TS version

* fix firefox.sh script

* fix path

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-06-18 12:02:56 +02:00
Paul Tavares 577381d821
[Endpoint] Functional Tests cleanup (#68756)
* Removed several unnecessary disabled eslint rules
* moved common pageobject from endpoint_list to page_utils
* Rename functional_endpoint to security_solution_endpoint
* Delete `functional_endpoint_ingest_failure` no longer applicable
2020-06-10 17:10:34 -04:00
Paul Tavares 14410e0c79
[Endpoint] Re-enable Functional test case for Endpoint related pages (#68445)
* Improve Policy test service provider
  - Added `getFullAgentConfig()` to Endpoint Policy Test data provider service
* enable Policy List functional tests
* Added Policy Details Tests
* Add test ids to policy detail Max and Linux forms
* Added page objects utilities and moved `clickOnEuiCheckbox` there
2020-06-09 13:47:00 -04:00
Aleh Zasypkin c6e2fed1c6
Register privileges in Kibana Platform Security plugin and remove legacy getUser API. (#65472) 2020-06-05 08:11:58 +02:00
Spencer 25c382f07d
[xpack/jest_integration] remove flaky test and script block (#67138) 2020-05-21 09:59:12 -07:00
Tim Sullivan a8b1a6b924
[Reporting] Consolidate API Integration Test configs (#66637)
* [Reporting] Consolidate API Integration Test configs

* fix test isolation

* tweak

* import order

* fix ts refactor ish

* fix a test bug

* fix test

* --wip-- [skip ci]

* revision

* undo bad cherrypick

* fix delete reports

* log tweak

* fix default index pattern

* fix the test

* revert

* --wip-- [skip ci]

* unrevert

* harden the deleteAllReportingIndexes function

* fix tests

* move the log.debug line

* fix config path

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-19 11:37:09 -07:00
Xavier Mouligneau bcfc02987f
[SIEMDPOINT] Move endpoint to siem (#66907)
* adds the stuff

* keeps moving stuff

* finishes moving the stuff

* moves tests

* fix type

* try moving it all at once. BROKEN

* move endpoint to siem

* fix package coming from endpoint

* missing scripts + change url

* fix eslint

* temporary disable functional testing for endpoint

* fix api integration types

* allow api integration test + comment functional test

* fix internationalization

* fix internationalization II

* fix jest test

* fix x-pack test

* fix i18n

* fix api integration

* fix circular dependency

* add new dependency to cypress test

Co-authored-by: Davis Plumlee <davis.plumlee@elastic.co>
Co-authored-by: oatkiller <robert.austin@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-05-19 11:24:53 -04:00
Aleh Zasypkin aff7f909a9
Add Login Selector functional tests. (#65705) 2020-05-15 12:33:45 +02:00
Dario Gieselaar 9e6ebc50a0
[APM] Add license guard for annotations (#65995) 2020-05-14 16:23:38 +02:00
Josh Dover fd4074f2cd
Remove slapshot contract tests (#66277) 2020-05-12 14:30:47 -06:00
Frank Hassanabad fd6b63e9f2
[SIEM][Detection Engine] Adds backend e2e tests for basic license testing
## Summary

Adds backend e2e basic license type tests for the detection engine API. Previously we only had tests for full security space that was platinum based licensing. These tests now cover the basic license test cases. This covers test cases for machine learning to ensure you cannot create machine learning based detection rules under the basic license. Instead those tests will return the expected 403 forbidden.

Testing just the subset of the tests from this PR locally:

```sh
node scripts/functional_tests --config x-pack/test/detection_engine_api_integration/basic/config.ts
```

You do want to go to the jenkins tests on CI and ensure you can see some of the strings such as the newer forbidden messages showing up as passing.

### Checklist

- [x] [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
2020-05-12 08:50:48 -06:00
Tim Sullivan 4c460b8c42
[Reporting/Test] move functional tests to apps (#64368)
* Squashed commit of the following:

commit 5953089c03bea6b2d091f7723fea25bb1c210ee8
Author: Timothy Sullivan <tsullivan@elastic.co>
Date:   Thu Apr 9 18:29:55 2020 -0700

    move tests to apps

commit 39adeaae6d3502d2c6da4e6111c2a396f2a7aedb
Author: Timothy Sullivan <tsullivan@elastic.co>
Date:   Thu Apr 9 17:49:20 2020 -0700

    update archive with better dashboard

commit 55b600748356c1adc5e75669b0c5588a812e401d
Author: Timothy Sullivan <tsullivan@elastic.co>
Date:   Thu Apr 9 17:16:53 2020 -0700

    fix the refactoring bugs

commit 11aff10cd8009aeb9bb78aa5ce0b37a72d47776e
Author: Timothy Sullivan <tsullivan@elastic.co>
Date:   Thu Apr 9 17:16:28 2020 -0700

    remove unused fixtuers

commit 05c33817c8eb67c461ac012cf2f71a9c01f1a91e
Author: Timothy Sullivan <tsullivan@elastic.co>
Date:   Thu Apr 9 16:37:36 2020 -0700

    Start of refactoring

commit b63c182b5f32b19dc3ca715efdbc5f18fcc02f67
Author: Timothy Sullivan <tsullivan@elastic.co>
Date:   Thu Apr 9 16:32:50 2020 -0700

    Todo comments

commit 1e0105e673
Author: Timothy Sullivan <tsullivan@elastic.co>
Date:   Thu Apr 9 14:31:58 2020 -0700

    revert unrelated change

commit 206fd14b77
Merge: 0d4c2ad29a 834306458a
Author: Timothy Sullivan <tsullivan@elastic.co>
Date:   Thu Apr 9 14:28:45 2020 -0700

    Merge branch 'master' into reporting/test-better

commit 0d4c2ad29a
Author: Timothy Sullivan <tsullivan@elastic.co>
Date:   Wed Apr 8 10:41:19 2020 -0700

    fix ts

commit 890128c47d
Merge: d9ce4024ec 3598b8c44c
Author: Timothy Sullivan <tsullivan@elastic.co>
Date:   Wed Apr 8 10:31:09 2020 -0700

    Merge branch 'master' into reporting/test-better

commit d9ce4024ec
Author: Timothy Sullivan <tsullivan@elastic.co>
Date:   Tue Apr 7 08:31:58 2020 -0700

    [Reporting] convert all server unit tests to TypeScript

* fix imports and readmes

* remove not-needed readme

* remove extra info from readme

* correct some comments

* log the error that was caught

* fix config path in readme

* fix readme instructions to point to updated paths

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-04-27 14:24:55 -07:00
Jonathan Buttner 0a9e17b57f
[Endpoint][EPM] Retrieve Index Pattern from Ingest Manager (#63016)
* Endpoint successfully depending on ingest manager to initialize

* Moving the endpoint functional tests to their own directory to avoid enabling ingest in the base tests

* Removing page objects and other endpoint fields from base functional

* Updating code owners with new functional location

* Adding index pattern functionality

* Missed a file

* Pointing resolver tests at endpoint functional tests

* Pointing space tests at the endpoint functional directory

* Adding ingest service to do setup and tests for 500s

* Correcting services path

* Adding jest test names

* Updating es archives with the correct mapping and index names

* Fixing import error

* Adding resolver tests to code owners

* enabling epm flag for functional tests

* adding correct tag to test

* Removing the version information and unneeded xsrf

* Addressing endpoint index pattern feedback

* Removing unused import

* Renaming index pattern to es index pattern

* Fixing missed index pattern calls

* Removing unused import

* Fixing type error

* Moving es_index_pattern outside of installed and fixing function name

* Keeping the event index the same for now

* Wrapping index pattern await in try catch

* Address PR feedback, adding comments
2020-04-16 16:20:16 -04:00
Dmitry Lemeshko 50228df498
Code coverage: run more configs with functional tests (#63680)
* run endpoint tests with coverage

* add more configs

* add plugin_functional config
2020-04-16 20:40:55 +03:00
Jonathan Buttner 6b5cbd562f
[Endpoint][EPM] Endpoint depending on ingest manager to initialize (#62871)
* Endpoint successfully depending on ingest manager to initialize

* Moving the endpoint functional tests to their own directory to avoid enabling ingest in the base tests

* Removing page objects and other endpoint fields from base functional

* Updating code owners with new functional location

* Pointing resolver tests at endpoint functional tests

* Pointing space tests at the endpoint functional directory

* Adding jest test names
2020-04-09 09:41:38 -04:00
Gidi Meir Morris e7a4ca261b
[Event Log] adds query support to the Event Log (#62015)
* added Start api on Event Log plugin

* added empty skeleton for Event Log FTs

* added functional test to public find events api

* added test for pagination

* fixed unit tests

* added support for date ranges

* removed unused code

* replaces valdiation typing

* Revert "replaces valdiation typing"

This reverts commit 711c098e9b.

* replaces match with term

* added sorting

* fixed saved objects nested query

* updated plugin FTs path

* Update x-pack/plugins/encrypted_saved_objects/README.md

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

* Update x-pack/plugins/encrypted_saved_objects/README.md

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

* remofed validation from tests

* fixed typos

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Aleh Zasypkin <aleh.zasypkin@gmail.com>
2020-04-06 18:02:58 +01:00
Aleh Zasypkin 4d8bae4a4c
Migrate Security and EncryptedSavedObjects test plugins to the Kibana Platform (#61614) 2020-03-30 19:38:39 +02:00
Aleh Zasypkin fa69765e4b
Implement Kibana Login Selector (#53010) 2020-03-23 22:45:26 +01:00
Mike Côté 851b8a82a5
License checks for actions plugin (#59070)
* Define minimum license required for each action type (#58668)

* Add minimum required license

* Require at least gold license as a minimum license required on third party action types

* Use strings for license references

* Ensure license type is valid

* Fix some tests

* Add servicenow to gold

* Add tests

* Set license requirements on other built in action types

* Use jest.Mocked<ActionType> instead

* Change servicenow to platinum

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

* Make actions config mock and license state mock use factory pattern and jest mocks (#59370)

* Add license checks to action HTTP APIs (#59153)

* Initial work

* Handle errors in update action API

* Add unit tests for APIs

* Make action executor throw when action type isn't enabled

* Add test suite for basic license

* Fix ESLint errors

* Fix failing tests

* Attempt 1 to fix CI

* ESLint fixes

* Create sendResponse function on ActionTypeDisabledError

* Make disabled action types by config return 403

* Remove switch case

* Fix ESLint

* Add license checks within alerting / actions framework (#59699)

* Initial work

* Handle errors in update action API

* Add unit tests for APIs

* Verify action type before scheduling action task

* Make actions plugin.execute throw error if action type is disabled

* Bug fixes

* Make action executor throw when action type isn't enabled

* Add test suite for basic license

* Fix ESLint errors

* Stop action task from re-running when license check fails

* Fix failing tests

* Attempt 1 to fix CI

* ESLint fixes

* Create sendResponse function on ActionTypeDisabledError

* Make disabled action types by config return 403

* Remove switch case

* Fix ESLint

* Fix confusing assertion

* Add comment explaining double mock

* Log warning when alert action isn't scheduled

* Disable action types in UI when license doesn't support it (#59819)

* Initial work

* Handle errors in update action API

* Add unit tests for APIs

* Verify action type before scheduling action task

* Make actions plugin.execute throw error if action type is disabled

* Bug fixes

* Make action executor throw when action type isn't enabled

* Add test suite for basic license

* Fix ESLint errors

* Stop action task from re-running when license check fails

* Fix failing tests

* Attempt 1 to fix CI

* ESLint fixes

* Return enabledInConfig and enabledInLicense from actions get types API

* Disable cards that have invalid license in create connector flyout

* Create sendResponse function on ActionTypeDisabledError

* Make disabled action types by config return 403

* Remove switch case

* Fix ESLint

* Disable when creating alert action

* Return minimumLicenseRequired in /types API

* Disable row in connectors when action type is disabled

* Fix failing jest test

* Some refactoring

* Card in edit alert flyout

* Sort action types by name

* Add tooltips to create connector action type selector

* Add tooltips to alert flyout action type selector

* Add get more actions link in alert flyout

* Add callout when creating a connector

* Typos

* remove float right and use flexgroup

* replace pixels with eui variables

* turn on sass lint for triggers_actions_ui dir

* trying to add padding around cards

* Add callout in edit alert screen when some actions are disabled

* improve card selection for Add Connector flyout

* Fix cards for create connector

* Add tests

* ESLint issue

* Cleanup

* Cleanup pt2

* Fix type check errors

* moving to 3-columns cards for connector selection

* Change re-enable to enable terminology

* Revert "Change re-enable to enable terminology"

This reverts commit b497dfd6b6.

* Add re-enable comment

* Remove unecessary fragment

* Add type to actionTypeNodes

* Fix EuiLink to not have opacity of 0.7 when not hovered

* design cleanup in progress

* updating classNames

* using EuiIconTip

* Remove label on icon tip

* Fix failing jest test

Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>

* Add index to .index action type test

* PR feedback

* Add isErrorThatHandlesItsOwnResponse

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com>
2020-03-20 10:49:37 -04:00
Frank Hassanabad f890776e6d
[SIEM][Detection Engine] Backend end-to-end tests
## Summary

* Adds end to end integration tests
* Fixes a bug with import where on imports it was forcing all rules that were being imported to be set to be "enabled: false" instead of honoring what the original export has set for its enabled.
* Adds a few "to be safe" await block so that the front end does not get a race condition within the bulk deletes and other parts of the code.
* Fixes `statusCode` to be `status_code` and removes most of the Hapi Boomer errors
* Changes PUT to be PATCH for partial updates
* Adds true updates with PUT
* Put some TODO blocks around existing bugs found in the API in the e2e tests that we might have time to get to or might not. This will let others maintaining the tests know that once they fix the bug they should update the end to end test to change the behavior.  

Testing this:

Go to the latest CI logs and look for any particular lines from the test executing such as:

```ts
should set the response content types to be expected
```

Also run this manually on your machine through this command:

```ts
node scripts/functional_tests --config x-pack/test/detection_engine_api_integration/security_and_spaces/config.ts
```

Change a test manually and re-run the above command to watch something fail.


Screen shot of what you should see on the CI machine when these are running:
<img width="1825" alt="Screen Shot 2020-02-08 at 10 15 21 AM" src="https://user-images.githubusercontent.com/1151048/74089355-ae9a8e80-4a5d-11ea-9050-86e68d7e3bba.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/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~~

- [x] [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)~~

~~- [ ] 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, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~~

### For maintainers

- [x] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
2020-02-11 15:24:30 -07:00
Yuliia Naumenko 8259445350
Create UI for alerting and actions plugin (#48959)
* Refactored reducers type definitions

* Fixed dependancy objects

* Fixed action add

* Fixed logging app icon

* Added action types params fields

* Added fields for check and re-notify alert

* Add tags to alert list

* Adjusted threshold expression with validation, added visualization

* Move delete button to the left and hide when no selection

* Rename action list title column to name

* fixed request

* Removed watcher labels

* Design cleanup

* Added expression default values

* Added visualization for index threshold alert

* Rename Actions tab to Connectors

* Rename "create action" to "create connector"

* Remove actions column name

* Add count per action type

* Hide checkboxes when user can't delete

* Add title to home, rename Alerting UI breadcrumb (remove UI part)

* Added correct binding for interval and throttle

* Added tags support for create Alert UI

* Added server error display in UI on save alert

* Added connectors for action forms

* Update button styles

* Switch inputs to compressed forms

* Fixed some fields for add alert form

* Fixed updating action by index

* Fixed filter for index/fields api requests

* Remove the test alert type that was in the init function

* Fixed action type icon on add connector form and did small refactoring on action forms; added action validation

* Rename alerting UI plugin to triggers and actions UI (or something else) #50305

* Implemented action connector edit UI

* Add bulk actions to alerts list

* Update home title spacing

* Fixed editing secrets action property

* Changing behaviour of bulk actions and disable buttons during request

* Refactored plugin definition with appdependency interface

* Moved add dependencies to the separate file

* Enable visualization if only hasExpressionErrors passed

* Fixed add action twice on click card

* Fix actions column in alert list

* Fixed action canSave capability

* Renamed Actions to ActionConnectors in appropriate UI files

* Renamed alertTypeParams to params in UI code

* Add filter for tags

* Cleanup previous commit

* Fix alert type filter

* Refactored edit form to use ActionTableItem

* Renamed ActionTableItem to ActionConnectorTableItem

* Fixed missing button key error for alerts list filter

* Renamed translation labels for connectors

* Enable UI plugin by default

* Rename buildin to builtin

* Fix some type checks

* Add API tests

* Split API file into smaller files

* Rename plugin id

* Remove dependency on actions plugin (should be optional dep in NP)

* Fix some translation ids

* Revert "Rename plugin id"

This reverts commit f6daeb3d5e.

* Rename method for loading connectors

* Added functional tests base

* Fix functional test type filter

* Add test alert type for now

* Initial connectors functional tests

* Rename description to name

* Use unique connector names to allow re-running tests

* Assert on more things

* Update alert/action menu items. Flyout width. Add index.scss file

* Added action connector list unit tests

* Add bulk delete functional test

* Move tests to SSL functional environment

* Fix tests

* Added unit tests for actionTypeRegistry and alertTypeRegistry

* Fixed update connector with only properties

* Added some functional tests for alerts with TODOs

* connectors list page cleanup

* empty state cleanup

* Added connector edit flyout unit test

* Fix functional tests

* text cleanup

* zindex fix for index threshold trigger

* Expand the functional tests, add assertions

* Fixed edit connector from the Name column, and removed pencil button

* Remove tags filter, use search bar instead

* Finalize functional tests

* Support filtering alerts by action type

* Rename plugin name for translations

* Rename default breadcrumb title to alerts and actions

* Added unit tests for connectors empty prompt, fixed api tests

* Added unit test for select action type menu for create connector; Fixed update selected connector for edit form

* Added unit test for edit connector flyout

* Added alerts list unit tests

* Added connector form unit tests

* Added connector reducer unit tests

* Fixed some failing unit tests

* Fixed alerts list unit tests

* Set alert tab default if it is available

* Added doc_title and get_time_units unit tests

* Added some test fixes

* Fixed index threshold expression to display only index and fields

* Added email building action unit tests

* Added unit tests for builtin action types

* Remove test alert type

* Move create alert UI behind feature flag 'createAlertUiEnabled'

* Fix functional tests

* Update codeowners

* Update codeowners for tests

* Revert watcher changes

* Fix type check failure

* Fix unit test failures

* Fixed typecheck failures

* Fixed language check errors

* Did some text/type fixes

* Fixed typecheck

* Fixed unit tests warning

* Fix failing functional tests

* Fix registry tests to have cleaner diff when it fails

* Make DEFAULT_SECTION a Section type

* Remove unused constructor

* Make app dependency error string same line

* Remove unused error pages

* Set interface to alerts context

* Fix action_connector_form.tsx label

* Fix label in connector_add_flyout.tsx

* Fix label in alert_add.tsx

* Move alert_types to builtin_alert_types

* Move some threshold constants into threshold folder

* Move api.ts within threshold folder

* Removed duplication logic from action type and alert type registry list

* Fixed email action type test and adjusted validation to support arrays ony

* Added missing connector fields for email action type

* Fixed building action types issues due to comments

* Refactored with more new platform structure; fixed some comments from review

* Capitalize Actions in 'Alerts and Actions' labels

* Skip flaky tests

* Fix failing functional test

* Fixed failing unit tests, added new deps

* Fixed type checks

* Fixed language check failing

* Fix broken functional tests

* Refactored actionConnectors and alerting context

* Removed doc title service

* added get time options type definitions

* removed obsolete code

* Made generic registry type for actionTypes and alert types

* Fixed some enum types

* fixed type check CI

* Convert EuiSearchBar to normal text field

* Fix typo

* Fix conditional rendering

* Fix bug where selection doesn't reset

* Fix broken functional test, wait for ENTER key to search alerts

* Make app section hide from menu when user doesn't have access

* Fixed connector name validation (error due to renaming from description)

* Removed obsolete useEffect

* Removed unused ShareRouter

* Fixed key validation error

* Mobed wrongly wrapped objects

* Removed useEffect from connectors form

* Replaced error forms with eui controls props

* Added delete confirmation dialog for connectors list

* Fixed build errors

* Fixed failing test

* Skip flaky tests

* Added null check for app context - render components tree only if it isn't null

* Fixed type check eror

* Did changes on the UX and text/labels commnets

* Fixed failing tests

* Fixed error handling

* Refactored Webhook form http headers due to the mockup

* Fixed build

* Fix labels issue

* Fix spacing and form row alignment

* Fixed failing type check

* put ownfocus on popover in actions list

* fix spacing and flex

* fix color on conectors list

* clean up webhook headers form

* fix logic check for headers

* Made changes due to review comments

* Fixed delete connector test

* Fixed all flaky test for delete connectors 53956

* Fixed type check due to NP changes

* Disable plugin by default

* Added configuration props for functional tests to enable triggers and actions ui

* removed timeout from test

* added enable triggers and actions to functional/config.js

* fix the build

* Changed ci group and disabled plugin

* changed config setting to root

* Changed disable approach

* Experiment with index managment

* Set back configuration settings for triggers and actions

* Enable plugins

* Set index management to disabled to see the failing issue

* Revert experimental back for index_managment

* Fixed type check

Co-authored-by: Mike Côté <mikecote@users.noreply.github.com>
Co-authored-by: dave.snider@gmail.com <dave.snider@gmail.com>
Co-authored-by: DeFazio <michael.defazio@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Peter Schretlen <peter.schretlen@gmail.com>
2020-01-13 16:16:20 -08:00
Larry Gregory e6e1373db2
Security - Role Mappings UI (#53620)
* Initial role mappings UI

* apply design edits

* address PR feedback

* fix type cast for number field

* Update x-pack/legacy/plugins/security/public/views/management/role_mappings/edit_role_mapping/components/mapping_info_panel/mapping_info_panel.tsx

Co-Authored-By: Joe Portner <5295965+jportner@users.noreply.github.com>

* Cleanup FTR configuration, and handle role mapping 404 errors properly

* align naming of role mappings feature check

* Apply suggestions from code review

Co-Authored-By: Brandon Kobel <brandon.kobel@gmail.com>

* add missing test assertions

* inlining feature check logic

* switch to using snapshot

* use href instead of onClick

* adding delete unit test

* consolidate href building

* unify page load error handling

* simplify initial loading state

* documenting unconditional catch blocks

* use nodes.info instead of transport.request

* Apply suggestions from code review

Co-Authored-By: Brandon Kobel <brandon.kobel@gmail.com>

* move model out of LP into NP

* convert except_field_rule to except_any_rule

* docs, take 1

* update gif

Co-authored-by: Joe Portner <5295965+jportner@users.noreply.github.com>
Co-authored-by: Brandon Kobel <brandon.kobel@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-11 13:26:31 -05:00
Dmitry Lemeshko 26ce6104a9
Code coverage setup on CI (#49003)
* running code coverage in CI

* apply review feedback

* add custom function to upload merged coverage reports

* fix artifacts upload without coverage

* add file extension to fix validation

* Check code_coverage is set

* run oss tests via grunt task

* review fixes

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-01-08 21:08:48 +01:00
Mikhail Shustov 0ded3cb094
Licensing plugin functional tests (#53580)
* NP licensing add functional tests (#53002)

* fix comment

* introduce core provider plugin for integration tests

* platform functional tests use core_provider_plugin for testing

* add 3 scenario for licensing plugins: server, client, legacy

* remove unused code

* run all licensing_plugin tests on CI

* remove duplicated config

* address comments

* declare global type for core provider

* remove potentially dangerous operation

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2019-12-24 12:31:18 +03:00
Mikhail Shustov 4ea2599b8c
Revert "NP licensing add functional tests (#53002)" (#53577)
This reverts commit a4c5b13400.
2019-12-19 13:12:17 +01:00
Mikhail Shustov a4c5b13400
NP licensing add functional tests (#53002)
* fix comment

* introduce core provider plugin for integration tests

* platform functional tests use core_provider_plugin for testing

* add 3 scenario for licensing plugins: server, client, legacy

* remove unused code

* run all licensing_plugin tests on CI

* remove duplicated config

* address comments

* declare global type for core provider
2019-12-19 10:59:27 +01:00
spalger 8e9a8a84dc autofix all violations 2019-12-13 23:17:13 -07:00
Mikhail Shustov dce893bb79
NP licensing plugin improvements (#51818)
* 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
2019-12-09 10:40:18 +01:00
Robert Austin 8fb8ef94b1
Add Endpoint plugin and Resolver embeddable (#51994)
* 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
2019-12-06 14:55:16 -05:00
Mike Côté 10c158b483
Increase alerting test stability and reduce flakiness (#50246)
* Increase alerting test stability

* More changes to test methodology + bug fix in throttling

* Fix comments

* Cleanup

* Typo

* Fix broken tests

* Fix integration tests

* Fix typo
2019-11-18 12:59:21 -05:00
spalger 78e9d93268 skip flaky suite (#50079) (#50074) (#48709) (#50078) 2019-11-08 09:59:48 -05:00
Gidi Meir Morris c485893ab2
Improves performance of task execution in Task manager
This PR include three key changes:

1. Run tasks as soon as they have been marked as running, rather than wait for the whole batch to me marked
2. Use a custom refresh setting of refresh: false where possible, in place of wait_for, in order to speed up Task Manager's internal workflow
3. Instrumentation of Task Manager exposing Activity / Inactivity metrics in Performance test runs
2019-11-06 08:44:13 -05:00
renovate[bot] 5b375df8e9 Update moment related packages (#46849)
* Update moment related packages

* unify moment version in yarn.lock

* adapt ro pluralization fixes

* update some bad pluralization in fixtures/snapshots
2019-10-28 12:07:35 -07:00
Aleh Zasypkin 0210ce47b6
Preserve URL fragment during SAML handshake. (#44513) 2019-10-09 18:12:14 +02:00
Aleh Zasypkin a9f5c2f30a
Enable PKI integration tests. (#44115) 2019-09-16 09:30:19 +02:00
Jonathan Budzenski f8abcc4ea3
[test/x-pack] add matching functional_test_runner script (#44939)
* [test/x-pack] add matching functional_test_runner script

* make readme consistent
2019-09-11 14:52:43 -05:00
Aleh Zasypkin 17106e8a78
Introduce PKI authentication provider. (#42606) 2019-08-27 18:28:54 +02:00
Mike Côté 90532673fd
Add spaces only tests for alerting and actions (#43616)
* Add spaces only tests

* Rename some tests to make more sense in spaces only context

* Modify test suite titles

* Apply changes from master

* Loop only one scenario for now

* Reduce amount of tests spaces_only runs

* Fix failing test

* Remove looping in spaces only tests
2019-08-21 13:23:06 -04:00
Mike Côté 5734f1c1be
Add security support for alerts and actions (#41389)
* Initial work

* Cleanup add createAPIKey fn pt1

* Change getServices function to take request as parameter

* Use API key when executing alerts

* Revert task manager using encrypted saved objects

* Store fired actions within a saved object to encrypt API keys

* Fix fireActionId

* Cleanup code, fix type check error

* Add a type for getScopedSavedObjectsClient

* Fix getBasePath and spaceIdToNamespace functions

* Add safety check for API key and action

* Fix integration tests

* Fix broken jest tests

* Cleanup

* Rename generatedApiKey to apiKeyValue

* Ensure access to action record

* Cleanup

* Add unit tests

* Fix variable conflict

* Revert task manager specific code (no longer needed)

* Remove fire terminology

* Move tests to spaces and security folder

* Use ES Archiver to remove spaces (empty_kibana)

* Fix missing pieces

* Convert action tests to run per user

* Convert alerting tests to run per user

* Fix type check issue

* Fix failing test

* Add callCluster and savedObjectsClient authorization tests

* Make savedObjectsClient return 403 for authorization tests

* Cleanup

* Fix test failure

* Common function to get data from test index

* Create ObjectRemover

* Cleanup

* useApiKey now provided to functions instead of relying on condition of two strings

* Fix typo

* Make tests it(...) start with should

* Rename useApiKey to isSecurityEnabled

* Merge apiKeyId and apiKeyValue into one

* Update docs

* Use feature controls for list alert / action types API

* Remove need to add ! in TypeScript for required plugins

* Fix ESLint issue

* Include actions and alertTypeParams into AAD and genereate new API key on update

* Generate random id for API key name attribute

* Include interval in AAD

* Send pre-encoded string

* Fix ExecutorError

* Fix apiKey snapshot

* Fix 'default' typo

* De-compose apiKey

* Refresh API key when enabling / disabling an alert

* Add updatedBy

* Make unauthorized APIs return 404
2019-08-20 11:42:15 -04:00
Jonathan Budzenski e6e92ac2bf
[test] remove x-pack mocha configuration (#42979)
* update scripts

* run mocha from root

* rm mocha grunt task

* rm x-pack mocha setup

* rm x-pack/mocha*

* Revert "rm x-pack/mocha*"

This reverts commit fb56005e77.
2019-08-15 12:21:42 -05:00
Mike Côté d113d4c0c1
Move alerting tests into own folder (#43061)
* Move alerting tests into own folder

* Use ciGroup8

* Fix test failures
2019-08-12 09:28:10 -04:00
Aleh Zasypkin 0d31f52bb8
Add support for OpenID Connect implicit authentication flow. (#42069) 2019-08-08 15:39:15 +02:00