chore(security, eslint): apply platform security-specific rules to all exclusively owned paths. (#195711)

## Summary

Apply platform security-specific rules to all exclusively owned paths.
This commit is contained in:
Aleh Zasypkin 2024-10-11 10:49:12 +03:00 committed by GitHub
parent 09110a38ac
commit a2d6e102d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
208 changed files with 653 additions and 431 deletions

View file

@ -1815,9 +1815,23 @@ module.exports = {
files: [
'src/plugins/interactive_setup/**/*.{js,mjs,ts,tsx}',
'test/interactive_setup_api_integration/**/*.{js,mjs,ts,tsx}',
'test/interactive_setup_functional/**/*.{js,mjs,ts,tsx}',
'packages/kbn-mock-idp-plugin/**/*.{js,mjs,ts,tsx}',
'packages/kbn-mock-idp-utils/**/*.{js,mjs,ts,tsx}',
'packages/kbn-security-hardening/**/*.{js,mjs,ts,tsx}',
'packages/kbn-user-profile-components/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/encrypted_saved_objects/**/*.{js,mjs,ts,tsx}',
'x-pack/test/encrypted_saved_objects_api_integration/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/security/**/*.{js,mjs,ts,tsx}',
'x-pack/packages/security/**/*.{js,mjs,ts,tsx}',
'x-pack/test/security_api_integration/**/*.{js,mjs,ts,tsx}',
'x-pack/test/security_functional/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/spaces/**/*.{js,mjs,ts,tsx}',
'x-pack/test/spaces_api_integration/**/*.{js,mjs,ts,tsx}',
],
rules: {
'@typescript-eslint/consistent-type-imports': 1,

View file

@ -7,21 +7,24 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import type { EuiComboBoxOptionOption } from '@elastic/eui';
import {
EuiButton,
EuiPageTemplate,
EuiEmptyPrompt,
EuiComboBox,
EuiInlineEditTitle,
EuiFormRow,
EuiSpacer,
EuiComboBoxOptionOption,
EuiButtonEmpty,
EuiComboBox,
EuiEmptyPrompt,
EuiFormRow,
EuiInlineEditTitle,
EuiPageTemplate,
EuiSpacer,
} from '@elastic/eui';
import React, { ChangeEvent, useEffect, useState, useRef } from 'react';
import { FormikProvider, useFormik, Field, Form } from 'formik';
import { Field, Form, FormikProvider, useFormik } from 'formik';
import type { ChangeEvent } from 'react';
import React, { useEffect, useRef, useState } from 'react';
import type { CoreStart } from '@kbn/core-lifecycle-browser';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { CoreStart } from '@kbn/core-lifecycle-browser';
import { useAuthenticator } from './role_switcher';
export const LoginPage = () => {

View file

@ -7,14 +7,16 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import type { PluginInitializer } from '@kbn/core-plugins-browser';
import React from 'react';
import ReactDOM from 'react-dom';
import { KibanaThemeProvider } from '@kbn/react-kibana-context-theme';
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
import type { CloudSetup, CloudStart } from '@kbn/cloud-plugin/public';
import type { PluginInitializer } from '@kbn/core-plugins-browser';
import { I18nProvider } from '@kbn/i18n-react';
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
import { MOCK_IDP_LOGIN_PATH } from '@kbn/mock-idp-utils/src/constants';
import type { CloudStart, CloudSetup } from '@kbn/cloud-plugin/public';
import { KibanaThemeProvider } from '@kbn/react-kibana-context-theme';
import { RoleSwitcher } from './role_switcher';
export interface PluginSetupDependencies {

View file

@ -7,13 +7,13 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { EuiButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import React from 'react';
import { toMountPoint } from '@kbn/react-kibana-mount';
import { EuiButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import type { ToastInput } from '@kbn/core-notifications-browser';
import type { I18nStart } from '@kbn/core-i18n-browser';
import type { ToastInput } from '@kbn/core-notifications-browser';
import type { ThemeServiceStart } from '@kbn/core-theme-browser';
import { toMountPoint } from '@kbn/react-kibana-mount';
import type { AuthenticatedUser } from '@kbn/security-plugin-types-common';
export const DATA_TEST_SUBJ_PAGE_RELOAD_BUTTON = 'pageReloadButton';

View file

@ -7,13 +7,15 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { EuiButton, EuiContextMenu, EuiPopover } from '@elastic/eui';
import React, { useEffect, useState } from 'react';
import { EuiButton, EuiPopover, EuiContextMenu } from '@elastic/eui';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { CoreStart } from '@kbn/core-lifecycle-browser';
import useAsyncFn from 'react-use/lib/useAsyncFn';
import type { AuthenticatedUser } from '@kbn/security-plugin-types-common';
import type { CoreStart } from '@kbn/core-lifecycle-browser';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { MOCK_IDP_REALM_NAME, MOCK_IDP_REALM_TYPE } from '@kbn/mock-idp-utils/src/constants';
import type { AuthenticatedUser } from '@kbn/security-plugin-types-common';
import { createReloadPageToast } from './reload_page_toast';
import type { CreateSAMLResponseParams } from '../server';

View file

@ -7,17 +7,18 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import type { PluginInitializer, Plugin } from '@kbn/core-plugins-server';
import { resolve } from 'path';
import type { CloudSetup } from '@kbn/cloud-plugin/server';
import { schema } from '@kbn/config-schema';
import type { TypeOf } from '@kbn/config-schema';
import { MOCK_IDP_LOGIN_PATH, MOCK_IDP_LOGOUT_PATH, createSAMLResponse } from '@kbn/mock-idp-utils';
import type { Plugin, PluginInitializer } from '@kbn/core-plugins-server';
import {
readRolesFromResource,
SERVERLESS_ROLES_ROOT_PATH,
STATEFUL_ROLES_ROOT_PATH,
readRolesFromResource,
} from '@kbn/es';
import { resolve } from 'path';
import { CloudSetup } from '@kbn/cloud-plugin/server';
import { createSAMLResponse, MOCK_IDP_LOGIN_PATH, MOCK_IDP_LOGOUT_PATH } from '@kbn/mock-idp-utils';
export interface PluginSetupDependencies {
cloud: CloudSetup;

View file

@ -7,23 +7,23 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { Client } from '@elastic/elasticsearch';
import { SignedXml } from 'xml-crypto';
import { KBN_KEY_PATH, KBN_CERT_PATH } from '@kbn/dev-utils';
import { readFile } from 'fs/promises';
import type { Client } from '@elastic/elasticsearch';
import { X509Certificate } from 'crypto';
import { readFile } from 'fs/promises';
import { SignedXml } from 'xml-crypto';
import { KBN_CERT_PATH, KBN_KEY_PATH } from '@kbn/dev-utils';
import {
MOCK_IDP_REALM_NAME,
MOCK_IDP_ENTITY_ID,
MOCK_IDP_ROLE_MAPPING_NAME,
MOCK_IDP_ATTRIBUTE_PRINCIPAL,
MOCK_IDP_ATTRIBUTE_ROLES,
MOCK_IDP_ATTRIBUTE_EMAIL,
MOCK_IDP_ATTRIBUTE_NAME,
MOCK_IDP_ATTRIBUTE_PRINCIPAL,
MOCK_IDP_ATTRIBUTE_ROLES,
MOCK_IDP_ENTITY_ID,
MOCK_IDP_LOGIN_PATH,
MOCK_IDP_LOGOUT_PATH,
MOCK_IDP_REALM_NAME,
MOCK_IDP_ROLE_MAPPING_NAME,
} from './constants';
/**

View file

@ -7,8 +7,8 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import React from 'react';
import { act, renderHook, type WrapperComponent } from '@testing-library/react-hooks';
import React from 'react';
import { BehaviorSubject, first, lastValueFrom, of } from 'rxjs';
import { coreMock } from '@kbn/core/public/mocks';

View file

@ -8,13 +8,14 @@
*/
import { EuiButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import React, { useCallback, useRef, useState, useEffect } from 'react';
import useObservable from 'react-use/lib/useObservable';
import { i18n } from '@kbn/i18n';
import { merge } from 'lodash';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import useObservable from 'react-use/lib/useObservable';
import { i18n } from '@kbn/i18n';
import type { UserProfileData } from '../types';
import { useUserProfiles } from '../services';
import type { UserProfileData } from '../types';
interface Props {
notificationSuccess?: {

View file

@ -7,12 +7,13 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import React, { FC, PropsWithChildren, useContext } from 'react';
import type { FC, PropsWithChildren } from 'react';
import React, { useContext } from 'react';
import type { I18nStart } from '@kbn/core-i18n-browser';
import type { NotificationsStart, ToastOptions } from '@kbn/core-notifications-browser';
import type { ThemeServiceStart } from '@kbn/core-theme-browser';
import { toMountPoint } from '@kbn/react-kibana-mount';
import type { toMountPoint } from '@kbn/react-kibana-mount';
import type { UserProfileAPIClient } from './types';

View file

@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { Observable } from 'rxjs';
import type { Observable } from 'rxjs';
/**
* Avatar stored in user profile.

View file

@ -11,8 +11,8 @@ import type { EuiAvatarProps } from '@elastic/eui';
import { EuiAvatar, useEuiTheme } from '@elastic/eui';
import type { FunctionComponent } from 'react';
import React from 'react';
import { UserProfileAvatarData } from './types';
import type { UserProfileAvatarData } from './types';
import type { UserProfile, UserProfileUserInfo } from './user_profile';
import {
getUserAvatarColor,

View file

@ -8,6 +8,7 @@
*/
import { VISUALIZATION_COLORS } from '@elastic/eui';
import type { UserProfileAvatarData, UserProfileData } from './types';
/**

View file

@ -9,8 +9,8 @@
import { shallow } from 'enzyme';
import React from 'react';
import { UserProfile } from './user_profile';
import type { UserProfile } from './user_profile';
import { UserProfilesPopover } from './user_profiles_popover';
const userProfiles: UserProfile[] = [

View file

@ -7,12 +7,13 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import type { EuiPopoverProps, EuiContextMenuPanelProps } from '@elastic/eui';
import type { EuiContextMenuPanelProps, EuiPopoverProps } from '@elastic/eui';
import { EuiContextMenuPanel, EuiPopover, useGeneratedHtmlId } from '@elastic/eui';
import React from 'react';
import { EuiPopover, EuiContextMenuPanel, useGeneratedHtmlId } from '@elastic/eui';
import { UserProfilesSelectable, UserProfilesSelectableProps } from './user_profiles_selectable';
import type { UserProfileWithAvatar } from './user_avatar';
import type { UserProfilesSelectableProps } from './user_profiles_selectable';
import { UserProfilesSelectable } from './user_profiles_selectable';
/**
* Props of {@link UserProfilesPopover} component

View file

@ -7,10 +7,11 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { mountWithIntl as mount } from '@kbn/test-jest-helpers';
import React from 'react';
import { UserProfile } from './user_profile';
import { mountWithIntl as mount } from '@kbn/test-jest-helpers';
import type { UserProfile } from './user_profile';
import { UserProfilesSelectable } from './user_profiles_selectable';
const userProfiles: UserProfile[] = [

View file

@ -10,15 +10,15 @@
import type { EuiSelectableOption, EuiSelectableProps } from '@elastic/eui';
import {
EuiButtonEmpty,
EuiCallOut,
EuiFlexGroup,
EuiFlexItem,
EuiHighlight,
EuiHorizontalRule,
EuiPanel,
EuiSelectable,
EuiSpacer,
EuiText,
EuiCallOut,
EuiHighlight,
} from '@elastic/eui';
import type { ReactNode } from 'react';
import React, { useEffect, useState } from 'react';
@ -26,9 +26,9 @@ import React, { useEffect, useState } from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { getUserDisplayLabel, getUserDisplayName } from './user_profile';
import type { UserProfileWithAvatar } from './user_avatar';
import { UserAvatar } from './user_avatar';
import { getUserDisplayLabel, getUserDisplayName } from './user_profile';
const NULL_OPTION_KEY = 'null';

View file

@ -7,15 +7,15 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/
import { EuiText, EuiToolTipProps } from '@elastic/eui';
import { EuiToolTip, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import type { EuiToolTipProps } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem, EuiText, EuiToolTip } from '@elastic/eui';
import type { FunctionComponent } from 'react';
import React from 'react';
import type { UserProfileUserInfo } from './user_profile';
import type { UserProfileAvatarData } from './types';
import { UserAvatar } from './user_avatar';
import type { UserProfileUserInfo } from './user_profile';
import { getUserDisplayName } from './user_profile';
import { UserProfileAvatarData } from './types';
/**
* Props of {@link UserToolTip} component

View file

@ -8,6 +8,7 @@
*/
import { getUrl, kibanaServerTestUser } from '@kbn/test';
import type { FtrProviderContext } from '../../functional/ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {

View file

@ -8,6 +8,7 @@
*/
import { getUrl } from '@kbn/test';
import type { FtrProviderContext } from '../../functional/ftr_provider_context';
export default function ({ getService, getPageObject }: FtrProviderContext) {

View file

@ -8,6 +8,7 @@
*/
import { getUrl, kibanaServerTestUser } from '@kbn/test';
import type { FtrProviderContext } from '../../functional/ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {

View file

@ -5,8 +5,10 @@
* 2.0.
*/
import { EuiToolTip, EuiBadge } from '@elastic/eui';
import React, { FunctionComponent } from 'react';
import { EuiBadge, EuiToolTip } from '@elastic/eui';
import type { FunctionComponent } from 'react';
import React from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
export interface ApiKeyBadgeProps {

View file

@ -6,10 +6,13 @@
*/
import { EuiCallOut } from '@elastic/eui';
import type { FunctionComponent } from 'react';
import React from 'react';
import { i18n } from '@kbn/i18n';
import React, { FunctionComponent } from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { CreateAPIKeyResult } from './api_keys_api_client';
import type { CreateAPIKeyResult } from './api_keys_api_client';
import { SelectableTokenField } from './token_field';
export interface ApiKeyCreatedCalloutProps {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { ExclusiveUnion, htmlIdGenerator } from '@elastic/eui';
import type { ExclusiveUnion } from '@elastic/eui';
import {
EuiButton,
EuiButtonEmpty,
@ -27,12 +27,13 @@ import {
EuiSwitch,
EuiText,
EuiTitle,
htmlIdGenerator,
useEuiTheme,
} from '@elastic/eui';
import { Form, FormikProvider, useFormik } from 'formik';
import moment from 'moment-timezone';
import { FunctionComponent, useRef } from 'react';
import React, { useEffect, useState } from 'react';
import type { FunctionComponent } from 'react';
import React, { useEffect, useRef, useState } from 'react';
import useAsyncFn from 'react-use/lib/useAsyncFn';
import { CodeEditorField } from '@kbn/code-editor';
@ -41,10 +42,13 @@ import { i18n } from '@kbn/i18n';
import { FormattedDate, FormattedMessage } from '@kbn/i18n-react';
import { useDarkMode, useKibana } from '@kbn/kibana-react-plugin/public';
import type { KibanaServerError } from '@kbn/kibana-utils-plugin/public';
import { Role } from '@kbn/security-plugin-types-common';
import { FormField, FormRow } from '@kbn/security-form-components';
import type { ApiKeyRoleDescriptors, CategorizedApiKey } from '@kbn/security-plugin-types-common';
import type {
ApiKeyRoleDescriptors,
CategorizedApiKey,
Role,
} from '@kbn/security-plugin-types-common';
import { ApiKeyBadge, ApiKeyStatus, TimeToolTip } from '.';
import { APIKeysAPIClient } from './api_keys_api_client';
import type {

View file

@ -7,9 +7,12 @@
import { EuiHealth } from '@elastic/eui';
import moment from 'moment';
import React, { FunctionComponent } from 'react';
import type { FunctionComponent } from 'react';
import React from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { CategorizedApiKey } from '@kbn/security-plugin-types-common';
import type { CategorizedApiKey } from '@kbn/security-plugin-types-common';
import { TimeToolTip } from './time_tool_tip';
export type ApiKeyStatusProps = Pick<CategorizedApiKey, 'expiration'>;

View file

@ -5,9 +5,15 @@
* 2.0.
*/
import type { Criteria } from '@elastic/eui';
import type { QueryContainer } from '@elastic/eui/src/components/search_bar/query/ast_to_es_query_dsl';
import type { HttpStart } from '@kbn/core/public';
import type {
ApiKeyToInvalidate,
CategorizedApiKey,
QueryApiKeyResult,
} from '@kbn/security-plugin-types-common';
import type {
CreateAPIKeyParams,
CreateAPIKeyResult,
@ -15,13 +21,6 @@ import type {
UpdateAPIKeyResult,
} from '@kbn/security-plugin-types-server';
import type {
ApiKeyToInvalidate,
CategorizedApiKey,
QueryApiKeyResult,
} from '@kbn/security-plugin-types-common';
import type { Criteria } from '@elastic/eui';
export type { CreateAPIKeyParams, CreateAPIKeyResult, UpdateAPIKeyParams, UpdateAPIKeyResult };
export interface QueryFilters {

View file

@ -7,8 +7,8 @@
import { EuiToolTip } from '@elastic/eui';
import moment from 'moment';
import type { FunctionComponent } from 'react';
import React from 'react';
import { FunctionComponent } from 'react';
export interface TimeToolTipProps {
timestamp: number;

View file

@ -12,8 +12,8 @@ import type {
FeatureKibanaPrivilegesReference,
} from '@kbn/features-plugin/common';
import type { FeaturesPluginSetup, KibanaFeature } from '@kbn/features-plugin/server';
import type { SecurityLicense } from '@kbn/security-plugin-types-common';
import { featurePrivilegeBuilderFactory } from './feature_privilege_builder';
import type { RawKibanaPrivileges } from './raw_kibana_privileges';
import type { Actions } from '../actions';

View file

@ -5,8 +5,8 @@
* 2.0.
*/
import type { RolesAPIClient } from '../roles';
import type { PrivilegesAPIClientPublicContract } from '../privileges';
import type { RolesAPIClient } from '../roles';
export interface AuthorizationServiceSetup {
/**

View file

@ -6,6 +6,7 @@
*/
import type { SecurityLicense } from '@kbn/security-plugin-types-common';
import type { AuthenticationServiceSetup, AuthenticationServiceStart } from './authentication';
import type { AuthorizationServiceSetup, AuthorizationServiceStart } from './authorization';
import type { SecurityNavControlServiceStart } from './nav_control';

View file

@ -5,9 +5,10 @@
* 2.0.
*/
import type { Observable } from 'rxjs';
import type { CoreUserProfileDelegateContract } from '@kbn/core-user-profile-browser';
import type { UserProfileData } from '@kbn/core-user-profile-common';
import type { Observable } from 'rxjs';
export type {
GetUserProfileResponse,

View file

@ -6,7 +6,6 @@
*/
import type { KibanaRequest } from '@kbn/core/server';
import type { AuditLogger } from '@kbn/core-security-server';
export interface AuditServiceSetup {

View file

@ -6,7 +6,8 @@
*/
import { schema } from '@kbn/config-schema';
import { getKibanaRoleSchema, elasticsearchRoleSchema } from '../../authorization';
import { elasticsearchRoleSchema, getKibanaRoleSchema } from '../../authorization';
export const restApiKeySchema = schema.object({
type: schema.maybe(schema.literal('rest')),

View file

@ -6,8 +6,8 @@
*/
import type { KibanaRequest } from '@kbn/core/server';
import type { AuthenticatedUser } from '@kbn/security-plugin-types-common';
import type { APIKeysService } from '@kbn/core-security-server';
import type { AuthenticatedUser } from '@kbn/security-plugin-types-common';
/**
* Authentication services available on the security plugin's start contract.

View file

@ -6,9 +6,10 @@
*/
import type { KibanaRequest } from '@kbn/core/server';
import type {
CheckPrivilegesPayload,
CheckPrivilegesOptions,
CheckPrivilegesPayload,
CheckPrivilegesResponse,
} from './check_privileges';

View file

@ -6,6 +6,7 @@
*/
import type { KibanaRequest } from '@kbn/core/server';
import type { CheckPrivilegesResponse } from './check_privileges';
export type CheckSavedObjectsPrivilegesWithRequest = (

View file

@ -6,7 +6,6 @@
*/
import type { DeprecationsDetails, GetDeprecationsContext } from '@kbn/core/server';
import type { Role } from '@kbn/security-plugin-types-common';
export interface PrivilegeDeprecationsRolesByFeatureIdResponse {

View file

@ -6,9 +6,10 @@
*/
import type { SecurityLicense } from '@kbn/security-plugin-types-common';
import type { AuditServiceSetup } from './audit';
import type { PrivilegeDeprecationsService, AuthorizationServiceSetup } from './authorization';
import type { AuthenticationServiceStart } from './authentication';
import type { AuthorizationServiceSetup, PrivilegeDeprecationsService } from './authorization';
import type { UserProfileServiceStart } from './user_profile';
/**

View file

@ -12,8 +12,9 @@ import {
subFeaturePrivilegeIterator,
} from '@kbn/features-plugin/server/feature_privilege_iterator';
import type { LicenseType } from '@kbn/licensing-plugin/server';
import type { SecurityLicenseFeatures } from '@kbn/security-plugin-types-common';
import { Actions, privilegesFactory } from '@kbn/security-authorization-core';
import type { SecurityLicenseFeatures } from '@kbn/security-plugin-types-common';
import { KibanaPrivileges } from '../kibana_privileges';
const featuresPluginService = (): jest.Mocked<FeaturesPluginSetup> => {

View file

@ -5,10 +5,11 @@
* 2.0.
*/
import { KibanaPrivilege } from './kibana_privilege';
import { KibanaPrivileges, isGlobalPrivilegeDefinition } from './kibana_privileges';
import type { RoleKibanaPrivilege } from '@kbn/security-plugin-types-common';
import { createRawKibanaPrivileges, kibanaFeatures } from './__fixtures__';
import { KibanaPrivilege } from './kibana_privilege';
import { isGlobalPrivilegeDefinition, KibanaPrivileges } from './kibana_privileges';
describe('kibana_privilege', () => {
describe('isGlobalPrivilegeDefinition', () => {

View file

@ -6,9 +6,9 @@
*/
import type { KibanaFeature } from '@kbn/features-plugin/common';
import type { RoleKibanaPrivilege } from '@kbn/security-plugin-types-common';
import type { RawKibanaPrivileges } from '@kbn/security-authorization-core';
import type { RoleKibanaPrivilege } from '@kbn/security-plugin-types-common';
import { KibanaPrivilege } from './kibana_privilege';
import { PrivilegeCollection } from './privilege_collection';
import { SecuredFeature } from './secured_feature';

View file

@ -9,13 +9,13 @@ import { EuiAccordion, EuiIconTip } from '@elastic/eui';
import React from 'react';
import type { KibanaFeature, SubFeatureConfig } from '@kbn/features-plugin/public';
import type { Role } from '@kbn/security-plugin-types-common';
import {
createFeature,
createKibanaPrivileges,
kibanaFeatures,
} from '@kbn/security-role-management-model/src/__fixtures__';
import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers';
import type { Role } from '@kbn/security-plugin-types-common';
import { getDisplayedFeaturePrivileges } from './__fixtures__';
import { FeatureTable } from './feature_table';

View file

@ -33,9 +33,9 @@ import type { Role } from '@kbn/security-plugin-types-common';
import type { KibanaPrivileges, SecuredFeature } from '@kbn/security-role-management-model';
import { ChangeAllPrivilegesControl } from './change_all_privileges';
import { FeatureTableCell } from './components/feature_table_cell';
import { FeatureTableExpandedRow } from './feature_table_expanded_row';
import { NO_PRIVILEGE_VALUE } from '../constants';
import { FeatureTableCell } from './components/feature_table_cell';
import type { PrivilegeFormCalculator } from '../privilege_form_calculator';
interface Props {

View file

@ -8,11 +8,11 @@
import { act } from '@testing-library/react';
import React from 'react';
import type { Role } from '@kbn/security-plugin-types-common';
import {
createKibanaPrivileges,
kibanaFeatures,
} from '@kbn/security-role-management-model/src/__fixtures__';
import type { Role } from '@kbn/security-plugin-types-common';
import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers';
import { FeatureTableExpandedRow } from './feature_table_expanded_row';

View file

@ -5,11 +5,11 @@
* 2.0.
*/
import type { Role } from '@kbn/security-plugin-types-common';
import {
createKibanaPrivileges,
kibanaFeatures,
} from '@kbn/security-role-management-model/src/__fixtures__';
import type { Role } from '@kbn/security-plugin-types-common';
import { PrivilegeFormCalculator } from './privilege_form_calculator';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { BuildFlavor } from '@kbn/config';
import type { BuildFlavor } from '@kbn/config';
import { httpServiceMock, loggingSystemMock } from '@kbn/core/server/mocks';
import type { ConfigType } from '../config';

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { BuildFlavor } from '@kbn/config';
import type { BuildFlavor } from '@kbn/config';
import type { IRouter, Logger } from '@kbn/core/server';
import type { PublicMethodsOf } from '@kbn/utility-types';

View file

@ -6,7 +6,8 @@
*/
import type { History } from 'history';
import React, { FC, PropsWithChildren } from 'react';
import type { FC, PropsWithChildren } from 'react';
import React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import type {

View file

@ -8,7 +8,8 @@
import './authentication_state_page.scss';
import { EuiIcon, EuiImage, EuiSpacer, EuiTitle } from '@elastic/eui';
import React, { FC, PropsWithChildren } from 'react';
import type { FC, PropsWithChildren } from 'react';
import React from 'react';
interface Props {
className?: string;

View file

@ -6,7 +6,8 @@
*/
import type { History } from 'history';
import React, { FC, PropsWithChildren } from 'react';
import type { FC, PropsWithChildren } from 'react';
import React from 'react';
import { render, unmountComponentAtNode } from 'react-dom';
import { Redirect } from 'react-router-dom';

View file

@ -6,7 +6,9 @@
*/
import path from 'path';
import { FtrConfigProviderContext } from '@kbn/test';
import type { FtrConfigProviderContext } from '@kbn/test';
import { services } from './services';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {

View file

@ -5,8 +5,8 @@
* 2.0.
*/
import { GenericFtrProviderContext } from '@kbn/test';
import type { GenericFtrProviderContext } from '@kbn/test';
import { services } from './services';
import type { services } from './services';
export type FtrProviderContext = GenericFtrProviderContext<typeof services, {}>;

View file

@ -6,8 +6,9 @@
*/
import { schema } from '@kbn/config-schema';
import { IRouter, CoreSetup, SavedObject } from '@kbn/core/server';
import { PluginsSetup, PluginsStart } from '.';
import type { CoreSetup, IRouter, SavedObject } from '@kbn/core/server';
import type { PluginsSetup, PluginsStart } from '.';
export function registerHiddenSORoutes(
router: IRouter,

View file

@ -5,20 +5,21 @@
* 2.0.
*/
import { deepFreeze } from '@kbn/std';
import {
import { schema } from '@kbn/config-schema';
import type {
CoreSetup,
PluginInitializer,
SavedObject,
SavedObjectsNamespaceType,
SavedObjectUnsanitizedDoc,
SavedObject,
} from '@kbn/core/server';
import { schema } from '@kbn/config-schema';
import {
import type {
EncryptedSavedObjectsPluginSetup,
EncryptedSavedObjectsPluginStart,
} from '@kbn/encrypted-saved-objects-plugin/server';
import { SpacesPluginSetup } from '@kbn/spaces-plugin/server';
import type { SpacesPluginSetup } from '@kbn/spaces-plugin/server';
import { deepFreeze } from '@kbn/std';
import { registerHiddenSORoutes } from './hidden_saved_object_routes';
const SAVED_OBJECT_WITH_SECRET_TYPE = 'saved-object-with-secret';

View file

@ -7,7 +7,8 @@
import { MAIN_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server';
import expect from '@kbn/expect';
import { FtrProviderContext } from '../ftr_provider_context';
import type { FtrProviderContext } from '../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest');

View file

@ -5,13 +5,12 @@
* 2.0.
*/
import expect from '@kbn/expect';
import type { SavedObject } from '@kbn/core/server';
import { MAIN_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server';
import {
descriptorToArray,
SavedObjectDescriptor,
} from '@kbn/encrypted-saved-objects-plugin/server/crypto';
import type { SavedObjectDescriptor } from '@kbn/encrypted-saved-objects-plugin/server/crypto';
import { descriptorToArray } from '@kbn/encrypted-saved-objects-plugin/server/crypto';
import expect from '@kbn/expect';
import type { FtrProviderContext } from '../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {

View file

@ -7,7 +7,8 @@
import { MAIN_SAVED_OBJECT_INDEX } from '@kbn/core-saved-objects-server';
import expect from '@kbn/expect';
import { FtrProviderContext } from '../ftr_provider_context';
import type { FtrProviderContext } from '../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest');

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { FtrProviderContext } from '../ftr_provider_context';
import type { FtrProviderContext } from '../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
describe('encryptedSavedObjects', function encryptedSavedObjectsSuite() {

View file

@ -5,9 +5,10 @@
* 2.0.
*/
import { FtrConfigProviderContext } from '@kbn/test';
import { resolve } from 'path';
import type { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const kibanaAPITestsConfig = await readConfigFile(
require.resolve('@kbn/test-suites-src/api_integration/config')

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { FtrConfigProviderContext } from '@kbn/test';
import type { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const anonymousAPITestsConfig = await readConfigFile(require.resolve('./anonymous.config.ts'));

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import { FtrConfigProviderContext } from '@kbn/test';
import type { FtrConfigProviderContext } from '@kbn/test';
import { services } from './services';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {

View file

@ -6,7 +6,8 @@
*/
import { resolve } from 'path';
import { FtrConfigProviderContext } from '@kbn/test';
import type { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const xPackAPITestsConfig = await readConfigFile(require.resolve('../api_integration/config.ts'));

View file

@ -5,9 +5,10 @@
* 2.0.
*/
import { FtrConfigProviderContext } from '@kbn/test';
import { resolve } from 'path';
import type { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const kibanaAPITestsConfig = await readConfigFile(
require.resolve('@kbn/test-suites-src/api_integration/config')

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import { GenericFtrProviderContext } from '@kbn/test';
import { services } from './services';
import type { GenericFtrProviderContext } from '@kbn/test';
import type { services } from './services';
export type FtrProviderContext = GenericFtrProviderContext<typeof services, {}>;

View file

@ -5,8 +5,10 @@
* 2.0.
*/
import { FtrConfigProviderContext } from '@kbn/test';
import { resolve } from 'path';
import type { FtrConfigProviderContext } from '@kbn/test';
import { services } from './services';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import { FtrConfigProviderContext } from '@kbn/test';
import type { FtrConfigProviderContext } from '@kbn/test';
import { services } from './services';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {

View file

@ -6,7 +6,9 @@
*/
import { resolve } from 'path';
import { FtrConfigProviderContext } from '@kbn/test';
import type { FtrConfigProviderContext } from '@kbn/test';
import { services } from './services';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { FtrConfigProviderContext } from '@kbn/test';
import type { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const kerberosAPITestsConfig = await readConfigFile(require.resolve('./kerberos.config.ts'));

View file

@ -7,8 +7,9 @@
import { readFileSync } from 'fs';
import { resolve } from 'path';
import { CA_CERT_PATH, KBN_CERT_PATH, KBN_KEY_PATH } from '@kbn/dev-utils';
import { FtrConfigProviderContext } from '@kbn/test';
import type { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const kibanaAPITestsConfig = await readConfigFile(

View file

@ -6,7 +6,9 @@
*/
import { resolve } from 'path';
import { FtrConfigProviderContext } from '@kbn/test';
import type { FtrConfigProviderContext } from '@kbn/test';
import { services } from './services';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {

View file

@ -5,8 +5,8 @@
* 2.0.
*/
import { FtrConfigProviderContext } from '@kbn/test';
import { CA_CERT_PATH } from '@kbn/dev-utils';
import type { FtrConfigProviderContext } from '@kbn/test';
import { configureHTTP2 } from '@kbn/test-suites-src/common/configure_http2';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { FtrConfigProviderContext } from '@kbn/test';
import type { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const oidcAPITestsConfig = await readConfigFile(require.resolve('./oidc.config.ts'));

View file

@ -9,10 +9,11 @@ import crypto from 'crypto';
import fs from 'fs';
import { stringify } from 'query-string';
import url from 'url';
import zlib from 'zlib';
import { promisify } from 'util';
import { parseString } from 'xml2js';
import { SignedXml } from 'xml-crypto';
import { parseString } from 'xml2js';
import zlib from 'zlib';
import { KBN_KEY_PATH } from '@kbn/dev-utils';
/**

View file

@ -6,8 +6,10 @@
*/
import { resolve } from 'path';
import { FtrConfigProviderContext } from '@kbn/test';
import { CA_CERT_PATH, KBN_CERT_PATH, KBN_KEY_PATH } from '@kbn/dev-utils';
import type { FtrConfigProviderContext } from '@kbn/test';
import { services } from './services';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { Plugin, CoreSetup } from '@kbn/core/server';
import type { CoreSetup, Plugin } from '@kbn/core/server';
export class AuditTrailTestPlugin implements Plugin {
public setup(core: CoreSetup) {

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import type { PluginInitializer, Plugin } from '@kbn/core/server';
import type { Plugin, PluginInitializer } from '@kbn/core/server';
import { initRoutes } from './init_routes';
export const plugin: PluginInitializer<void, void> = async (): Promise<Plugin> => ({

View file

@ -5,8 +5,9 @@
* 2.0.
*/
import type { PluginInitializer, Plugin } from '@kbn/core/server';
import { CloudSetup } from '@kbn/cloud-plugin/server';
import type { CloudSetup } from '@kbn/cloud-plugin/server';
import type { Plugin, PluginInitializer } from '@kbn/core/server';
import { initRoutes } from './init_routes';
export interface PluginSetupDependencies {

View file

@ -5,12 +5,13 @@
* 2.0.
*/
import { CoreSetup, PluginInitializerContext } from '@kbn/core/server';
import type { CoreSetup, PluginInitializerContext } from '@kbn/core/server';
import {
getSAMLResponse,
getSAMLRequestId,
getSAMLResponse,
} from '@kbn/security-api-integration-helpers/saml/saml_tools';
import { PluginSetupDependencies } from '.';
import type { PluginSetupDependencies } from '.';
export function initRoutes(
pluginContext: PluginInitializerContext,

View file

@ -5,10 +5,11 @@
* 2.0.
*/
import type { PluginInitializer, Plugin, CoreSetup } from '@kbn/core/server';
import { FeaturesPluginSetup, FeaturesPluginStart } from '@kbn/features-plugin/server';
import { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/server';
import { SpacesPluginSetup, SpacesPluginStart } from '@kbn/spaces-plugin/server';
import type { CoreSetup, Plugin, PluginInitializer } from '@kbn/core/server';
import type { FeaturesPluginSetup, FeaturesPluginStart } from '@kbn/features-plugin/server';
import type { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/server';
import type { SpacesPluginSetup, SpacesPluginStart } from '@kbn/spaces-plugin/server';
import { initRoutes } from './init_routes';
export interface PluginSetupDependencies {

View file

@ -5,9 +5,10 @@
* 2.0.
*/
import { CoreSetup } from '@kbn/core/server';
import { schema } from '@kbn/config-schema';
import { PluginStartDependencies } from '.';
import type { CoreSetup } from '@kbn/core/server';
import type { PluginStartDependencies } from '.';
export function initRoutes(core: CoreSetup<PluginStartDependencies>) {
const router = core.http.createRouter();

View file

@ -6,7 +6,9 @@
*/
import { resolve } from 'path';
import { FtrConfigProviderContext } from '@kbn/test';
import type { FtrConfigProviderContext } from '@kbn/test';
import { services } from './services';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {

View file

@ -5,8 +5,8 @@
* 2.0.
*/
import { FtrConfigProviderContext } from '@kbn/test';
import { CA_CERT_PATH } from '@kbn/dev-utils';
import type { FtrConfigProviderContext } from '@kbn/test';
import { configureHTTP2 } from '@kbn/test-suites-src/common/configure_http2';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {

View file

@ -5,7 +5,8 @@
* 2.0.
*/
import { FtrConfigProviderContext } from '@kbn/test';
import type { FtrConfigProviderContext } from '@kbn/test';
import { services } from './services';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {

View file

@ -5,8 +5,8 @@
* 2.0.
*/
import { services as commonServices } from '../common/services';
import { services as apiIntegrationServices } from '../api_integration/services';
import { services as commonServices } from '../common/services';
export const services = {
...commonServices,

View file

@ -6,7 +6,9 @@
*/
import { resolve } from 'path';
import { FtrConfigProviderContext } from '@kbn/test';
import type { FtrConfigProviderContext } from '@kbn/test';
import { services } from './services';
// the default export of config files must be a config provider

View file

@ -6,7 +6,9 @@
*/
import { resolve } from 'path';
import { FtrConfigProviderContext } from '@kbn/test';
import type { FtrConfigProviderContext } from '@kbn/test';
import { services } from './services';
// the default export of config files must be a config provider

View file

@ -6,7 +6,9 @@
*/
import { resolve } from 'path';
import { FtrConfigProviderContext } from '@kbn/test';
import type { FtrConfigProviderContext } from '@kbn/test';
import { services } from './services';
// the default export of config files must be a config provider

View file

@ -6,7 +6,9 @@
*/
import { resolve } from 'path';
import { FtrConfigProviderContext } from '@kbn/test';
import type { FtrConfigProviderContext } from '@kbn/test';
import { services } from './services';
// the default export of config files must be a config provider

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { FtrProviderContext } from '../../ftr_provider_context';
import type { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest');

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { FtrProviderContext } from '../../ftr_provider_context';
import type { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
describe('security APIs - Anonymous access', function () {

View file

@ -5,11 +5,14 @@
* 2.0.
*/
import expect from '@kbn/expect';
import { parse as parseCookie, Cookie } from 'tough-cookie';
import { adminTestUser } from '@kbn/test';
import { resolve } from 'path';
import { FtrProviderContext } from '../../ftr_provider_context';
import type { Cookie } from 'tough-cookie';
import { parse as parseCookie } from 'tough-cookie';
import expect from '@kbn/expect';
import { adminTestUser } from '@kbn/test';
import type { FtrProviderContext } from '../../ftr_provider_context';
import { FileWrapper } from '../audit/file_wrapper';
export default function ({ getService }: FtrProviderContext) {

View file

@ -7,7 +7,8 @@
import expect from '@kbn/expect';
import { adminTestUser } from '@kbn/test';
import { FtrProviderContext } from '../../ftr_provider_context';
import type { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertestWithoutAuth');

View file

@ -6,6 +6,7 @@
*/
import expect from '@kbn/expect';
import type { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { FtrProviderContext } from '../../ftr_provider_context';
import type { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
describe('security APIs - Api Keys', function () {

View file

@ -6,9 +6,11 @@
*/
import Path from 'path';
import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';
import { FileWrapper } from './file_wrapper';
import type { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest');

View file

@ -6,6 +6,7 @@
*/
import Fs from 'fs';
import type { RetryService } from '@kbn/ftr-common-functional-services';
export class FileWrapper {

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { FtrProviderContext } from '../../ftr_provider_context';
import type { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
describe('security APIs - Audit Log', function () {

View file

@ -13,9 +13,11 @@
*/
import { parse as parseCookie } from 'tough-cookie';
import { adminTestUser } from '@kbn/test';
import expect from '@kbn/expect';
import { FtrProviderContext } from '../../ftr_provider_context';
import { adminTestUser } from '@kbn/test';
import type { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertestWithoutAuth');

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { FtrProviderContext } from '../../ftr_provider_context';
import type { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ loadTestFile }: FtrProviderContext) {
describe('security APIs - CHIPS support', function () {

View file

@ -7,7 +7,8 @@
import expect from '@kbn/expect';
import { adminTestUser } from '@kbn/test';
import { FtrProviderContext } from '../../ftr_provider_context';
import type { FtrProviderContext } from '../../ftr_provider_context';
export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertestWithoutAuth');

Some files were not shown because too many files have changed in this diff Show more