Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-52751
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Dec 16, 2019
2 parents ea3f164 + 9e9fea1 commit 52401dc
Show file tree
Hide file tree
Showing 4,427 changed files with 91,023 additions and 84,981 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
66 changes: 13 additions & 53 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,46 +203,6 @@ module.exports = {
},
},

/**
* Prettier
*/
{
files: [
'.eslintrc.js',
'packages/kbn-utility-types/**/*',
'packages/kbn-eslint-plugin-eslint/**/*',
'packages/kbn-config-schema/**/*',
'packages/kbn-pm/**/*',
'packages/kbn-es/**/*',
'packages/elastic-datemath/**/*',
'packages/kbn-i18n/**/*',
'packages/kbn-dev-utils/**/*',
'packages/kbn-plugin-helpers/**/*',
'packages/kbn-plugin-generator/**/*',
'packages/kbn-test-subj-selector/**/*',
'packages/kbn-test/**/*',
'packages/kbn-eslint-import-resolver-kibana/**/*',
'src/legacy/server/saved_objects/**/*',
'x-pack/legacy/plugins/apm/**/*',
'x-pack/legacy/plugins/canvas/**/*',
'**/*.{ts,tsx}',
'src/legacy/core_plugins/metrics/**/*.js',
],
plugins: ['prettier'],
rules: Object.assign(
{
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
},
],
},
require('eslint-config-prettier').rules,
require('eslint-config-prettier/react').rules
),
},

/**
* Files that require Apache 2.0 headers, settings
* are overridden below for files that require Elastic
Expand Down Expand Up @@ -332,7 +292,7 @@ module.exports = {
allowSameFolder: true,
},
{
target: ['src/core/**/*'],
target: ['src/**/*'],
from: ['x-pack/**/*'],
errorMessage: 'OSS cannot import x-pack files.',
},
Expand Down Expand Up @@ -706,8 +666,6 @@ module.exports = {
'accessor-pairs': 'error',
'array-callback-return': 'error',
'no-array-constructor': 'error',
// This will be turned on after bug fixes are mostly completed
// 'arrow-body-style': ['warn', 'as-needed'],
complexity: 'warn',
// This will be turned on after bug fixes are mostly completed
// 'consistent-return': 'warn',
Expand Down Expand Up @@ -737,7 +695,6 @@ module.exports = {
'no-extra-bind': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-label': 'error',
'no-floating-decimal': 'error',
'no-func-assign': 'error',
'no-implicit-globals': 'error',
'no-implied-eval': 'error',
Expand Down Expand Up @@ -778,8 +735,6 @@ module.exports = {
'prefer-spread': 'error',
// This style will be turned on after most bugs are fixed
// 'prefer-template': 'warn',
// This style will be turned on after most bugs are fixed
// quotes: ['warn', 'single', { avoidEscape: true }],
'react/boolean-prop-naming': 'error',
'react/button-has-type': 'error',
'react/forbid-dom-props': 'error',
Expand Down Expand Up @@ -815,13 +770,10 @@ module.exports = {
'react/jsx-sort-default-props': 'error',
// might be introduced after the other warns are fixed
// 'react/jsx-sort-props': 'error',
'react/jsx-tag-spacing': 'error',
// might be introduced after the other warns are fixed
'react-hooks/exhaustive-deps': 'off',
'require-atomic-updates': 'error',
'rest-spread-spacing': ['error', 'never'],
'symbol-description': 'error',
'template-curly-spacing': 'error',
'vars-on-top': 'error',
},
},
Expand Down Expand Up @@ -856,8 +808,6 @@ module.exports = {
{
files: ['x-pack/legacy/plugins/monitoring/**/*.js'],
rules: {
'block-spacing': ['error', 'always'],
curly: ['error', 'all'],
'no-unused-vars': ['error', { args: 'all', argsIgnorePattern: '^_' }],
'no-else-return': 'error',
},
Expand All @@ -874,7 +824,6 @@ module.exports = {
files: ['x-pack/legacy/plugins/canvas/**/*.js'],
rules: {
radix: 'error',
curly: ['error', 'all'],

// module importing
'import/order': [
Expand All @@ -892,7 +841,6 @@ module.exports = {
'react/self-closing-comp': 'error',
'react/sort-comp': 'error',
'react/jsx-boolean-value': 'error',
'react/jsx-wrap-multilines': 'error',
'react/no-unescaped-entities': ['error', { forbid: ['>', '}'] }],
'react/forbid-elements': [
'error',
Expand Down Expand Up @@ -969,5 +917,17 @@ module.exports = {
'import/no-default-export': 'error',
},
},

/**
* Prettier disables all conflicting rules, listing as last override so it takes precedence
*/
{
files: ['**/*'],
rules: {
...require('eslint-config-prettier').rules,
...require('eslint-config-prettier/react').rules,
...require('eslint-config-prettier/@typescript-eslint').rules,
},
},
],
};
6 changes: 3 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

require('./src/setup_node_env');

module.exports = function (grunt) {
module.exports = function(grunt) {
// set the config once before calling load-grunt-config
// and once during so that we have access to it via
// grunt.config.get() within the config files
Expand All @@ -35,8 +35,8 @@ module.exports = function (grunt) {
init: true,
config: config,
loadGruntTasks: {
pattern: ['grunt-*', '@*/grunt-*', 'gruntify-*', '@*/gruntify-*']
}
pattern: ['grunt-*', '@*/grunt-*', 'gruntify-*', '@*/gruntify-*'],
},
});

// load task definitions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface Logger
| [debug(message, meta)](./kibana-plugin-server.logger.debug.md) | Log messages useful for debugging and interactive investigation |
| [error(errorOrMessage, meta)](./kibana-plugin-server.logger.error.md) | Logs abnormal or unexpected errors or messages that caused a failure in the application flow |
| [fatal(errorOrMessage, meta)](./kibana-plugin-server.logger.fatal.md) | Logs abnormal or unexpected errors or messages that caused an unrecoverable failure |
| [get(childContextPaths)](./kibana-plugin-server.logger.get.md) | Returns a new [Logger](./kibana-plugin-server.logger.md) instance extending the current logger context. |
| [info(message, meta)](./kibana-plugin-server.logger.info.md) | Logs messages related to general application flow |
| [trace(message, meta)](./kibana-plugin-server.logger.trace.md) | Log messages at the most detailed log level |
| [warn(errorOrMessage, meta)](./kibana-plugin-server.logger.warn.md) | Logs abnormal or unexpected errors or messages |
Expand Down
16 changes: 9 additions & 7 deletions docs/settings/security-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,17 @@ this to `true` if SSL is configured outside of {kib} (for example, you are
routing requests through a load balancer or proxy).

`xpack.security.session.idleTimeout`::
Sets the session duration (in milliseconds). By default, sessions stay active
until the browser is closed. When this is set to an explicit idle timeout, closing
the browser still requires the user to log back in to {kib}.
Sets the session duration. The format is a string of `<count>[ms|s|m|h|d|w|M|Y]`
(e.g. '70ms', '5s', '3d', '1Y'). By default, sessions stay active until the
browser is closed. When this is set to an explicit idle timeout, closing the
browser still requires the user to log back in to {kib}.

`xpack.security.session.lifespan`::
Sets the maximum duration (in milliseconds), also known as "absolute timeout". By
default, a session can be renewed indefinitely. When this value is set, a session
will end once its lifespan is exceeded, even if the user is not idle. NOTE: if
`idleTimeout` is not set, this setting will still cause sessions to expire.
Sets the maximum duration, also known as "absolute timeout". The format is a
string of `<count>[ms|s|m|h|d|w|M|Y]` (e.g. '70ms', '5s', '3d', '1Y'). By default,
a session can be renewed indefinitely. When this value is set, a session will end
once its lifespan is exceeded, even if the user is not idle. NOTE: if `idleTimeout`
is not set, this setting will still cause sessions to expire.

`xpack.security.loginAssistanceMessage`::
Adds a message to the login screen. Useful for displaying information about maintenance windows, links to corporate sign up pages etc.
14 changes: 8 additions & 6 deletions docs/user/security/securing-kibana.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@ For more information, see <<security-settings-kb,Security Settings in {kib}>>.
. Optional: Set a timeout to expire idle sessions. By default, a session stays
active until the browser is closed. To define a sliding session expiration, set
the `xpack.security.session.idleTimeout` property in the `kibana.yml`
configuration file. The idle timeout is specified in milliseconds. For example,
set the idle timeout to 600000 to expire idle sessions after 10 minutes:
configuration file. The idle timeout is formatted as a duration of
`<count>[ms|s|m|h|d|w|M|Y]` (e.g. '70ms', '5s', '3d', '1Y'). For example, set
the idle timeout to expire idle sessions after 10 minutes:
+
--
[source,yaml]
--------------------------------------------------------------------------------
xpack.security.session.idleTimeout: 600000
xpack.security.session.idleTimeout: "10m"
--------------------------------------------------------------------------------
--

Expand All @@ -74,13 +75,14 @@ the "absolute timeout". By default, a session stays active until the browser is
closed. If an idle timeout is defined, a session can still be extended
indefinitely. To define a maximum session lifespan, set the
`xpack.security.session.lifespan` property in the `kibana.yml` configuration
file. The lifespan is specified in milliseconds. For example, set the lifespan
to 28800000 to expire sessions after 8 hours:
file. The lifespan is formatted as a duration of `<count>[ms|s|m|h|d|w|M|Y]`
(e.g. '70ms', '5s', '3d', '1Y'). For example, set the lifespan to expire
sessions after 8 hours:
+
--
[source,yaml]
--------------------------------------------------------------------------------
xpack.security.session.lifespan: 28800000
xpack.security.session.lifespan: "8h"
--------------------------------------------------------------------------------
--

Expand Down
15 changes: 13 additions & 2 deletions packages/eslint-config-kibana/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ module.exports = {
'./jest.js',
'./react.js',
],
plugins: ['@kbn/eslint-plugin-eslint'],

plugins: [
'@kbn/eslint-plugin-eslint',
'prettier',
],

parserOptions: {
ecmaVersion: 6
Expand All @@ -16,6 +20,13 @@ module.exports = {
},

rules: {
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
},
],

'@kbn/eslint/module_migration': [
'error',
[
Expand Down Expand Up @@ -43,5 +54,5 @@ module.exports = {
},
],
],
}
},
};
25 changes: 0 additions & 25 deletions packages/eslint-config-kibana/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,10 @@ module.exports = {
rules: {
'block-scoped-var': 'error',
camelcase: [ 'error', { properties: 'never', allow: ['^UNSAFE_'] } ],
'comma-dangle': 'off',
'comma-spacing': ['error', { before: false, after: true }],
'comma-style': [ 'error', 'last' ],
'consistent-return': 'off',
curly: [ 'error', 'multi-line' ],
'dot-location': [ 'error', 'property' ],
'dot-notation': [ 'error', { allowKeywords: true } ],
eqeqeq: [ 'error', 'allow-null' ],
'guard-for-in': 'error',
indent: [ 'error', 2, { SwitchCase: 1 } ],
'key-spacing': ['error', { beforeColon: false, afterColon: true }],
'max-len': [ 'error', 140, 2, { ignoreComments: true, ignoreUrls: true } ],
'new-cap': [ 'error', { capIsNewExceptions: [ 'Private' ] } ],
'no-bitwise': 'off',
'no-caller': 'error',
Expand All @@ -63,13 +55,10 @@ module.exports = {
'no-empty': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-parens': 'off',
'no-extra-semi': [ 'error' ],
'no-global-assign': 'error',
'no-irregular-whitespace': 'error',
'no-iterator': 'error',
'no-loop-func': 'error',
'no-multi-spaces': 'off',
'no-multi-str': 'off',
'no-nested-ternary': 'error',
'no-new': 'off',
Expand All @@ -83,7 +72,6 @@ module.exports = {
'no-script-url': 'error',
'no-sequences': 'error',
'no-shadow': 'off',
'no-trailing-spaces': 'error',
'no-undef': 'error',
'no-underscore-dangle': 'off',
'no-unsanitized/method': 'error',
Expand All @@ -95,23 +83,10 @@ module.exports = {
'no-with': 'error',
'one-var': [ 'error', 'never' ],
'prefer-const': 'error',
quotes: [ 'error', 'single', { allowTemplateLiterals: true } ],
'semi-spacing': [ 'error', { before: false, after: true } ],
semi: [ 'error', 'always' ],
'space-before-blocks': [ 'error', 'always' ],
'space-before-function-paren': [ 'error', { anonymous: 'always', named: 'never' } ],
'space-in-parens': [ 'error', 'never' ],
'space-infix-ops': [ 'error', { int32Hint: false } ],
'space-unary-ops': [ 'error' ],
strict: [ 'error', 'never' ],
'valid-typeof': 'error',
'wrap-iife': [ 'error', 'outside' ],
'eol-last': ['error', 'always'],
yoda: 'off',

'object-curly-spacing': 'off', // overridden with babel/object-curly-spacing
'babel/object-curly-spacing': [ 'error', 'always' ],

'mocha/handle-done-callback': 'error',
'mocha/no-exclusive-tests': 'error',

Expand Down
15 changes: 0 additions & 15 deletions packages/eslint-config-kibana/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,14 @@ module.exports = {
},

rules: {
'jsx-quotes': ['error', 'prefer-double'],
'react/jsx-uses-react': 'error',
'react/react-in-jsx-scope': 'error',
'react/jsx-uses-vars': 'error',
'react/jsx-no-undef': 'error',
'react/jsx-pascal-case': 'error',
'react/jsx-closing-bracket-location': ['error', 'line-aligned'],
'react/jsx-closing-tag-location': 'error',
'react/jsx-curly-spacing': ['error', 'never', { allowMultiline: true }],
'react/jsx-indent-props': ['error', 2],
'react/jsx-max-props-per-line': ['error', { maximum: 1, when: 'multiline' }],
'react/jsx-no-duplicate-props': ['error', { ignoreCase: true }],
'react/no-danger': 'error',
'react/self-closing-comp': 'error',
'react/jsx-wrap-multilines': ['error', {
declaration: true,
assignment: true,
return: true,
arrow: true,
}],
'react/jsx-first-prop-new-line': ['error', 'multiline-multiprop'],
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': 'error', // Checks effect dependencies
'jsx-a11y/accessible-emoji': 'error',
Expand Down Expand Up @@ -71,8 +58,6 @@ module.exports = {
'jsx-a11y/role-supports-aria-props': 'error',
'jsx-a11y/scope': 'error',
'jsx-a11y/tabindex-no-positive': 'error',
'react/jsx-equals-spacing': ['error', 'never'],
'react/jsx-indent': ['error', 2],
'react/no-will-update-set-state': 'error',
'react/no-is-mounted': 'error',
'react/no-multi-comp': ['error', { ignoreStateless: true }],
Expand Down
Loading

0 comments on commit 52401dc

Please sign in to comment.