An MVP of the RBAC work required for the "alerts as data" effort. An example of the existing implementation for alerts would be that of the security solution. The security solution stores its alerts generated from rules in a single data index - .siem-signals. In order to gain or restrict access to alerts, users do so by following the Elasticsearch privilege architecture. A user would need to go into the Kibana role access UI and give explicit read/write/manage permissions for the index itself.
Kibana as a whole is moving away from this model and instead having all user interactions run through the Kibana privilege model. When solutions use saved objects, this authentication layer is abstracted away for them. Because we have chosen to use data indices for alerts, we cannot rely on this abstracted out layer that saved objects provide - we need to provide our own RBAC! Instead of giving users explicit permission to an alerts index, users are instead given access to features. They don't need to know anything about indices, that work we do under the covers now.
Co-authored-by: Yara Tercero <yctercero@users.noreply.github.com>
Co-authored-by: Yara Tercero <yara.tercero@elastic.co>
* Adding feature flag for auth
* Hiding SOs and adding consumer field
* First pass at adding security changes
* Consumer as the app's plugin ID
* Create addConsumerToSO migration helper
* Fix mapping's SO consumer
* Add test for CasesActions
* Declare hidden types on SO client
* Restructure integration tests
* Init spaces_only integration tests
* Implementing the cases security string
* Adding security plugin tests for cases
* Rough concept for authorization class
* Adding comments
* Fix merge
* Get requiredPrivileges for classes
* Check privillages
* Ensure that all classes are available
* Success if hasAllRequested is true
* Failure if hasAllRequested is false
* Adding schema updates for feature plugin
* Seperate basic from trial
* Enable SIR on integration tests
* Starting the plumbing for authorization in plugin
* Unit tests working
* Move find route logic to case client
* Create integration test helper functions
* Adding auth to create call
* Create getClassFilter helper
* Add class attribute to find request
* Create getFindAuthorizationFilter
* Ensure savedObject is authorized in find method
* Include fields for authorization
* Combine authorization filter with cases & subcases filter
* Fix isAuthorized flag
* Fix merge issue
* Create/delete spaces & users before and after tests
* Add more user and roles
* [Cases] Convert filters from strings to KueryNode (#95288)
* [Cases] RBAC: Rename class to scope (#95535)
* [Cases][RBAC] Rename scope to owner (#96035)
* [Cases] RBAC: Create & Find integration tests (#95511)
* [Cases] Cases client enchantment (#95923)
* [Cases] Authorization and Client Audit Logger (#95477)
* Starting audit logger
* Finishing auth audit logger
* Fixing tests and types
* Adding audit event creator
* Renaming class to scope
* Adding audit logger messages to create and find
* Adding comments and fixing import issue
* Fixing type errors
* Fixing tests and adding username to message
* Addressing PR feedback
* Removing unneccessary log and generating id
* Fixing module issue and remove expect.anything
* [Cases] Migrate sub cases routes to a client (#96461)
* Adding sub cases client
* Move sub case routes to case client
* Throw when attempting to access the sub cases client
* Fixing throw and removing user ans soclients
* [Cases] RBAC: Migrate routes' unit tests to integration tests (#96374)
Co-authored-by: Jonathan Buttner <jonathan.buttner@elastic.co>
* [Cases] Move remaining HTTP functionality to client (#96507)
* Moving deletes and find for attachments
* Moving rest of comment apis
* Migrating configuration routes to client
* Finished moving routes, starting utils refactor
* Refactoring utilites and fixing integration tests
* Addressing PR feedback
* Fixing mocks and types
* Fixing integration tests
* Renaming status_stats
* Fixing test type errors
* Adding plugins to kibana.json
* Adding cases to required plugin
* [Cases] Refactoring authorization (#97483)
* Refactoring authorization
* Wrapping auth calls in helper for try catch
* Reverting name change
* Hardcoding the saved object types
* Switching ensure to owner array
* [Cases] Add authorization to configuration & cases routes (#97228)
* [Cases] Attachments RBAC (#97756)
* Starting rbac for comments
* Adding authorization to rest of comment apis
* Starting the comment rbac tests
* Fixing some of the rbac tests
* Adding some integration tests
* Starting patch tests
* Working tests for comments
* Working tests
* Fixing some tests
* Fixing type issues from pulling in master
* Fixing connector tests that only work in trial license
* Attempting to fix cypress
* Mock return of array for configure
* Fixing cypress test
* Cleaning up
* Addressing PR comments
* Reducing operations
* [Cases] Add RBAC to remaining Cases APIs (#98762)
* Starting rbac for comments
* Adding authorization to rest of comment apis
* Starting the comment rbac tests
* Fixing some of the rbac tests
* Adding some integration tests
* Starting patch tests
* Working tests for comments
* Working tests
* Fixing some tests
* Fixing type issues from pulling in master
* Fixing connector tests that only work in trial license
* Attempting to fix cypress
* Mock return of array for configure
* Fixing cypress test
* Cleaning up
* Working case update tests
* Addressing PR comments
* Reducing operations
* Working rbac push case tests
* Starting stats apis
* Working status tests
* User action tests and fixing migration errors
* Fixing type errors
* including error in message
* Addressing pr feedback
* Fixing some type errors
* [Cases] Add space only tests (#99409)
* Starting spaces tests
* Finishing space only tests
* Refactoring createCaseWithConnector
* Fixing spelling
* Addressing PR feedback and creating alert tests
* Fixing mocks
* [Cases] Add security only tests (#99679)
* Starting spaces tests
* Finishing space only tests
* Refactoring createCaseWithConnector
* Fixing spelling
* Addressing PR feedback and creating alert tests
* Fixing mocks
* Starting security only tests
* Adding remainder security only tests
* Using helper objects
* Fixing type error for null space
* Renaming utility variables
* Refactoring users and roles for security only tests
* Adding sub feature
* [Cases] Cleaning up the services and TODOs (#99723)
* Cleaning up the service intialization
* Fixing type errors
* Adding comments for the api
* Working test for cases client
* Fix type error
* Adding generated docs
* Adding more docs and cleaning up types
* Cleaning up readme
* More clean up and links
* Changing some file names
* Renaming docs
* Integration tests for cases privs and fixes (#100038)
* [Cases] RBAC on UI (#99478)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* Fixing case ids by alert id route call
* [Cases] Fixing UI feature permissions and adding UI tests (#100074)
* Integration tests for cases privs and fixes
* Fixing ui cases permissions and adding tests
* Adding test for collection failure and fixing jest
* Renaming variables
* Fixing type error
* Adding some comments
* Validate cases features
* Fix new schema
* Adding owner param for the status stats
* Fix get case status tests
* Adjusting permissions text and fixing status
* Address PR feedback
* Adding top level feature back
* Fixing feature privileges
* Renaming
* Removing uneeded else
* Fixing tests and adding cases merge tests
* [Cases][Security Solution] Basic license security solution API tests (#100925)
* Cleaning up the fixture plugins
* Adding basic feature test
* renaming to unsecuredSavedObjectsClient (#101215)
* [Cases] RBAC Refactoring audit logging (#100952)
* Refactoring audit logging
* Adding unit tests for authorization classes
* Addressing feedback and adding util tests
* return undefined on empty array
* fixing eslint
* [Cases] Cleaning up RBAC integration tests (#101324)
* Adding tests for space permissions
* Adding tests for testing a disable feature
Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* add settings
* update abab package to version with types
* add test case for CORS
* add tests for cors config
* fix jest tests
* add deprecation message
* tweak deprecation
* make test runable on Cloud
* add docs
* fix type error
* add test to throw on invalid URL
* address comments
* Update src/core/server/http/http_config.test.ts
Co-authored-by: Larry Gregory <lgregorydev@gmail.com>
* Update docs/setup/settings.asciidoc
Co-authored-by: Brandon Kobel <brandon.kobel@gmail.com>
* allow kbn-xsrf headers to be set on CORS request
Co-authored-by: Larry Gregory <lgregorydev@gmail.com>
Co-authored-by: Brandon Kobel <brandon.kobel@gmail.com>
* [Visualizations] New vis wizard
* Update functional tests
* Create oss plugins for maps and lens and unregister alias function
* Add new plugins to .i18nrc.json
* Add readme and codeowners to the new plugins
* update docs
* fix tests
* fix types
* fixes
* Update development docs
* fix oss functional tests
* Fix jest and x-pack functional tests
* Fix functional test
* changes on the layout
* Cleanup and responsiveness
* cleanup unecessary code
* add common folder to the new OSS plugins
* remove unecessary translations
* Update limits.yml file
* Fix basic label
* Add experimental badge on controls vis
* Nice improvements
* fixes
* Improving styles
* Making modal go full height on smaller screens
* Fixing sass lint warning
* fix lint error
* fix internationalization error
* PR fixes
* PR changes
* Use useCallback where possible
* Remove translations that need to be translated again
* Lazy Load wizard modal
* Remove legacyMapVisualizationWarning
* Import the OSS plugins constants from the plugins
* Export constant from lensOss
* Change the new oss plugins from OSS to Oss
* Add a new line to the kibana.json files of the new plugins
* New nit fix
* Fix spaces
* Change the texts for the first step of the modal
* Fix test
* Fixes some of the PR comments
* Add onClick funtionality to the entire aggregation based card
* Cards description changes, introduce a copyFromRoot method to solve the problem of when disabling the x-pack plugic, to also disable the oss
* Create new FTR for testing the functionality of the wizard when both maps and lens apps are disabled
* fix eslint error
* Change groupTitles and descriptions
* Change input vis description
* Remove the copyFromRoot from the signature of the ConfigDeprecationFactory and export it from the main entrypoint
* Make the disabled cards badge clickable
* Changes from code review
* Fix functional tests failures
* Rename groupTitle to titleInWizard to be more specific
* Change vega vis note
* minor design changes
* fix problem with plugins list docs
* Retrieve maps and lens landing page from docs service and add tracking url param
* Fix funtional test for the new dashboard flow
* Fix logic in alias registry for removing the discardOnRegister alias
* no need to remove the alias entry from the discardOnRegister array
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: miukimiu <elizabet.oliveira@elastic.co>
* create xpack plugin skeleton, start to implement management section
* add tag creation modal
* first implementation of the tags table
* use InMemoryTable
* add edit modal and delete action
* update plugin list
* add tag list, fix types
* add capabilities check on client-side
* add tag combo box component
* add missing i18n keys
* fix privilege FTR tests
* add base structure for FTR tests
* fix feature ftr test
* use string literals for i18n
* create savedObjectsTaggingOss plugin, move API types to oss plugin, start to wire to SO management page.
* update plugin list
* fix types
* allow to use `_find` with multiple references
* add FTR test for _find API on references fields
* add _find integration tests
* update generated doc
* start to implement tag filtering on SO management section
* update generated docs
* wire tagging API to dashboard listing page
* fix i18n namespace
* fix type & tests
* update dashboard listing snapshots
* adapt FTR listingTable service to search for parsable queries
* wite tagging API to visualize listing
* update tagging plugin limits
* add server-side and client-side validation for tag create/edit
* rename title field to name
* fix types
* fix types bis
* add removeReferencesTo API to SOR/SOC
* update generated doc
* add server-side unit test for `savedObjectsTagging` plugin
* move tagging API types to its own file
* add savedObjectsTaggingOss mock
* add tags_cache tests
* add tests for client-side tag client
* extract uiApi to distinct files
* various API improvements
* add more tests
* add link between tag and so management sections + add connection counts
* add base functional test suite for tagging
* add more FTR tests
* improve feature control func test
* update codeowners
* update generated doc
* fix access to proxy modal
* adapt SO save modal to allow to add tag field
* add SO decorator registry and tag implementation
* add unit tests for SO tag decorator
* add functional tests for visualize integration
* add tag SO read permission for vis/dash feature
* add RBAC api integ tests
* add API integration tests
* add test for getTagConnectionsUrl
* add SOM test suite
* add dashboard integration suite
* remove test line
* add missing unit tests
* improve API types doc
* fix create modal save button label
* remove console.log
* improve doc
* self review
* add refresh interval for tag cache
* improve page object doc
* minor cleanup
* address review comments
* small layout fixes
* add initial focus
* use lazy accessor for tag request handler context
* adapt SOM export and export route to handle references
* remove icon from feature config due to master changes
* fix SO table tests
* update generated docs
* sort tags by name in filter dropdown and listing component
* wire SO tagging to dashboard save modal
* fix types
* - add 'create tag' action in tag selector
- add notifications on update/create/delete from management
- delete modal wording
* add description max length validation
* remove real-time validation
* fix i18n bundle id
* update expected size of savedObjectsTagging plugin
* use own useIfMounted
* update limit again, contract components cannot be lazy loaded atm.
* math is hard
* remove single usage of lodash for bundle size
* add async imports for create/edit modal
* add FTR test for 'create tag' action from tag selector
* allow 'create new' option to prepopulate name field
* extract savedObjectToTag
* add advancedSettings read user for security api_integ suite
* add audit login for security client wrapper
* use import type when possible
* wire SO tagging to lens visualization
* fix lens jest test
* Fix `create tag` option being selected when closing the selector dropdown
* add sorting to tag column from getTableColumnDef
* address some of restrry comments
* rename tag selector's setSelected option to onTagsSelected
* fix audit logging even type for saved_object_remove_references
* update plugin size limit to current size
* adapt maxlength validation wording
* remove selection column until we have batch action menu
* remove connections link when user lack read privilege to savedObjectManagement
* forbid registering multiple SO decorators with the same priority
* add so decorator test
* extract getTagFindReferences and create API mock
* update audit-logging ascidoc
* doc nit
* throw conflict error if update returns any failure
* use refresh=true as default
* wording nits
* export: rename `references` to `hasReference`
* update generated doc
* set description max length to 100
* do not initialize tag cache on anonymous pages
* split fetchObjectsToExport into two distinct functions
* change tag client `delete` call order
* tsdoc nits
* more nits
* add README for oss plugin
* add oss plugin start tests
* SavedObject.find: rename `references` to `hasReference`
* change section description label
* remove url prefix constants
* last nits and comments
* update generated doc
Resolver has a test plugin. It can be found in `x-pack/tests/plugin_functional`. You can try it out like this:
```
yarn start --plugin-path x-pack/test/plugin_functional/plugins/resolver_test/
```
This PR enables automated tests for the test plugin. This ensures that the test plugin will render.
## 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
* 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>
* 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>
* 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>
* 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>
* 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
* 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