Commit graph

39 commits

Author SHA1 Message Date
Larry Gregory e18bfc1497
Feature Controls - Allow telemetry to be toggled with advancedSettings feature privilege (#35250)
* Allow telemetry to be toggled with feature privileges
2019-04-25 11:43:42 -04:00
Spencer cce64060d0
[npm] upgrade getopts (#34603)
getopts added the `string` option in a recent version, which I didn't realize when I made updates to src/dev/run/run.ts, which rely on this option. To make sure it is available this updates getopts in all projects from `2.x` to `^2.2.4`
2019-04-15 14:39:34 -07:00
Brandon Kobel 80aae6bba8
Feature Controls (#31652)
* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Introducing uiCapabilities, removing config providers & user profile (#25387)

## Summary
Introduces the concept of "UI Capabilities", which allows Kibana applications to declare capabilities via the `uiCapabilities` injected var, and then use them client-side via the `ui/capabilities` module to inform their rendering decisions.

* GAP - Actions Restructured and Extensible (#25347)

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Fixing saved object capability checking

* Beginning to restructure actions to be used for all action building

* Using actions to build ui capabilities

* dropping /read from client-side userprovide ui capabilities

* Adding some actions

* Using different syntax which will hopefully help with allowing apps to
specify the privileges themselves

* Exposing all saved object operations in the capabilities

* Using actions in security's onPostAuth

* Only loading the default index pattern when it's required

* Only using the navlinks for the "ui capabilities"

* Redirecting from the discover application if the user can't access
kibana:discover

* Redirecting from dashboard if they're hidden

* Features register their privileges now

* Introducing a FeaturesPrivilegesBuilder

* REmoving app from the feature definition

* Adding navlink specific ations

* Beginning to break out the serializer

* Exposing privileges from the authorization service

* Restructuring the privilege/resource serialization to support features

* Adding actions unit tests

* Adding features privileges builders tests

* Adding PrivilegeSerializer tests

* Renaming missed usages

* Adding tests for the privileges serializer

* Adding privileges tests

* Adding registerPrivilegesWithCluster tests

* Better tests

* Fixing authorization service tests

* Adding ResourceSerializer tests

* Fixing Privileges tests

* Some PUT role tests

* Fixing read ui/api actions

* Exposing features from xpackMainPlugin

* Adding navlink:* to the "reserved privileges"

* navlink -> navLink | nav_linknavlink -> navLink | nav_linknavlink ->
navLink | nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink | nav_link

* Automatically determining navlink based ui capabilities

* Backing out changes that got left behind

* Using ui actions for navlinks

* Adding TODOs

* Ui -> UI

* Deleting unused file

* Removing api: [] as it's not necessary anymore

* Fixing graph saved object privileges

* Privileges are now async

* Pushing the asycnchronicity to the privileges "service"

* Adding TODO

* Providing initial value for reduce

* adds uiCapabilities to test_entry_template

* Adding config to APM/ML feature privileges

* Commenting out obviously failing test so we can get CI greeenn

* Fixing browser tests

* Goodbyyeee

* Adding app actions to the reserved privileges

* update snapshot

* UI/API changes to facilitate disabling features within spaces (#24235)

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Introducing uiCapabilities, removing config providers & user profile (#25387)

## Summary
Introduces the concept of "UI Capabilities", which allows Kibana applications to declare capabilities via the `uiCapabilities` injected var, and then use them client-side via the `ui/capabilities` module to inform their rendering decisions.

* GAP - Actions Restructured and Extensible (#25347)

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Fixing saved object capability checking

* Beginning to restructure actions to be used for all action building

* Using actions to build ui capabilities

* dropping /read from client-side userprovide ui capabilities

* Adding some actions

* Using different syntax which will hopefully help with allowing apps to
specify the privileges themselves

* Exposing all saved object operations in the capabilities

* Using actions in security's onPostAuth

* Only loading the default index pattern when it's required

* Only using the navlinks for the "ui capabilities"

* Redirecting from the discover application if the user can't access
kibana:discover

* Redirecting from dashboard if they're hidden

* Features register their privileges now

* Introducing a FeaturesPrivilegesBuilder

* REmoving app from the feature definition

* Adding navlink specific ations

* Beginning to break out the serializer

* Exposing privileges from the authorization service

* Restructuring the privilege/resource serialization to support features

* Adding actions unit tests

* Adding features privileges builders tests

* Adding PrivilegeSerializer tests

* Renaming missed usages

* Adding tests for the privileges serializer

* Adding privileges tests

* Adding registerPrivilegesWithCluster tests

* Better tests

* Fixing authorization service tests

* Adding ResourceSerializer tests

* Fixing Privileges tests

* Some PUT role tests

* Fixing read ui/api actions

* Exposing features from xpackMainPlugin

* Adding navlink:* to the "reserved privileges"

* navlink -> navLink | nav_linknavlink -> navLink | nav_linknavlink ->
navLink | nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink | nav_link

* Automatically determining navlink based ui capabilities

* Backing out changes that got left behind

* Using ui actions for navlinks

* Adding TODOs

* Ui -> UI

* Deleting unused file

* Removing api: [] as it's not necessary anymore

* Fixing graph saved object privileges

* Privileges are now async

* Pushing the asycnchronicity to the privileges "service"

* Adding TODO

* Providing initial value for reduce

* adds uiCapabilities to test_entry_template

* Adding config to APM/ML feature privileges

* Commenting out obviously failing test so we can get CI greeenn

* Fixing browser tests

* Goodbyyeee

* Adding app actions to the reserved privileges

* Begin to allow features to be disabled within spaces

typescript fixes

additional cleanup

attempt to resolve build error

fix tests

more ts updates

fix typedefs on manage_spaces_button

more import fixes

test fixes

move user profile into xpack common

Restructure space management screen

fix SASS references

design edits

remove Yes/No language from feature toggles

fix casing

removed unused imports

update snapshot

fix sass reference for collapsible panel

Fix sass reference, take 2

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* extract migration logic into testable unit

* Introducing uiCapabilities, removing config providers & user profile (#25387)

## Summary
Introduces the concept of "UI Capabilities", which allows Kibana applications to declare capabilities via the `uiCapabilities` injected var, and then use them client-side via the `ui/capabilities` module to inform their rendering decisions.

* Design edits (#12)

enables customize avatar popover

update tests, and simplify editing space identifier

remove references to user profile

remove unused test suite

remove unnecessary sass import

removes security's capability_decorator

* fix i18n

* updates toggleUiCapabilities to use new feature definitions

* cleanup and testing

* remove references to old feature interface

* readd lost spacer

* adds feature route testing

* additional i18n

* snapshot update

* copy edits

* fix ml app icon

* add missing export

* remove unnecessary sass import

* attempt to fix build

* fix spaces api tests

* esArchiver mapping updates

* rename toggleUiCapabilities -> toggleUICapabilities

* removes shared collapsible_panel component in favor of plugin-specific components

* some copy and style adjustments

* fix test following rebase

* add lost types file

* design edits

* remove stale export

* feature feedback; fixes cached disabled features

* GAP: Security disables UI capabilities (#25809)

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Fixing saved object capability checking

* Beginning to restructure actions to be used for all action building

* Using actions to build ui capabilities

* dropping /read from client-side userprovide ui capabilities

* Adding some actions

* Using different syntax which will hopefully help with allowing apps to
specify the privileges themselves

* Exposing all saved object operations in the capabilities

* Using actions in security's onPostAuth

* Only loading the default index pattern when it's required

* Only using the navlinks for the "ui capabilities"

* Redirecting from the discover application if the user can't access
kibana:discover

* Redirecting from dashboard if they're hidden

* Features register their privileges now

* Introducing a FeaturesPrivilegesBuilder

* REmoving app from the feature definition

* Adding navlink specific ations

* Beginning to break out the serializer

* Exposing privileges from the authorization service

* Restructuring the privilege/resource serialization to support features

* Adding actions unit tests

* Adding features privileges builders tests

* Adding PrivilegeSerializer tests

* Renaming missed usages

* Adding tests for the privileges serializer

* Adding privileges tests

* Adding registerPrivilegesWithCluster tests

* Better tests

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Fixing authorization service tests

* Adding ResourceSerializer tests

* Fixing Privileges tests

* Some PUT role tests

* Fixing read ui/api actions

* Introducing uiCapabilities, removing config providers & user profile (#25387)

## Summary
Introduces the concept of "UI Capabilities", which allows Kibana applications to declare capabilities via the `uiCapabilities` injected var, and then use them client-side via the `ui/capabilities` module to inform their rendering decisions.

* Exposing features from xpackMainPlugin

* Adding navlink:* to the "reserved privileges"

* navlink -> navLink | nav_linknavlink -> navLink | nav_linknavlink ->
navLink | nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink | nav_link

* Automatically determining navlink based ui capabilities

* Backing out changes that got left behind

* Using ui actions for navlinks

* Adding TODOs

* Ui -> UI

* Deleting unused file

* Removing api: [] as it's not necessary anymore

* Fixing graph saved object privileges

* Privileges are now async

* Pushing the asycnchronicity to the privileges "service"

* Adding TODO

* Providing initial value for reduce

* adds uiCapabilities to test_entry_template

* Adding config to APM/ML feature privileges

* Commenting out obviously failing test so we can get CI greeenn

* Fixing browser tests

* First, very crappy implementation

* Adding tests for disabling ui capabilities

* All being set to false no longer requires a clone

* Using _.mapValues makes this a lot more readable

* Checking those privileges dynamically

* Fixing some broken stuff when i introduced checkPrivilegesDynamically

* Adding conditional plugin tests

* Renaming conditional plugin to optional plugin

* Fixing type errors

* GAP - Actions Restructured and Extensible (#25347)

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Fixing saved object capability checking

* Beginning to restructure actions to be used for all action building

* Using actions to build ui capabilities

* dropping /read from client-side userprovide ui capabilities

* Adding some actions

* Using different syntax which will hopefully help with allowing apps to
specify the privileges themselves

* Exposing all saved object operations in the capabilities

* Using actions in security's onPostAuth

* Only loading the default index pattern when it's required

* Only using the navlinks for the "ui capabilities"

* Redirecting from the discover application if the user can't access
kibana:discover

* Redirecting from dashboard if they're hidden

* Features register their privileges now

* Introducing a FeaturesPrivilegesBuilder

* REmoving app from the feature definition

* Adding navlink specific ations

* Beginning to break out the serializer

* Exposing privileges from the authorization service

* Restructuring the privilege/resource serialization to support features

* Adding actions unit tests

* Adding features privileges builders tests

* Adding PrivilegeSerializer tests

* Renaming missed usages

* Adding tests for the privileges serializer

* Adding privileges tests

* Adding registerPrivilegesWithCluster tests

* Better tests

* Fixing authorization service tests

* Adding ResourceSerializer tests

* Fixing Privileges tests

* Some PUT role tests

* Fixing read ui/api actions

* Exposing features from xpackMainPlugin

* Adding navlink:* to the "reserved privileges"

* navlink -> navLink | nav_linknavlink -> navLink | nav_linknavlink ->
navLink | nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink | nav_link

* Automatically determining navlink based ui capabilities

* Backing out changes that got left behind

* Using ui actions for navlinks

* Adding TODOs

* Ui -> UI

* Deleting unused file

* Removing api: [] as it's not necessary anymore

* Fixing graph saved object privileges

* Privileges are now async

* Pushing the asycnchronicity to the privileges "service"

* Adding TODO

* Providing initial value for reduce

* adds uiCapabilities to test_entry_template

* Adding config to APM/ML feature privileges

* Commenting out obviously failing test so we can get CI greeenn

* Fixing browser tests

* Goodbyyeee

* Adding app actions to the reserved privileges

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Introducing uiCapabilities, removing config providers & user profile (#25387)

## Summary
Introduces the concept of "UI Capabilities", which allows Kibana applications to declare capabilities via the `uiCapabilities` injected var, and then use them client-side via the `ui/capabilities` module to inform their rendering decisions.

* GAP - Actions Restructured and Extensible (#25347)

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Fixing saved object capability checking

* Beginning to restructure actions to be used for all action building

* Using actions to build ui capabilities

* dropping /read from client-side userprovide ui capabilities

* Adding some actions

* Using different syntax which will hopefully help with allowing apps to
specify the privileges themselves

* Exposing all saved object operations in the capabilities

* Using actions in security's onPostAuth

* Only loading the default index pattern when it's required

* Only using the navlinks for the "ui capabilities"

* Redirecting from the discover application if the user can't access
kibana:discover

* Redirecting from dashboard if they're hidden

* Features register their privileges now

* Introducing a FeaturesPrivilegesBuilder

* REmoving app from the feature definition

* Adding navlink specific ations

* Beginning to break out the serializer

* Exposing privileges from the authorization service

* Restructuring the privilege/resource serialization to support features

* Adding actions unit tests

* Adding features privileges builders tests

* Adding PrivilegeSerializer tests

* Renaming missed usages

* Adding tests for the privileges serializer

* Adding privileges tests

* Adding registerPrivilegesWithCluster tests

* Better tests

* Fixing authorization service tests

* Adding ResourceSerializer tests

* Fixing Privileges tests

* Some PUT role tests

* Fixing read ui/api actions

* Exposing features from xpackMainPlugin

* Adding navlink:* to the "reserved privileges"

* navlink -> navLink | nav_linknavlink -> navLink | nav_linknavlink ->
navLink | nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink | nav_link

* Automatically determining navlink based ui capabilities

* Backing out changes that got left behind

* Using ui actions for navlinks

* Adding TODOs

* Ui -> UI

* Deleting unused file

* Removing api: [] as it's not necessary anymore

* Fixing graph saved object privileges

* Privileges are now async

* Pushing the asycnchronicity to the privileges "service"

* Adding TODO

* Providing initial value for reduce

* adds uiCapabilities to test_entry_template

* Adding config to APM/ML feature privileges

* Commenting out obviously failing test so we can get CI greeenn

* Fixing browser tests

* Goodbyyeee

* Adding app actions to the reserved privileges

* Update x-pack/plugins/security/server/lib/authorization/disable_ui_capabilities.ts

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

* Update x-pack/plugins/security/server/lib/authorization/check_privileges_dynamically.ts

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

* Disabling all ui capabilities if route is anonymous

* More typescript

* Even more typescript

* Updating snapshot

* Less any

* More safer

* Another one

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Introducing uiCapabilities, removing config providers & user profile (#25387)

## Summary
Introduces the concept of "UI Capabilities", which allows Kibana applications to declare capabilities via the `uiCapabilities` injected var, and then use them client-side via the `ui/capabilities` module to inform their rendering decisions.

* GAP - Actions Restructured and Extensible (#25347)

* Restructure user profile for granular app privs (#23750)

merging to feature branch for further development

* Fixing saved object capability checking

* Beginning to restructure actions to be used for all action building

* Using actions to build ui capabilities

* dropping /read from client-side userprovide ui capabilities

* Adding some actions

* Using different syntax which will hopefully help with allowing apps to
specify the privileges themselves

* Exposing all saved object operations in the capabilities

* Using actions in security's onPostAuth

* Only loading the default index pattern when it's required

* Only using the navlinks for the "ui capabilities"

* Redirecting from the discover application if the user can't access
kibana:discover

* Redirecting from dashboard if they're hidden

* Features register their privileges now

* Introducing a FeaturesPrivilegesBuilder

* REmoving app from the feature definition

* Adding navlink specific ations

* Beginning to break out the serializer

* Exposing privileges from the authorization service

* Restructuring the privilege/resource serialization to support features

* Adding actions unit tests

* Adding features privileges builders tests

* Adding PrivilegeSerializer tests

* Renaming missed usages

* Adding tests for the privileges serializer

* Adding privileges tests

* Adding registerPrivilegesWithCluster tests

* Better tests

* Fixing authorization service tests

* Adding ResourceSerializer tests

* Fixing Privileges tests

* Some PUT role tests

* Fixing read ui/api actions

* Exposing features from xpackMainPlugin

* Adding navlink:* to the "reserved privileges"

* navlink -> navLink | nav_linknavlink -> navLink | nav_linknavlink ->
navLink | nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink |
nav_linknavlink -> navLink | nav_linknavlink -> navLink | nav_link

* Automatically determining navlink based ui capabilities

* Backing out changes that got left behind

* Using ui actions for navlinks

* Adding TODOs

* Ui -> UI

* Deleting unused file

* Removing api: [] as it's not necessary anymore

* Fixing graph saved object privileges

* Privileges are now async

* Pushing the asycnchronicity to the privileges "service"

* Adding TODO

* Providing initial value for reduce

* adds uiCapabilities to test_entry_template

* Adding config to APM/ML feature privileges

* Commenting out obviously failing test so we can get CI greeenn

* Fixing browser tests

* Goodbyyeee

* Adding app actions to the reserved privileges

* update snapshot

* Update x-pack/plugins/security/server/lib/authorization/check_privileges.ts

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

* Update x-pack/plugins/security/server/lib/authorization/check_privileges.ts

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

* Fixing type errors

* Only disabling navLinks if a feature is registered for them

* Adding non i18n'ed tooltip

* Making metadata and tooltip optional

* i18n'ing tooltips

* Responding to peer review comments

* GAP - Role API Structure (#26740)

* Updated the role api PUT structure

* Minimum is an array now

* Updating get route to naively support the new structure

* Renaming and removing some serialized methods

* Updating Role PUT api tests

* Fixing PUT jest tests

* Fixing GET tests

* Updating PrivilegeSerializer tests

* Renaming features to feature for the GET, so we're consistent

* Validating features and feature privileges

* Update x-pack/plugins/security/server/lib/authorization/privilege_serializer.test.ts

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

* Update x-pack/plugins/security/server/lib/authorization/privilege_serializer.test.ts

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

* Update x-pack/plugins/security/server/lib/authorization/privilege_serializer.test.ts

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

* Renaming some variables/members of the PrivilegesSerializer

* Fixing privileges serializer tests

* Fixing register privileges with cluster tests

* Fixing the role creation for the api integration tests

* Generalizing regex within the feature registry

* update tests

* [GAP] - Support infra features (#26955)

## Summary
This PR adds the `Infrastructure` and `Logs` apps as toggle-able features via Granular Application Privileges.

* [GAP] - Enables xpack_main to populate UI Capabilities (#27031)

## Summary

Currently, plugins that register features via `xpackMainPlugin.registerFeature({...})` also have to specify their own `uiCapabilities` via `injectDefaultVars`, which is counter-intuitive and cumbersome. We've accepted this complexity for OSS plugins, but x-pack and third-party plugins should not have to concern themselves with such implementation details.

This PR removes that requirement for x-pack and third-party plugins, so all they have to do is register features, and ensure that their feature privileges contain the appropriate UI Capabilities in the `ui` property.

### Notes
This implementation intentionally does not alter UI Capabilities that come in via OSS Kibana. The capabilities defined there should be the source of truth, regardless of which distribution is used.


### Example
<pre>
xpackMainPlugin.registerFeature({
  id: 'graph',
  name: 'Graph',
  icon: 'graphApp',
  <b>navLinkId: 'graph',</b>
  privileges: {
    all: {
      app: [],
      savedObject: { ... },
      <b>ui: ['showWriteControls'],</b>
    },
    read: {
      app: [],
      savedObject: { ... },
      <b>ui: ['someOtherCapability],</b>
    }
  }
});
</pre>

Will be translated to the following UI Capabilities:
```
uiCapabilities: {
  navLinks: {
    graph: true
  },
  graph: {
    showWriteControls: true,
    someOtherCapability: true, 
  }
}
```


xpack_main is **not responsible** for disabling UI capabilities, so this will initialize all capabilities with a value of `true`.

* Hide write controls for the visualization application (#26536)

* Hide write controls for the timelion application (#26537)

* blacklist feature ids (#27493)

* [GAP] - Support management links (#27055)

## Summary

This enables management links to be toggled via UI Capabilities.

## TODO
- [x] Implement spaces controls
- [x] Implement security controls
- [x] Testing
- [ ] (optional) - dedicated display for managing management links?

* Enables the feature catalogue registry to be controlled via uiCapabil… (#27945)

* Enables the feature catalogue registry to be controlled via uiCapabilities

* update snapshot

* xpack_main populates uiCapabilities with the full list of catalogue entries

* builds application privileges using catalogue actions

* prevent 'catalogue' from being registered as a feature id

* fix mocha tests

* fix merge

* update snapshots

* GAP - Discover and NavLinks Functional Testing (#27414)

* Adding very basic Discover tests

* Ensuring discover is visible in both spaces

* Parsing the DOM to determine the uiCapabilities

* Making this.wreck `any` because the type definitions suck

* Specifying auth when requesting ui capabilities

* Beginning architecture to support permutation testing

* Adding documentation of the different configurations we'd like to test

* Fixing type errors

* Beginning to work on the framework to test the combinations

* Adding some factories

* Pushing forward, not a huge fan of what I have right now

* The new-new

* Less weird types

* Revising some things after talking with Larry

* Switching from wreck to axios

* Restructuring some files

* Changing to a space with all features, and a space with no features

* Beginning to add the security only tests

* Adding a navLinksBuilder

* Adding spaces only tests

* Not disabling ui capabilities, or authing app/api access when we
shouldn't be

* Can't get rid of management

* Adding more user types

* More users, this is starting to really suck

* Renaming some things...

* Revising which users we'll test in which ui capabilities "test suite"

* Adding some more user scenarios for the security_only configuration

* Adding security_only user scenarios

* Adding space scenarios

* Fixing type errors

* Udpating the readme for the spaces we're testing with

* Adding global read discover security ui functional tests

* Adding tests to make sure save buttons are shown/hidden

The actual implementation is broken somewhere

* Fixing tests after GIS is added and conflicts happened for infra

* Adding discover ui capability tests

* Fixing navlinks tests

* Adding discover view tests

* Adding UI tests for spaces being disabled

* Fixing tests

* Removing wreck dependency, it's garbage

* Fixing typo

* Updating ui capabilities README.md and adding another user for the
security and spaces ui capability tests

* Updating yarn lock file

* Consolidation some types

* Adding VisualizeDisabledSpace to the scenarios.

* Fixing esArchives with .kibana_2

* Disable features optional again

* Adding ensureCurrentUrl: false

* Fixing space selector tests

* Fixing gis privileges, they use saved objects

* Fixing find's element staleness checks

* Update x-pack/test/functional/es_archives/spaces/disabled_features/data.json

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

* Generalizing logic to get appNavLinksText

* Removing duplicate license header

* Adding GIS mappingst

* Fixing readme

* We love our future selfs

* Adding GisRead scenario

* Whoops

* Adding note about funky syntax for use with exhaustive switches

* Using a centralized list of features

* Give it some time

* Even more time?

* Space Management - accessibility & i18n improvements (#28195)

## Summary

1) Improves the accessibility for the spaces management screen:
    - Customize Space Avatar popover now receives focus when toggled
    - Labels are more descriptive, providing context
    - Delete Space modal correctly focuses

2) Improves i18n support
    - fixed a couple hard-coded strings

3) Adds a "Features" column to the spaces grid page, which shows a brief summary of the number of features enabled for each space:

![image](https://user-images.githubusercontent.com/3493255/50785093-93b78280-127d-11e9-975e-7209d35211ff.png)



Related: https://github.com/elastic/kibana/issues/28184

* Feature Controls - spaces - functional tests (#28213)

* adds tests for /api/features/v1 endpoint

* update failing management test

* Fc/run ui capability tests (#28362)

* Running the UI Capability Tests as part of the normal CI runs

* Adding uptime feature to get these tests passing

* Adding features and sorting

* Adding uptime security_only uiCapability tests, and fixing devTools

* Fixing the docs

* Fixing section panel i18n issue

* Removing unused import

* Updating snapshots

* Feature Controls - The new new role API (#28441)

These changes allow us to build the most recent UI where spaces can be "grouped" and edited at once. This changes the kibana section of the role definition to the following:

```
{
  kibana: [
    {
        base: ['read'],
        feature: {
          discover: ['all'],
          dashboard: ['all']
        },
        spaces: ['*']
    },
    {
        base: ['read'],
        feature: {
          discover: ['all'],
          dashboard: ['all']
        },
        spaces: ['marketing', 'sales']
    }
  ]
}
```

If the `spaces` property isn't provided (for example if the user isn't using Spaces) then it'll default to `['*']`. 

There are a few other stipulations that we're implementing with this approach. 

1. Each "item" can be for 1 to many spaces OR globally. We can't specify both space privileges and global privileges in the same "item" because for Spaces we translate `all` to `space_all`, etc. so we can give them different privileges, and this becomes problematic when trying to serialize/deserialize to ES.
2. Additionally, each space can only appear once. The ES model would allow this, but the role management UI becomes more complicated if we were to allow this when calculating effective privileges.

* Feature Controls - Discover Save Button Test #28500 (#28501)

* Adding some debug logs

* Setting ui settings using the functional services

* Doing the same for the spaces disabled features

* Removing console.log debug statements

* Using save instead of showWriteControls

* Reload when adjusting visible features within the users active space (#28409)

## Summary

Changes to the visible features within a space are not visible until the page is refreshed. Because of this, when a user is editing their active space, their changes are not immediately visible.

This updates the space management screen to force a refresh when updating the visible features inside the active space. It also introduces a modal warning that this will happen:

![image](https://user-images.githubusercontent.com/3493255/50923423-ebd7bb80-141a-11e9-92bd-2779020578a4.png)

* Throwing error if we register a feature after getAll is called (#29030)

* Throwing error if we register a feature after getAll is called

* Fixing some tests

* Fixing feature route tests

* Removing unused imports

* Fixing merge conflict

* Feature Controls - Fixing fallout of removing the legacy fallback (#29141)

* Fixing use of mode.useRbacFoRequest to mode.useRbac

* Fixing ui capability tests

* [Feature Controls] - Fix a11y for customize feature section (#29174)

## Summary

Fixes the displayed and announced text for the "show"/"hide" button of the Customize Visible Features section of the spaces management page.

This was inadvertently broken following a merge from master at some point.

* Feature Controls: Fixing k7's new "nav links" (#29198)

* Fixing k7's new applist for feature controls

* Renaming appSwitcher to appsMenu

* Feature Controls - Dashboard (#29139)

* Using addRouteSetupWork to implement the redirect

* Using centralized addSetupWork

* Fixing dashboard functional feature privileges tests

* Ensuring landing page and create dashboard redirect to the home-page

* Adding more tests to ensure the redirects work properly

* Adding disabled space feature tests for Dashboards

* Update src/ui/public/capabilities/route_setup.ts

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

* Update test/functional/page_objects/common_page.js

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

* Fixing ui capability tests after adding createNew

* Removing unnecessary `return undefined`

* requireUICapabilities -> requireUICapability

* Updating dashboard ui capability tests

* Fixing issue with the selection column appearing on Dashboards

* Fixing ui capability dashboard space only tests

* [FC] - Move management and catalogue entries out of privilege definition (#28354)

* Moves catalogue and management entries from privilege defintion to base feature definition

* Update new management menu to respect items disabled via UI Capabilities

* add test

* re-add index pattern entries

* re-add advanced settings icon

* fix tests

* remove management and catalogue entries from read-only users

* bring it back now y'all

* catalogue updates for xpack plugins

* Introduces 'grantWithBaseRead' flag

* update privileges from all -> read where necessary

* rename feature builder functions

* catalogue and management items should cascade to privileges when not specified

* add catalogue entry for uptime app

* Simplify feature registrations using inherited catalogue/management entries

* consolidate and fix privilege building logic

* rename variables

* remove debug code

* remove duplicate lodash import

* Update x-pack/plugins/xpack_main/server/lib/feature_registry/feature_registry.ts

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

* [GAP] - Role Management UI (#26840)

 
![image](https://user-images.githubusercontent.com/3493255/51063094-72310080-15c7-11e9-9274-debf0e9b84f1.png)

![image](https://user-images.githubusercontent.com/3493255/51063108-8aa11b00-15c7-11e9-92fc-31c922086e05.png)


![image](https://user-images.githubusercontent.com/3493255/51063165-cb992f80-15c7-11e9-894d-630c109211d3.png)






---------
Edge-case scenarios:
  1) [x] '*' and spaces in the same "entry"
Handled via `_transform_errors` at the API level. Renders a partial read-only view in the UI.
  2) [x] same space appearing in multiple "entries"
Handled via `_transform_errors` at the API level. Renders a partial read-only view in the UI.
  3) [x] base and feature privileges being set on the same "entry"
UI does not allow this to be set, but UI is smart enough to display the correct effective privilege in this case.
  4) [x] multiple base privileges set in the same "entry"
UI does not allow this to be set, but UI is smart enough to apply the most permissive base privilege when displaying and performing privilege calculations.
  5) [x] multiple feature privileges for the same "entry" (ml_all and ml_read)
UI does not allow for this to be set, but UI is smart enough to apply the most permissive base privilege when displaying and performing privilege calculations.


--------

## Summary
This updates the role management UI to allow application privileges to be customized globally and per-space.

## TODO:
- [x] [First Design review](https://github.com/legrego/kibana/pull/13)
- [ ] Second Design review
- [ ] Copy review
- [x] i18n
- [x] Handle deleted/unknown features
- [x] Handle deleted/unknown spaces
- [x] Cleanup & refactoring
- [x] Testing

* [Feature Controls, Spaces] - Don't load bundles for hidden apps (#29617)

## Summary
This enables the spaces plugin to issue a 404 if the requested application is disabled within the users active space.

To enable this functionality, the `app` property was moved to the root feature level, with the option to override at the privilege level. This follows the same logic as `catalogue` and `management` sections.

This will enable automatic app "protections" for those which only specify a single UI application, including:

1) Timelion
2) Canvas
3) Monitoring
4) APM
5) Code (when it merges)
6) GIS
7) Graph
8) ML

* [Feature Controls] - Copy Edits (#29651)

## Summary
Copy edits from today's session

* [Feature Controls] - Rename-a-thon (#29709)

* post-merge cleanup

* [Feature Controls] - fixes from recent merge from master (#29826)

## Summary

this pr will contain any required changes to fix CI from the recent merge from master, which includes the new k7 redesign design and dark mode

* Feature Controls: Adding privileges tooltip for Dev Tools (#30008)

* Adding privileges tooltip for Dev Tools

* appeasing the linter

* [Feature Controls] - Fix displayed space base privilege (#30133)

## Summary
This fixes the displayed space base privilege when a global base privilege is influencing the dropdown control:

1) Add global 'read' privilege
2) Configure space privilege -- note default base privilege of 'read'
3) Change space base privilege to 'custom'

Prior to this fix, the dropdown would not honor the change; it would keep 'read' as the selected option.

* Feature Controls: Adding read privileges for advanced settings and index patterns (#30106)

* Adding read privileges for advanced settings and index patterns

* Fixing the tests and the actual code itself

* Feature Controls - spaces not a security mechanism warning (#29853)

* Changing copy for the spaces not a security mechanism warning

* Using Gail's wording

* [Feature Controls] - Fixes from merging from master (8.0) (#30267)

* improve typings

* fix xpack_main type definitions

* test updates

* Fc/functional test move (#29835)

* Moving dashboard feature control tests to the dashboard application

* Moving more tests around

* Fixing some tests, no longer using uiSettings service, doesn't play
nicely with spaces

* Fixing esarchived issue

* Renaming some files

* [Feature Controls] - Readonly view for Advanced Settings using UICapabilities (#30243)

## Summary
This builds on the work done in https://github.com/elastic/kibana/pull/30106 to enable a read-only mode for the Advanced Settings screen:

- Input fields are disabled
- Save options are not displayed
- "Reset to default" options are not displayed

* Feature Controls: No Wildcards (#30169)

* A poorly named abstraction enters the room

* No more wildcards, starting to move some stuff around

* Splitting out the feature privilege builders

* Using actions instead of relying on their implementation

* We don't need the saved object types any longer

* Explicitly specifying some actions that used to rely on wildcards

* Fixing api integration test for privileges

* Test fixture plugin which adds the globaltype now specifies a feature

* Unauthorized to find unknown types now

* Adding tests for features with no privileges

* Update x-pack/test/saved_object_api_integration/security_and_spaces/apis/find.ts

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

* Adding back accidentally deleted test

* Using the shared XPackMainPlugin definition

* Fixing privileges

* [Feature Controls] - Readonly mode for Canvas using UICapabilities (#29264)

## Summary

Updates Canvas to respect UICapabilities when determining if a user has read or read/write access to the application:

1) Adds a `showWriteControls` UI Capability to the Canvas's `all` privilege.
2) Removes the `setCanUserWrite` Redux action
3) Sets the initial (and only) state for `state.transient.canUserWrite` based on the UI Capability.

Closes https://github.com/elastic/kibana/issues/27695

* [Feature Controls] - Readonly mode for Maps using UICapabilities (#30437)

## Summary

This updates the maps application to support a read-only mode:

1) Removes selection/delete from Maps listing page
2) Removes "save" option

## TODO:
- [x] Functional UI Tests

* Add typings for x-pack/test to support .html imports (#30570)

We're importing `ui/capabilities` from the x-pack/test project, which
implicitly traverses into typings which are potentially importing .html
files, so we have to teach TypeScript about it.

* [Feature Controls] - Readonly mode for Timelion using UICapabilities (#30128)

## Summary

Updates Timelion to respect UICapabilities when determining if a user has read or read/write access to the application.

A previous PR was responsible for hiding the save controls, but this PR adds testing and the appropriate UICapabilities to the registered privilege definition.

* remove stray debug code

* [Feature Controls] - Updates from src/ui move to src/legacy/ui (#30678)

* dummy commit

* fix import path

* update message identifier

* fix snapshot

* remove unused translations

* Feature Controls: Adding read/write privileges for all applications (#30732)

* Adding read/write privileges for all applications

* Using default for advanced settings, canvas, maps and timelion

* Update x-pack/test/ui_capabilities/security_only/tests/canvas.ts

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

* Update x-pack/test/ui_capabilities/security_only/tests/canvas.ts

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

* Update x-pack/test/ui_capabilities/security_only/tests/maps.ts

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

* Update x-pack/test/ui_capabilities/security_only/tests/maps.ts

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

* Update x-pack/test/ui_capabilities/security_only/tests/timelion.ts

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

* [Feature Controls] - Readonly mode for Visualize using UICapabilities (#29714)

* enable read-only view, and enable app redirection for visualize app

* Hide 'Edit Visualization' dashboard context menu item if visualizations are not editable

* Hide 'Add new visualization' button if action is not available

* show 'Visualize' button on discover view only if viz app is available

* update tests

* allow visualizations to be created, but not saved for read-only users

* adds functional tests for visualize

* add tests for showing/hiding the visualize button in the discover app

* fix visualize tests following merge from master

* tests for edit viz feature from dashboards

* cleanup

* remove unnecessary call to set ui settings

* remove unused variables

* reduce flakyness of tsvb tests

* renames visualize.showWriteControls => visualize.save

* fix ui capability tests

* fix tests

* fix references to timePicker page object

* fix ts errors

* adds 'editable' property to embeddable metadata instead of hardcoded capability checks

* Remove unnecessary read-only considerations

* revert unnecessary mock changes

* [Feature Controls] - Adds missing uptime icon (#30716)

## Summary
Adds missing feature icon for Uptime application.

Needs https://github.com/elastic/kibana/pull/30678 to merge before this will go green.

* Feature Controls - Fix branch (#31135)

* Updating snapshot

* Switching visualize to use the default branch of the switch

* Fixing esarchive

* Feature Controls - Graph (#30762)

* Adding graph functional tests

* Fixing Privilieges API test

* Adding graph ui capability tests

* Update x-pack/test/ui_capabilities/security_only/tests/graph.ts

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

* Update x-pack/test/ui_capabilities/security_only/tests/graph.ts

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

* Update x-pack/test/ui_capabilities/security_and_spaces/tests/graph.ts

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

* Update x-pack/test/ui_capabilities/security_only/tests/graph.ts

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

* Update x-pack/test/ui_capabilities/spaces_only/tests/graph.ts

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

* Apply suggestions from code review

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

* Removing hard-coded constants

* Adding Graph delete button

* Fixing ui capability tests

* [Feature Controls] - Fixes page width for spaces management screen (#30723)

## Summary

Fixes the skinny spaces management screen following the redesign of the overall management area.

Needs https://github.com/elastic/kibana/pull/30678 to merge before this will go green.

* Feature Controls - Dev Tools (#30712)

* Adding functional tests

* Addingn Dev_Tools ui capability tests

* Adding some api tests for console's API

* Apply suggestions from code review

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

* Moving uiCapability definition

* Giving user_1 dashboard access to space_2

* Using the default in the switch for devtools/visualize

* Using forceLogout, maps are leaving us on a 404 page

* Fixing privileges API tests

* Feature Controls- Fix Merge Conflicts (#31651)

* Removing duplicated and outdated tests

* Updating snapshot

* Fixing type script errors

* Getting rid of some double quotes

* Adding saved_object:url access to discover temporarily to fix tests

* Fixing dashboard tests, updating snapshots

* Fixing security only find tests

* Removing reduntant test

* Trying to give it more time

* Fixing it 20 seconds to redirect away from the create new dashboard

* Feature Controls - No more route defaults for dashboards (#31767)

* No more route defaults for dashboards

* Verbose logging...

* Changing some ciGroups to try to narrow down the problem

* Revert "Verbose logging..."

This reverts commit 3198e73b61.

* Revert "No more route defaults for dashboards"

This reverts commit 525cd94dc5.

* Chaning the method in which we do the redirect

* Fixing type issue

* Update index.ts

* Update index.ts

* Feature Controls - Only allowing features to register all and read privileges (#31526)

* Only allowing features to register all and read privileges

* Making all and read optional properties required some existence checks

* Using Aleh's superior solution!

* No more unnecessary `as any`

* Feature Controls - Saved Object Management (#31332)

* Adding savedObject uiCapabilities that mirror the savedobject actions

* Using uiCapabilities to limit which types to search for

* Restricting which saved objects can be deleted based on type

* Hiding "view in app" button when we aren't allowed to

* Filtering the saved objects relationships based on the valid saved
object types

* Using dedicated savedObjectsManagement ui capabilities

* Adding readonly mode of viewing an object

* Displaying View In App if you can actually do so

* No more operations

* Moving saved objects ui capability population to kibana plugin

* Updating x-pack jest tests

* Adding security only saved objects management ui capability tests

* Adding security and spaces tests

* Adding spaces only saved objects managment ui capability tests

* Adding saved object management listing page functional tests

* Adding functional tests for edit visualization

* Consolidating canViewInApp and getInAppUrl into the same file

* Fixing imports

* One more stray import/export

* Adding back esFrom source

* Revert "Adding back esFrom source"

This reverts commit dfb626ace3.

* Updating jest snapshots

* Updating privileges

* Adding some logging

* Back to 10 seconds

* Trying to get more logs...

* Back to normal logging levels

* Fixing ui capability tests

* Putting timeouts back.

* Feature Controls - UI capability API integration tests with fixture plugins (#32086)

* Only testing the foo plugin for security and spaces

* Using the foo plugin with the security_only tests

* Changing spaces only tests to use the foo plugin

* Using list of features from api, and fixing bug with the spaces
interceptor

* Adding catalogue tests, which are alluding to another bug

* saved_objects catalogue aren't driven by ui capabilites presently

* Expanding the coverage for the spaces only catalogue tests

* Fixing some catalogue asserts

* Fixing catalogue tests for spaces_only, I had it backwards

* Adjusting Readme, adding "global read" scenario for security only tests

* Responding to PR feedback

* Adding back saved objects tests I accidentally deleted

* Fixing typescript issues, we can't import EUI on the server

* Fixing eslint error

* Updating Jest snapshots, fixing chrome mock

* Fixing dashboard listing test

* Adding missing await and forcing logout for graph functional tests

* Putting i18n string back

* Fixing type script issue

* Fixing canvas assert because of merge

* Fixing saved object api error assertations

* user-action is now a saved object type

* Fixing typescript error

* Fixing saved object actions as a result of the merge

* Feature Controls - Infrastructure and Logging (#31843)

* hide infra/logs apps if disabled via UICapabilities

* adds tests

* adds UICapability tests for infra and log apps

* update expected privilege/action mapping

* adds feature controls security tests for infraHome

* adds infra spaces feature control tests

* remove debug code

* a sample readonly implementation, ignoring 'logs' privileges

* ts fixes

* fix capability expectations

* Removing RequiresUICapability component, since there are no usages

* Driving the source configuration seperately for logs/infrastructure

* Adding infrastructure feature controls security functional tests

* Adding spaces infrastructure tests

* Adding logs functional tests

* Reworking the ui capability tests to be more consistent

* Fixing privileges API

* Forcing logout

* Fixing comma issue introduced by merge

* Fix merge conflicts and loading/unloading esarchives more consistently

* Removing unnecessary !!

* Fixing saved object management tests

* Fixing more tests

* Using the new context APIs

* Revert "Using the new context APIs"

This reverts commit 4776f1fc86.

* Adding future version of ui capabilities react provider

* Switching the order of the HOC's for infra and making the future the
default

* Applying Felix's PR feedback

* Protecting Infra's GraphQL APIs

* Updating privileges list

* Using the introspection query

* No longer using apollo context library, rephrasing test descriptions

* Fixing issue introduced by merge conflict, I forgot a }

* Putting back missplaced data test subj

* Updating jest snapshots

* Feature Controls - Short URLs (#32418)

* Discover is showing creating short urls properly

* Adding Discover functional tests

* When dashboards show the share menu you can always create short urls

* Visualize now displays the short urls link appropriately

* Dashboard all gets access to saved objects and updating privileges api
test

* Updating and adding short url test to url panel content

* Fixing misspelling

* Updating jest snapshot

* Adding comment why allowShortUrl is always true for Dashboards

* Updating snapshots

* Fixing snapshots, mocking chrome.getInjected

* Feature Controls - Uptime (#32577)

* Adding uptime functional tests

* Enabling feature controls for uptime

* Updating the privileges API's actions

* Using a single access tag for limiting API access

* Revising the behavior of maps read-only mode (#33338)

* Feature Controls - APIs (#32915)

* Using HapiJS's scopes to perform authorization on api endpoints

* Revert "Using HapiJS's scopes to perform authorization on api endpoints"

This reverts commit f73810c22d.

* Switching the syntax of the api tags

* Fixing privileges API

* Typescriptifying some dependencies of the api authorization extensions

* Using dedicated typescript file for api post auth filtering

* Adding tests and restructuring the flow of the api authorization

* Adjusting uptime's usage of privileges and the privileges test

* Integrating PR feedback

* Fixing graph test subject, thanks Joe!

* Consolidating hideWriteControls dashboard listing test

* Reusing maps constants

* Adding type to saved object management ui capability tests

* Feature Controls - Index Pattern Management (#33314)

* Enabling feature controls for index patterns

* Updating privileges API tests

* Fixing saved object management's view index patterns in app logic

* Fixing forgotten canViewInApp tests

* Fixing maps spaces functional tests

* Feature Controls - Differentiating the privileges with the same actions (#32266)

* Differentiating the privileges with the same actions

* The types for the lodash.uniqwith packare aren't right, and we need to
customize the isEqual also, so we're gonna do it ourselves

* Fixing dev tools ui capability

* Removing are equivalent privileges prevention, it's not what we really
need

* Requiring all to be more permissive than read on startup

* Transparently differentiating "all" from "read" feature privileges

* Fixing jest tests

* Adding the allHack: action to the space and global base privileges

* Changing actions to be readonly

* Adding JSDoc's for the Actions class and specifically the `allHack`
action

* Making the import of xpack_main types consistent

* Feature Controls: APM (#32812)

* Adding APM read privilege and adding functional UI tests

* Beginning to validate the APM routes are protected properly

* Protecting APM's APIs

* Specifying CI group

* Fixing privileges

* Adding forgotten apm show ui capability

* Fixing apm's privileges

* Fixing merge-conflict with privileges allHack: and APM

* address canvas feedback (#34269)

* [Feature Controls] - Plugin postInit (#29172)

## Summary

Throwing this up as a straw ~man~ person. If we like it, I can split it out and point the OSS changes against master if we'd prefer.

Introduces a `postInit` plugin hook that is called after all plugins have gone through their `preInit` and `init` phases, which allows the security plugin to call `registerPrivilegesWithCluster` after all plugins have had an opportunity to register their features.

* Feature Controls - Adds bulk toggle for showing/hiding features within a space (#34288)

## Summary

Adds a "Change all" option to the spaces management screen to allow all features to be shown/hidden:

![image](https://user-images.githubusercontent.com/3493255/55344105-85db5d00-547a-11e9-9325-136d1c13f40e.png)


Closes #34184

* Feature Controls - Unregistered Applications Authorization (#34122)

* Converting the app authorization to use typescript

* Adding jest tests

* Only authorizing app routes that are registered for features

* Using ProtectedApplications to lazily get feature applications

* Removing unneeded mocked headers as part of the authorization

* Adding some logging for the app authorization

* Fixing imports, thanks tslint --fix!

* Updating snapshots

* Feature Controls - Disable privilege form until spaces are selected (#34386)

## Summary
This disables the privilege selection until one or more spaces are selected in the role management form:

![image](https://user-images.githubusercontent.com/3493255/55432524-1724ff00-5561-11e9-86f6-1589ba3fa701.png)

* Feature Controls - Visualize read-only create new (#34209)

* Allowing users to create new visualizations, even if they can't be saved

* Fixing privileges and tests

* Updating snapshot

* Removing visualize edit ui capability

* Feature Controls - Actions Version Prefix (#34405)

* Prefixing actions with version

* Updating privileges api integration test

* Update x-pack/plugins/security/server/lib/authorization/actions/saved_object.ts

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

* Requiring version to be a not empty string

* Updating jest snapshots

* Changing the 403 messages for the saved object client

* Fixing ui/chrome mock

* Feature Controls - Displaying share menu on dashboards when in read-only mode (#34207)

* Displaying share menu on dashboards when in read-only mode

* Fixing test description, thanks Luke!

* Fixing dashboard view mode tests because the share menu is now visible

* migrate from tslint to eslint

* Feature Controls - Reserved Role Apps (#30525)

* Removing feature privileges from ml/monitoring/apm

* Adding monitoring/ml/apm as hard-coded global privileges

* A poorly named abstraction enters the room

* No more wildcards, starting to move some stuff around

* Splitting out the feature privilege builders

* Using actions instead of relying on their implementation

* We don't need the saved object types any longer

* Explicitly specifying some actions that used to rely on wildcards

* Fixing api integration test for privileges

* Test fixture plugin which adds the globaltype now specifies a feature

* Unauthorized to find unknown types now

* Adding reserved privileges tests

* Adding reserved privileges in a designated reserved bucket

* Fixing ui capability tests

* Adding spaces api tests for apm/ml/monitoring users

* Adding more roles to the security only ui capability tests

* You can put a role with reserved privileges using the API

* Adding support to get roles with _reserved privileges

* Adding APM functional tests

* Adding monitoring functional tests

* Fixing typo

* Ensuring apm_user, monitoring_user alone don't authorize you

* Adding ml functional tests

* Fixing test

* Fixing some type errors

* Updating snapshots

* Fixing privileges tests

* Trying to force this to run from source

* Fixing TS errors

* Being a less noisy neighbor

* Forcing logout for apm/dashboard feature controls security tests

* Fixing the security only ui capability tests

* Removing test that monitoring now tests itself

* Fixing some ui capability tests

* Cleaning up the error page services

* Fixing misspelling in comment

* Using forceLogout for monitoring

* Removing code that never should have been there, sorry Larry

* Less leniency with the get roles

* Barely alphabetical for a bit

* Apply suggestions from code review

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

* Removing errant timeout

* No more hard coded esFrom source

* More nits

* Adding back esFrom source

* APM no longer uses reserved privileges, reserved privileges are
pluggable

* Fixing typescript errors

* Fixing ui capability test themselves

* Displaying reserved privileges for the space aware and simple forms

* Removing ability to PUT roles with _reserved privileges.
Removing ability to GET roles that have entries with both reserved and
feature/base privileges.

* Updating jest snapshots

* Changing the interface for a feature to register a reserved privilege to
include a description as well

* Displaying features with reserved privileges in the feature table

* Adjusting the reserved role privileges unit tests

* Changing usages of expect.js to @kbn/expect

* Changing the CalculatedPrivilege's _reserved property to reserved

* Allowing reserved privileges to be assigned at kibana-*

* Updating forgotten snapshot

* Validating reserved privileges

* Updating imports

* Removing --esFrom flag, we don't need it anymore

* Switching from tslint's ignore to eslint's ignore

* Feature Controls - Adds feature registration to plugin generator (#34537)

## Summary

This updates the plugin generator to allow plugin authors to automatically register their feature with the Feature Registry, for control via Spaces/Security.

Running:
```
elastic-mbp:kibana larry$ node scripts/generate_plugin.js test-plugin
? Provide a short description An awesome Kibana plugin
? What Kibana version are you targeting? master
? Should an app component be generated? Yes
? Should translation files be generated? Yes
? Should a hack component be generated? Yes
? Should a server API be generated? Yes
? Should SCSS be used? Yes
```

Generates the following:
```js
import { resolve } from 'path';
import { existsSync } from 'fs';


import { i18n } from '@kbn/i18n';

import exampleRoute from './server/routes/example';

export default function (kibana) {
  return new kibana.Plugin({
    require: ['elasticsearch'],
    name: 'test_plugin',
    uiExports: {
      app: {
        title: 'Test Plugin',
        description: 'An awesome Kibana plugin',
        main: 'plugins/test_plugin/app',
      },
      hacks: [
        'plugins/test_plugin/hack'
      ],
      styleSheetPaths: [resolve(__dirname, 'public/app.scss'), resolve(__dirname, 'public/app.css')].find(p => existsSync(p)),
    },

    config(Joi) {
      return Joi.object({
        enabled: Joi.boolean().default(true),
      }).default();
    },

    init(server, options) { // eslint-disable-line no-unused-vars
        const xpackMainPlugin = server.plugins.xpack_main;
        if (xpackMainPlugin) {
          const featureId = 'test_plugin';

          xpackMainPlugin.registerFeature({
            id: featureId,
            name: i18n.translate('testPlugin.featureRegistry.featureName', {
              defaultMessage: 'test-plugin',
            }),
            navLinkId: featureId,
            icon: 'discoverApp',
            app: [featureId, 'kibana'],
            catalogue: [],
            privileges: {
              all: {
                api: [],
                savedObject: {
                  all: [],
                  read: ['config'],
                },
                ui: ['show'],
              },
              read: {
                api: [],
                savedObject: {
                  all: [],
                  read: ['config'],
                },
                ui: ['show'],
              },
            },
          });
        }
      // Add server routes and initialize the plugin here
      exampleRoute(server);
    }
  });
}

```

* Updating core system docs

* Fixing infra's dates with data for the functional tests

* [Feature Controls] - Move UICapabilities to the new platform (#30585)

## Summary

This moves the UI Capabilities service into the new platform, shimming into the old platform in a way that is consistent with the `i18n` service.

* Fixing uptime functional api tests

* Removing .only...
2019-04-12 09:16:13 -07:00
Tiago Costa ed795d28ee
Migrate from tslint (#33826)
* chore(NA): remove tslint dependencies, configs and enable eslint typescript parser.

* fix(NA): apply recommend eslint typescript rule.s

* chore(NA): upgrade eslint package versions.

* chore(NA): split javascript eslint config in an override section.

* chore(NA): split all eslint configs with overrides.

* chore(NA): remove missing console.log.

* chore(NA): change eslint splits and overrides order.

* chore(NA): replace tslint disable comments with eslint ones.

* chore(NA): solve eslint typescript errors for elastic/kibana-custom/no-default-export

* chore(NA): fixed multiple eslint typescript rule failures.

* chore(NA): add tarfet folder to the eslint ignore.

* chore(NA): apply prettier rule to ts type file.

* chore(NA): remove last mentions to tslint

* chore(NA): add old defined rules

* chore(NA): missing port rules website

* chore(na): ordered rules

* chore(NA): solved eslint typescript problems.

* chore(NA): fix spaced comment problems.

* chore(NA): fix some more eslint typescript rules: import/order no-empty-interface

* chore(NA): fix last rules and comment out what are the ones still failing.

* chore(NA): comment out camelcase rule.

* chore(NA): regenerate kbn pm dist.

* chore(NA): updated snapshots.

* chore(NA): updated snapshots.

* chore(NA): disabled sort-keys rule.

* chore(NA): remove rule prefer-arrow/prefer-arrow-functions.

* chore(NA): fix for @typescript-eslint/no-var-requires rule.

* chore(NA): fixes for @typescript-eslint/camelcase rule.

* chore(NA): fix typo on eslint config kibana typescript.

Co-Authored-By: mistic <tiagoffcc@hotmail.com>

* chore(NA): remove legacy note after the intellij upgrade to 2019.1

* fix(NA): import order plugin.

* chore(NA): fix ts ignore positions after auto fix.

* fix(NA): performance issue with typescript eslint.

* refact(NA): eslint configs organization.

* chore(NA): apply resticted paths to ts files too.

* chore(NA): split comment from eslint ignore.
2019-04-05 17:45:23 +01:00
Spencer 93b2fca25d
[plugin-generator] choose between .scss and .css file at startup (#34134) 2019-04-01 12:04:15 -07:00
Spencer 8be6c3415f
fix path to @kbn/expect (#34114) 2019-03-28 14:31:08 -07:00
Rashid Khan 7676f03bca
Fix plugin generator paths (#33728) 2019-03-26 15:41:25 -07:00
Tiago Costa 20bdf7d4a9
Migration to Babel7 and @babel/preset-typescript (#33093)
* chore(NA): first changes on every package.json order to support new babel 7. chore(NA): build for kbn-pm with babel 7.

* chore(NA): patch babel register to load typescrit

* chore(NA): first working version with babel 7 replacing typescript compiler.

* fix(NA): common preset declaration in order to make it work with babel-loader.

* chore(na): organizing babel preset env package json.

* chore(NA): mocha tests enabled.

* fix(NA): typo on importing

* test(NA): majority of x-pack tests ported to use babel-jest

* fix(NA): report info button test with babel-jest.

* fix(NA): polling service tests.

* test(na): fix server plugins plugin tests.

* test(NA): batch of test fixs for jest tests under babel-jest hoisting.

* chore(NA): add babel plugin to hoist mock prefixed vars on jest tests.

* chore(NA): update yarn.lock file.

* chore(NA): tests passing.

* chore(NA): remove wrong dep

* chore(NA): fix tsconfig

* chore(NA): skip babel for ts-jest.

* chore(NA): selectively apply the plugin to strip off namespace from ts files.

* chore(NA): remove not needed changes from ts tests

* chore(NA): removed ts-jest dependency. chore(NA): migrate ts tests on x-pack to use babel-jest with the new pattern.

* chore(NA): migrate kibana default distribution typescript tests to run with babel-jest and the new test mock pattern.

* chore(NA): merge and solve conflicts with master.

* chore(NA): fix problems reported by eslint

* chore(NA): fix license ovveride for babel-plugin-mock-imports

* chore(NA): update jest integration tests for kbn pm

* chore(NA): update babel jest integration tests for kbn pm.

* test(NA): update jest integration snapshot for kbn pm.

* chore(NA): apply changes according to the pull request reviews.

* chore(NA): apply changes according to the pull request reviews.

* refact(NA): migrate jest tests to the new pattern.

* fix(NA): babel 7 polyfill in the tests bundle.

* chore(NA): restore needed step in order to compile x-pack with typescript.

* chore(NA): change build to compile typescript with babel for the oss code. chore(NA): change transpile typescript task to only transpile types for x-pack. refact(NA): common preset for babel 7

* Revert "chore(NA): change build to compile typescript with babel for the oss code. chore(NA): change transpile typescript task to only transpile types for x-pack. refact(NA): common preset for babel 7"

This reverts commit 2707d538f5.

* fix(NA): import paths for tabConfigConst

* chore(NA): fix transpiling error on browser tests

* chore(NA): simplify kbn babel preset package.

* chore(NA): migrate build to use babel transpiler for typescript excluding xpack.

* fix(NA): introduced error on test quick task.

* fix(NA): fix preset for client side code on build.

* fix(NA): build with babel

* fix(NA): negated patterns in the end.

* fix(NA): kbn_tp_sample_panel_action creation.

* fix(NA): babel typescript transform plugin workaround when exporting interface name.

* refact(NA): remove not needed type cast to any on jest test.

* docs(NA): add developement documentation about jest mocks test pattern.

* chore(NA): missing unmerged path.

* chore(NA): fix jest tests for template.

* [CCR] Client integration tests (table lists) (#33525)

* Force user to re-authenticate if token refresh fails with `400` status code. (#33774)

* Improve performance of the Logstash Pipeline Viewer (#33793)

Resolves #27513.

_This PR is a combination of #31293 (the code changes) + #33570 (test updates). These two PRs were individually reviewed and merged into a feature branch. This combo PR here simply sets up the merge from the feature branch to `master`._

Summary of changes, taken from #31293:

## Before this PR
The Logstash Pipeline Viewer UI would make a single Kibana API call to fetch all the information necessary to render the Logstash pipeline. This included information necessary to render the detail drawer that opens up when a user clicks on an individual vertex in the pipeline.

Naturally, this single API call fetched _a lot_ of data, not just from the Kibana server but also, in turn, from Elasticsearch as well. The "pro" of this approach was that the user would see instantaneous results if they clicked on a vertex in a pipeline and opened the detail drawer for that vertex. The "cons" were the amount of computation Elasticsearch had to perform and the amount of data being transferred over the wire between Elasticsearch and the Kibana server as well as between the Kibana server and the browser.

## With this PR
This PR makes the Kibana API call to fetch data necessary for **initially** rendering the pipeline — that is, with the detail drawer closed — much lighter. When the user clicks on a vertex in a pipeline, a second API call is then made to fetch data necessary for the detail drawer.

## Gains, by the numbers

Based on a simple, 1-input, 1-filter, and 1-output pipeline.

* Before this PR, the Elasticsearch `logstash_stats` API responses (multiple calls were made using the `composite` aggregation over the `date_histogram` aggregation) generated a total of 1228 aggregation buckets (before any `filter_path`s were applied but across all `composite` "pages"). With this PR, the single `logstash_stats` API response (note that this is just for the initial rendering of the pipeline, with the detail drawer closed) generated 12 buckets (also before any `filter_path`s were applied). That's a **99.02% reduction** in number of buckets.

* Before this PR, the Elasticsearch `logstash_stats` API responses added up to 70319 bytes. With this PR, the single `logstash_stats` API response for the same pipeline is 746 bytes. That's a **98.93% reduction** in size.

* Before this PR, the Elasticsearch `logstash_state` API response was 7718 bytes. With this PR, the API response for the same pipeline is 2328 bytes. That's a **69.83% reduction** in size.

* Before this PR the Kibana API response was 51777 bytes. With this PR, the API response for the same pipeline is 2567 bytes (again, note that this is just for the initial rendering of the pipeline, with the detail drawer closed). That's a **95.04% reduction** in size.

* [Maps] split settings into layer and source panels (#33788)

* [Maps] split settings into layer and source panels

* fix SCSS import

* [env] exit if starting as root (#21563)

* [env] exit if starting as root

* fix windows

* s/--allow-root

* Typescript sample panel action (#33602)

* Typescript sample panel action

* Update EUI version to match main cabana version

* update yarn.lock

* add back typings include

* use correct relative path

* Home page "recent links" should communicate saved object type #21896 (#33694)

* adds object type for screen order
* adds object type for pointer hovering
* Update src/legacy/ui/public/chrome/directives/header_global_nav/components/header.tsx

Co-Authored-By: rockfield <philipp.b@ya.ru>
2019-03-26 20:44:03 +00:00
Spencer 2e232c2e31
[@kbn/expect] "fork" expect.js into repo (#33761)
* [@kbn/expect] "fork" expect.js into repo

* [eslint] autofix references to expect.js

* [tslint] autofix all expect.js imports

* now that expect.js is in strict mode, avoid reassigning fn.length
2019-03-25 09:56:48 -07:00
Eli Perelman 78cbe42982
Prefer third-party plugin development in ./plugins instead of ../kibana-extra (#31748)
* Prefer third-party plugin development in plugins instead of kibana-extra

* Fix failing recursive directory creation and removal

* Add new built version of kbn-pm
2019-03-07 17:04:29 -06:00
Spencer b411925bba
Fix plugin-helpers test:server task (#31034)
* [plugin-helpers/testServer] use scripts/mocha

* [yarn] sync eslint-plugin-jest with kibana while I'm here
2019-02-13 22:47:26 -08:00
Caroline Horn b1b941dd8f
Finally remove leftover LESS files (#29486)
* Use mixin for full screen graphics

- Moved svg assets to one folder under `ui/public/assets/images`
- Deleted .less files

* Fix Kibana logos as well

* forgot to remove

* adds dark mode images

* Removed search_select

In favor of pattern to be created in EUI : https://github.com/elastic/eui/issues/1498

* No LESS in plugin generator

* remove comment

* Remove .less from testbed

* snaps

* Update dark mode graphics to be a bit lighter

* [karma] load css via url, rather than webpack

* [karma] css isn't built at config time, concat at request time
2019-02-01 01:35:25 -05:00
Larry Gregory 22ba11eb52
Prevents dynamic import/require statements (#27515)
## Summary

This PR enables the `import/no-dynamic-require` eslint rule, which requires that all require/import statements be statically defined.

This mitigates certain attack vectors, such as those which enabled [`ESA-2018-18`](https://www.elastic.co/community/security)/[`CVE-2018-17246`](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-17246)
2018-12-21 11:15:20 -05:00
Leanid Shutau 973fad3b0a
[I18n] Add include option to i18n_check for 3rd party plugins (#26963)
* [I18n] Add include/exclude options to i18n_check tool for 3rd-party plugins

* Implement a better solution

* Update .i18nrc.json template

* Resolve comment

* Add conditional ejs expressions for i18n in plugin generator

* Hide package.json from Jest

* Complete template translation

* Resolve comments
2018-12-21 12:55:45 +03:00
Jonathan Budzenski b5b64f4706
Support for multiple Elasticsearch nodes and sniffing (#21928)
* Node sniffing

* update monitoring

* cleaning

* remove tests

* rewrite tests using the proxy

* fix monitoring mocha tests

* fix payload

* return full error

* default interval false

* add sniff settings to monitoring

* add docs for sniff settings

* re-add index search integration test

* catch parse error

* capital

* fix merge

* hapi upgrade

* return

* pass by prefix

* rm empty test fille

* split error handling

* fix merge

* update recent elasticsearch.url references

* prettier vs eslint

* transport.request, include query params

* mega comment

* revert elasticsearchUrl

* safe hosts

* more docs es.url references

* remove unused ml/esServerUrl

* log if both set
2018-12-18 13:22:43 -06:00
Tiago Costa 45a67701f2
Upgrade to NodeJS 10 (#25157)
* feat(NA): upgrade node js version on file configs.

* chore(NA): migrate configs and 3rd party dependencies to work on node js 10.x

* fix(NA): add missing async function declaration.

* chore(NA): updated elastic/good package to work with node10

* chore(NA): update lockfiles.

* fix(NA): add missing dep.

* fix(NA): types for node 10.

* test(NA): fix error return type for node10.

* fix(NA): kbn-pm webpack config to unlazy a require using lazy-cache. fix(NA): build to work with node 10.

* test(NA): jest integration test for kbn-pluin-helpers.

* test(NA): fix jest tests for kbn-es.

* fix(NA): use ostmpdir instead of a tmp folder inside the fixtures.

* fix(NA): change afterEach on kbn es decompress test.

* fix(NA): change afterEach on kbn es decompress test.

* fix(NA): readd mock-fs for the tests that still use it on kbn-es and that works on node10.

* fix(NA): readd mock-fs for the tests that still use it on kbn-es and that works on node10.

* refact(NA): rewrite tests using mock-fs and completely remove this dependency.

* fix(NA): failing test implementation using jest mock in order to replace mock-fs.

* fix(NA): update jest snapshots to match new ones generated one node 10.

* fix(NA): cli/cluster mock to spyOn off method instead off spyOn removeListener as this was changed on Node 10.

* fix(NA): tests for cluster_manager to also spyOn off and on instead of addListener and removeListener

* test(NA): fix management advance settings image field test flow.

* fix(NA): apply missing types for src/core/server/plugins/discovery/plugins_discovery.ts.

* test(NA): updated 2 missing snapshots for KuiCodeEditor on kbn-ui-framework.

* refact(NA): fix eslint errors.

* refact(NA): fix ts code with tslint fix. chore(NA): update jest snapshots.

* chore(NA): migrate kbn config schema peer dependency to last used joi version to avoid warning on bootstrap.

* fix(NA): tslint errors.

* chore(NA): upgrade types node to the last version.

* fix(NA): missing utf8 input format encoding when reading a file.

* chore(NA): upgrade to node 10.14.1

* fix(NA): Buffer api usage to avoid deprecation warnings.
2018-12-10 17:41:51 +00:00
Spencer 707a0359c8
[kbn-plugin-generator] add eslint-plugin-jsx-a11y to plugin devDeps (#25606)
* [kbn-plugin-generator] add eslint-plugin-jsx-a11y to plugin devDeps, specify react version in config

* [eslint/react] use semver package to coerce version range

* fix semicolons
2018-11-15 15:40:01 -08:00
Spencer 583e5ae228
[kbn-plugin-generator] gitignore app.css if scss used (#25609)
When generating a plugin with the plugin generator and scss is in use, we should add the generated `app.css` file to the .gitignore file.
2018-11-13 13:01:32 -08:00
Spencer cd5f31bfec
[kbn-plugin-generator] add reference to es script in Kibana (#25607) 2018-11-13 12:10:20 -08:00
Josh Dover 77522a7bd2
[kbn-pm] Use yarn workspaces for dependencies (#24095) 2018-11-12 12:38:11 -06:00
Josh Dover 27e5406d7a
Upgrade Hapi in legacy platform to v17 (#21707)
* Disable even-better monitoring

* Upgrade to Hapi v15

* Upgrade to Hapi v16

* Handle optional req params correctly

* Update http and kbnServer

* Get mocha tests passing

* Convert `reply` usages [wip]

* Fix Joi and Plugin incompatibilities

* Get server up and running

* Get basic logging working

* Fix optimizer

* Fix recent route handlers

* Various fixes

* Fix recent routes

* Upgrade wreck for async/await

* Fix mocha tests

* Fix joi issues

* Fix xpack jest tests

* Fix recent routes

* Fix tests

* Fix index setup

* Decouple monitoring stats collection from good plugin

* Update reload logging test to work

* Reimplement logging with updated good plugin

* Fix unit tests

* Fix getConnections back

* Make LegacyLoggingServer compatible with Hapi v17

* Update joi types

* Fix x-pack unit tests

* Remove stray debugger

* Remove hapi-compat

* Fix API integrations

* Upgrade boom

* Fix security plugin

* Misc fixes

* bump

* Fix licensePreRoutingFactory

* Fix failing integration tests

* Remove unnecessary test change

* Remove hapi-latest package

* fx

* Various cleanup

* Fix race condition in oppsy events

* Use elastic/good fork

* Fix boom.wrap and hapi-latest changes

* Simplify LegacyLoggingServer updates

* package.json cleanup + test fix

* yarn.lock cleanup

* Change good tag

* Fixes

* Change return err -> throw err in routes

* Fix await returns

* Fix new load_data test

* Make cookie security flags consistent

* tmp doc

* Fix types

* Fix tests

* Upgrade canvas plugin

* Move good package to published @elastic/good one

* Fix SO test

* Fix logging reloading

* Update APM apis

* Fix error logging

* Fix logging test

* Convert spaces plugin

* Add validation error shim

* Remove 7.0 release notes

* Await renderApp

* Fix ccr routes

* Prevent header popovers from scrolling with page content (#23850)

* Fix spaces test

* new yarn.lock-s

* Fix spaces tests

* Remove h2o2-latest

* Fix @types/hapi

* Upgrade InfraOps plugin

* Fix package.json

* Add back isSameSite: false

* Upgrade beats_management plugin

* Update snapshot

* Fix InfraOps

* Upgrade kql_telemetry

* Merge upstream/master

* Upgrade apm and ml

* Put snapshot test back

* Fx beats

* Upgrade rollups

* Update boom usages in new plugins
2018-10-25 16:01:12 -05:00
Spencer d22bdfec46
[yarn] Upgrade to 1.10.1 (#23971)
* [yarn] upgrade required version

* [yarn] update lock files to include integrity

* [yarn] coalesce locked readable-stream versions to avoid yarn bug
2018-10-15 14:34:30 -07:00
Josh Dover b778d53e9e
Fix plugin generator when using hacks and SCSS [ci skip] (#23579) 2018-09-27 12:08:37 -05:00
Aleh Zasypkin 73f955db19
Upgrade eslint/tslint/prettier plugin versions. (#23470) 2018-09-27 11:54:09 +02:00
Maryia Lapata 110c987c89 Update versions of @babel/parser and @babel/types (#23268)
Update versions of @babel/parser, @babel/types, eslint, babel-eslint
2018-09-25 14:35:31 +03:00
Tyler Smalley 0e5fd324b1
Moves styleSheetPath to uiExports (#23007)
This was previously defined in uiExports.app, which limited plugins which are not an app of providing a stylesheet. This allows any plugin to define a stylesheet which will be available on page load.
2018-09-20 19:01:06 -07:00
Spencer 7e94eccc2e
Upgrade to Jest 23.5.0 (#22791)
I'd really like to upgrade to Typescript 3 for its `unknown` type, but we need to upgrade to `jest@23` to support a recent version of `ts-jest@23`. 

The [jest changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md) breaks down the breaking changes in 23.x, but I found it to be slightly incomplete so I've broken down the changes that actually caused breaks for us here, and addressed each in individual commits to make review a little easier:

- the `testURL` config default was changed from `about:blank` to `http://localhost`
    - this cause some XHR requests powered by JSdom to start failing. It seems these requests just do nothing in master but start to fail when JSdom is initialized with an actual URL... I think we would ideally stop sending meaningless XHR requests in the tests, but it was a lot easier to just set the config to `about:blank` for now, and we can worry about cleanup later if necessary
- `expect(...).toThrow()` only passes if an actual error was thrown.
     - In two places in the index pattern code we were throwing strings, which broke the assertions. Fortunately/Unfortunately the errors are not being consumed by anything, so I was able to wrap them in `new Error()` without causing any issues.
- snapshots of mock functions now include a `results` array, detailing the return values of the function
- React fragments are now serialized as `<React.Fragment>` instead of `<UNDEFINED>`
- undefined props in React components are now stripped from snapshots
- minor changes to the ordering of mocks, imports resolution, and before hooks caused the uiSettings API tests to start breaking, but I'm replacing them with totally new tests in #22694 so I just deleted them here
- mocks created with `jest.spyOn()` that are restored now have their `mock.calls` reset, so some of the kbn-pm tests stated failing. This was fixed by restoring them with `jest.restoreAllMocks()` rather than trying to do it before the assertions
2018-09-07 18:36:13 -07:00
Stacey Gammon e90f652875
Bump eui (#20774)
* bump eui

* Fixed breaking `EuiPage` changes

Mainly adding `EuiPageBody`’s where there were none

* bump to 3.0, remove duplicate declaration of EuiFlyoutBody, update jest snapshots

* bump eui

* bump to 3.0, remove duplicate declaration of EuiFlyoutBody, update jest snapshots

* Update jest snapshots in xpack
2018-07-17 19:28:07 -04:00
Hanqing Zhao 17eebb9ba3 [kbn-plugin-generator] Fix plugin naming inconsistency (#20808)
<!--
Thank you for your interest in and contributing to Kibana! There
are a few simple things to check before submitting your pull request
that can help with the review process. You should delete these items
from your submission, but they are here to help bring them to your
attention.

- Have you signed the [contributor license agreement](https://www.elastic.co/contributor-agreement)?
- Have you followed the [contributor guidelines](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md)?
- If submitting code, have you included unit tests that cover the changes?
- If submitting code, have you tested and built your code locally prior to submission with `yarn test && yarn build`?
- If submitting code, is your pull request against master? Unless there is a good reason otherwise, we prefer pull requests against master and will backport as needed.
-->
Make relevant generated files use snakeCase instead of kebabCase
Closes #20524
2018-07-17 12:01:52 -07:00
Tiago Costa b142f80d7d
Match chalk dependency version on kibana with the one used on x-pack (#20621)
* chore(NA): match chalk dependency version on kibana with x-pack to ^2.3.2.

* chore(NA): bump chalk version dependencies and update lock files.
2018-07-13 00:26:57 +01:00
Marco Vettorello 6ef8f6355e
[kbn-plugin-generator] Fix eslint dependencies and template code linting (#20517)
* Add missing peer dependency and upgraded to new import resolver kibana

* Fixed template code to follow eslint rules

* Fix lint script to lint all files in the generated dir

* More precise slurp :p
2018-07-10 12:33:50 +02:00
Tim Roes cb5ee01c6a
Increase prettier line width to 100 (#20535)
* Increase prettier line width to 100

* Fix packages JS prettier

* Change style guide to 100 width

* Fix line-width in latest master changes
2018-07-09 22:50:37 +02:00
Tyler Smalley 699fb251eb
Adds SCSS support for plugins (#19643)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2018-06-21 16:25:29 -07:00
Spencer f0cc432faf
Apache 2.0 license headers (#19383)
In order to make the license that applies to each file as clear as possible, and to be consistent with elasticsearch, we are adding Apache 2.0 license headers to the top of each file.

Existence of this header is enforced by eslint and tslint and missing headers were automatically added in the last commit by running:

```
node scripts/eslint --fix && node scripts/tslint --fix
```
2018-05-28 20:06:30 -07:00
Tyler Smalley 82e17f435f
[kbn-es] Package for managing Elasticsearch during dev and testing (#17168)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2018-03-20 08:30:15 -07:00
Bill McConaghy 3069bf5ab6
moving plugin template to React and EUI (#16937)
* moving plugin template to React and EUI

* fixing method reference error

* adding whitespace and comments per PR feedback

* adjusting test

* fixing test

* reducing Angular dependency and fixing issue with hack not loading properly

* fixing tests

* reacting to PR feedback
2018-03-19 15:13:03 -04:00
Jonathan Budzenski 047a6b3e62
[packages] add licenses (#17072) 2018-03-12 12:39:38 -05:00
Thomas Decaux e135657d1f Missing argument for generate_plugin script (#16782) 2018-02-19 10:08:13 +01:00
Spencer 2c7a1f34cb
[kbn-plugin-generator] add plugin generator to the repo (#16655)
* [kbn-plugin-generator] add plugin generator to the repo

* [plugin-generator] use snake_case plugin name for directory name

* [plugin-generator] fix typo

* [plugin-generator] remove translation support until we resume i18n efforts

* [yarn] update lockfile

* [mocha] remove plugin-generator selector from mocha tests

* [plugin-generator] update generated readme to recommend yarn

* [plugin-generator] add readme to generator pacakge

* [plugin-generator] link from plugin-resource docs

* [plugin-generator] mention very important `kbn bootstrap` script

* [plugin-generator] rework some parts of the README

* [plugin-generator] log actual directory name with system separators

* [plugin-generator] include bootstrap/yarn preinstall check script
2018-02-12 12:23:23 -07:00