mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
# Backport This will backport the following commits from `main` to `8.19`: - [[ska] relocate x-pack/test/cases_api_integration (#225056)](https://github.com/elastic/kibana/pull/225056) <!--- Backport version: 10.0.1 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Dzmitry Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2025-06-25T17:04:29Z","message":"[ska] relocate x-pack/test/cases_api_integration (#225056)\n\n## Summary\n\nPart of https://github.com/elastic/kibana-team/issues/1503\n\nThis PR is mostly about moving tests from\nx-pack/test/cases_api_integration and updating related imports\n\nBefore:\n\n```\nx-pack/test/\n | - cases_api_integration/\n```\n\nAfter: \n```\nx-pack/platform/test/\n | - cases_api_integration/\n \nx-pack/solutions/security/test/\n | - cases_api_integration/\n```\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"bb7cce6d7b0cf5cc4a28648dd846b5328080df7f","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:skip","v9.1.0","v8.19.0"],"title":"[ska] relocate x-pack/test/cases_api_integration","number":225056,"url":"https://github.com/elastic/kibana/pull/225056","mergeCommit":{"message":"[ska] relocate x-pack/test/cases_api_integration (#225056)\n\n## Summary\n\nPart of https://github.com/elastic/kibana-team/issues/1503\n\nThis PR is mostly about moving tests from\nx-pack/test/cases_api_integration and updating related imports\n\nBefore:\n\n```\nx-pack/test/\n | - cases_api_integration/\n```\n\nAfter: \n```\nx-pack/platform/test/\n | - cases_api_integration/\n \nx-pack/solutions/security/test/\n | - cases_api_integration/\n```\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"bb7cce6d7b0cf5cc4a28648dd846b5328080df7f"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/225056","number":225056,"mergeCommit":{"message":"[ska] relocate x-pack/test/cases_api_integration (#225056)\n\n## Summary\n\nPart of https://github.com/elastic/kibana-team/issues/1503\n\nThis PR is mostly about moving tests from\nx-pack/test/cases_api_integration and updating related imports\n\nBefore:\n\n```\nx-pack/test/\n | - cases_api_integration/\n```\n\nAfter: \n```\nx-pack/platform/test/\n | - cases_api_integration/\n \nx-pack/solutions/security/test/\n | - cases_api_integration/\n```\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"bb7cce6d7b0cf5cc4a28648dd846b5328080df7f"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
773bdd8575
commit
d1aa2227c9
210 changed files with 1790 additions and 321 deletions
|
@ -158,10 +158,10 @@ enabled:
|
|||
- x-pack/test/api_integration/apis/cases/config.ts
|
||||
- x-pack/test/api_integration/apis/security/config.ts
|
||||
- x-pack/test/banners_functional/config.ts
|
||||
- x-pack/test/cases_api_integration/security_and_spaces/config_basic.ts
|
||||
- x-pack/test/cases_api_integration/security_and_spaces/config_trial.ts
|
||||
- x-pack/test/cases_api_integration/security_and_spaces/config_no_public_base_url.ts
|
||||
- x-pack/test/cases_api_integration/spaces_only/config.ts
|
||||
- x-pack/platform/test/cases_api_integration/security_and_spaces/config_basic.ts
|
||||
- x-pack/platform/test/cases_api_integration/security_and_spaces/config_trial.ts
|
||||
- x-pack/platform/test/cases_api_integration/security_and_spaces/config_no_public_base_url.ts
|
||||
- x-pack/platform/test/cases_api_integration/spaces_only/config.ts
|
||||
- x-pack/test/disable_ems/config.ts
|
||||
- x-pack/test/examples/config.ts
|
||||
- x-pack/test/fleet_api_integration/config.agent.ts
|
||||
|
|
|
@ -113,3 +113,5 @@ enabled:
|
|||
- x-pack/solutions/security/test/alerting_api_integration/security_and_spaces/group1/config.ts
|
||||
- x-pack/solutions/security/test/alerting_api_integration/security_and_spaces/group2/config.ts
|
||||
- x-pack/solutions/security/test/alerting_api_integration/security_and_spaces/group2/config_non_dedicated_task_runner.ts
|
||||
- x-pack/solutions/security/test/cases_api_integration/security_and_spaces/config_trial.ts
|
||||
- x-pack/solutions/security/test/cases_api_integration/security_and_spaces/config_basic.ts
|
||||
|
|
|
@ -1668,7 +1668,8 @@ module.exports = {
|
|||
'x-pack/platform/packages/shared/kbn-alerting-comparators/**/*.{ts, tsx}',
|
||||
'x-pack/platform/plugins/shared/embeddable_alerts_table/**/*.{ts,tsx}',
|
||||
'x-pack/platform/test/alerting_api_integration/**/*.{ts, tsx}',
|
||||
'x-pack/test/cases_api_integration/**/*.{ts, tsx}',
|
||||
'x-pack/platform/test/cases_api_integration/**/*.{ts, tsx}',
|
||||
'x-pack/solutions/**/test/cases_api_integration/**/*.{ts, tsx}',
|
||||
'x-pack/test/rule_registry/**/*.{ts, tsx}',
|
||||
'x-pack/test/api_integration/apis/cases/**/*.{ts, tsx}',
|
||||
],
|
||||
|
|
9
.github/CODEOWNERS
vendored
9
.github/CODEOWNERS
vendored
|
@ -73,7 +73,7 @@ src/platform/packages/shared/kbn-calculate-auto @elastic/obs-ux-management-team
|
|||
src/platform/packages/shared/kbn-calculate-width-from-char-count @elastic/kibana-visualizations
|
||||
x-pack/platform/plugins/private/canvas @elastic/kibana-presentation
|
||||
packages/kbn-capture-oas-snapshot-cli @elastic/kibana-core
|
||||
x-pack/test/cases_api_integration/common/plugins/cases @elastic/response-ops
|
||||
x-pack/platform/test/cases_api_integration/common/plugins/cases @elastic/response-ops
|
||||
src/platform/packages/shared/kbn-cases-components @elastic/response-ops
|
||||
x-pack/platform/plugins/shared/cases @elastic/response-ops @elastic/kibana-cases
|
||||
src/platform/packages/shared/kbn-cbor @elastic/kibana-operations
|
||||
|
@ -692,7 +692,7 @@ x-pack/solutions/observability/packages/observability-ai/observability-ai-common
|
|||
x-pack/solutions/observability/packages/observability-ai/observability-ai-server @elastic/obs-ai-assistant
|
||||
x-pack/solutions/observability/packages/alert-details @elastic/obs-ux-management-team
|
||||
x-pack/solutions/observability/packages/alerting-test-data @elastic/obs-ux-management-team
|
||||
x-pack/test/cases_api_integration/common/plugins/observability @elastic/response-ops
|
||||
x-pack/platform/test/cases_api_integration/common/plugins/observability @elastic/response-ops
|
||||
x-pack/solutions/observability/packages/get-padded-alert-time-range-util @elastic/obs-ux-management-team
|
||||
x-pack/solutions/observability/plugins/observability_logs_explorer @elastic/obs-ux-logs-team
|
||||
x-pack/solutions/observability/plugins/observability_onboarding @elastic/obs-ux-logs-team
|
||||
|
@ -857,7 +857,7 @@ x-pack/solutions/security/packages/connectors @elastic/security-threat-hunting-i
|
|||
x-pack/solutions/security/packages/distribution-bar @elastic/kibana-cloud-security-posture
|
||||
x-pack/solutions/security/plugins/security_solution_ess @elastic/security-solution
|
||||
x-pack/solutions/security/packages/features @elastic/security-threat-hunting-investigations
|
||||
x-pack/test/cases_api_integration/common/plugins/security_solution @elastic/response-ops
|
||||
x-pack/platform/test/cases_api_integration/common/plugins/security_solution @elastic/response-ops
|
||||
x-pack/solutions/security/packages/navigation @elastic/security-threat-hunting-investigations
|
||||
x-pack/solutions/security/plugins/security_solution @elastic/security-solution
|
||||
x-pack/solutions/security/plugins/security_solution_serverless @elastic/security-solution
|
||||
|
@ -2041,7 +2041,8 @@ x-pack/platform/plugins/private/cloud_integrations/cloud_full_story/server/confi
|
|||
/x-pack/platform/test/task_manager_claimer_update_by_query/ @elastic/response-ops
|
||||
/docs/user/alerting/ @elastic/response-ops
|
||||
/docs/management/connectors/ @elastic/response-ops
|
||||
/x-pack/test/cases_api_integration/ @elastic/response-ops
|
||||
/x-pack/platform/test/cases_api_integration/ @elastic/response-ops
|
||||
/x-pack/solutions/security/test/cases_api_integration/ @elastic/response-ops
|
||||
/x-pack/test/functional/services/cases/ @elastic/response-ops @elastic/kibana-cases
|
||||
/x-pack/test/functional_with_es_ssl/apps/cases/ @elastic/response-ops @elastic/kibana-cases
|
||||
/x-pack/test/api_integration/apis/cases/ @elastic/response-ops @elastic/kibana-cases
|
||||
|
|
|
@ -216,7 +216,7 @@
|
|||
"@kbn/calculate-auto": "link:src/platform/packages/shared/kbn-calculate-auto",
|
||||
"@kbn/calculate-width-from-char-count": "link:src/platform/packages/shared/kbn-calculate-width-from-char-count",
|
||||
"@kbn/canvas-plugin": "link:x-pack/platform/plugins/private/canvas",
|
||||
"@kbn/cases-api-integration-test-plugin": "link:x-pack/test/cases_api_integration/common/plugins/cases",
|
||||
"@kbn/cases-api-integration-test-plugin": "link:x-pack/platform/test/cases_api_integration/common/plugins/cases",
|
||||
"@kbn/cases-components": "link:src/platform/packages/shared/kbn-cases-components",
|
||||
"@kbn/cases-plugin": "link:x-pack/platform/plugins/shared/cases",
|
||||
"@kbn/cbor": "link:src/platform/packages/shared/kbn-cbor",
|
||||
|
@ -724,7 +724,7 @@
|
|||
"@kbn/observability-ai-server": "link:x-pack/solutions/observability/packages/observability-ai/observability-ai-server",
|
||||
"@kbn/observability-alert-details": "link:x-pack/solutions/observability/packages/alert-details",
|
||||
"@kbn/observability-alerting-test-data": "link:x-pack/solutions/observability/packages/alerting-test-data",
|
||||
"@kbn/observability-fixtures-plugin": "link:x-pack/test/cases_api_integration/common/plugins/observability",
|
||||
"@kbn/observability-fixtures-plugin": "link:x-pack/platform/test/cases_api_integration/common/plugins/observability",
|
||||
"@kbn/observability-get-padded-alert-time-range-util": "link:x-pack/solutions/observability/packages/get-padded-alert-time-range-util",
|
||||
"@kbn/observability-logs-explorer-plugin": "link:x-pack/solutions/observability/plugins/observability_logs_explorer",
|
||||
"@kbn/observability-onboarding-plugin": "link:x-pack/solutions/observability/plugins/observability_onboarding",
|
||||
|
@ -862,7 +862,7 @@
|
|||
"@kbn/security-solution-distribution-bar": "link:x-pack/solutions/security/packages/distribution-bar",
|
||||
"@kbn/security-solution-ess": "link:x-pack/solutions/security/plugins/security_solution_ess",
|
||||
"@kbn/security-solution-features": "link:x-pack/solutions/security/packages/features",
|
||||
"@kbn/security-solution-fixtures-plugin": "link:x-pack/test/cases_api_integration/common/plugins/security_solution",
|
||||
"@kbn/security-solution-fixtures-plugin": "link:x-pack/platform/test/cases_api_integration/common/plugins/security_solution",
|
||||
"@kbn/security-solution-navigation": "link:x-pack/solutions/security/packages/navigation",
|
||||
"@kbn/security-solution-plugin": "link:x-pack/solutions/security/plugins/security_solution",
|
||||
"@kbn/security-solution-serverless": "link:x-pack/solutions/security/plugins/security_solution_serverless",
|
||||
|
|
|
@ -140,8 +140,8 @@
|
|||
"@kbn/canvas-plugin/*": ["x-pack/platform/plugins/private/canvas/*"],
|
||||
"@kbn/capture-oas-snapshot-cli": ["packages/kbn-capture-oas-snapshot-cli"],
|
||||
"@kbn/capture-oas-snapshot-cli/*": ["packages/kbn-capture-oas-snapshot-cli/*"],
|
||||
"@kbn/cases-api-integration-test-plugin": ["x-pack/test/cases_api_integration/common/plugins/cases"],
|
||||
"@kbn/cases-api-integration-test-plugin/*": ["x-pack/test/cases_api_integration/common/plugins/cases/*"],
|
||||
"@kbn/cases-api-integration-test-plugin": ["x-pack/platform/test/cases_api_integration/common/plugins/cases"],
|
||||
"@kbn/cases-api-integration-test-plugin/*": ["x-pack/platform/test/cases_api_integration/common/plugins/cases/*"],
|
||||
"@kbn/cases-components": ["src/platform/packages/shared/kbn-cases-components"],
|
||||
"@kbn/cases-components/*": ["src/platform/packages/shared/kbn-cases-components/*"],
|
||||
"@kbn/cases-plugin": ["x-pack/platform/plugins/shared/cases"],
|
||||
|
@ -1378,8 +1378,8 @@
|
|||
"@kbn/observability-alert-details/*": ["x-pack/solutions/observability/packages/alert-details/*"],
|
||||
"@kbn/observability-alerting-test-data": ["x-pack/solutions/observability/packages/alerting-test-data"],
|
||||
"@kbn/observability-alerting-test-data/*": ["x-pack/solutions/observability/packages/alerting-test-data/*"],
|
||||
"@kbn/observability-fixtures-plugin": ["x-pack/test/cases_api_integration/common/plugins/observability"],
|
||||
"@kbn/observability-fixtures-plugin/*": ["x-pack/test/cases_api_integration/common/plugins/observability/*"],
|
||||
"@kbn/observability-fixtures-plugin": ["x-pack/platform/test/cases_api_integration/common/plugins/observability"],
|
||||
"@kbn/observability-fixtures-plugin/*": ["x-pack/platform/test/cases_api_integration/common/plugins/observability/*"],
|
||||
"@kbn/observability-get-padded-alert-time-range-util": ["x-pack/solutions/observability/packages/get-padded-alert-time-range-util"],
|
||||
"@kbn/observability-get-padded-alert-time-range-util/*": ["x-pack/solutions/observability/packages/get-padded-alert-time-range-util/*"],
|
||||
"@kbn/observability-logs-explorer-plugin": ["x-pack/solutions/observability/plugins/observability_logs_explorer"],
|
||||
|
@ -1708,8 +1708,8 @@
|
|||
"@kbn/security-solution-ess/*": ["x-pack/solutions/security/plugins/security_solution_ess/*"],
|
||||
"@kbn/security-solution-features": ["x-pack/solutions/security/packages/features"],
|
||||
"@kbn/security-solution-features/*": ["x-pack/solutions/security/packages/features/*"],
|
||||
"@kbn/security-solution-fixtures-plugin": ["x-pack/test/cases_api_integration/common/plugins/security_solution"],
|
||||
"@kbn/security-solution-fixtures-plugin/*": ["x-pack/test/cases_api_integration/common/plugins/security_solution/*"],
|
||||
"@kbn/security-solution-fixtures-plugin": ["x-pack/platform/test/cases_api_integration/common/plugins/security_solution"],
|
||||
"@kbn/security-solution-fixtures-plugin/*": ["x-pack/platform/test/cases_api_integration/common/plugins/security_solution/*"],
|
||||
"@kbn/security-solution-navigation": ["x-pack/solutions/security/packages/navigation"],
|
||||
"@kbn/security-solution-navigation/*": ["x-pack/solutions/security/packages/navigation/*"],
|
||||
"@kbn/security-solution-plugin": ["x-pack/solutions/security/plugins/security_solution"],
|
||||
|
|
|
@ -34,7 +34,7 @@ export const CASE_ID_INCREMENTER_SAVED_OBJECT = 'cases-incrementing-id' as const
|
|||
export const CASES_UI_SETTING_ID_DISPLAY_INCREMENTAL_ID = 'cases:incrementalIdDisplay:enabled';
|
||||
|
||||
/**
|
||||
* If more values are added here please also add them here: x-pack/test/cases_api_integration/common/plugins
|
||||
* If more values are added here please also add them here: x-pack/platform/test/cases_api_integration/common/plugins
|
||||
*/
|
||||
export const SAVED_OBJECT_TYPES = [
|
||||
CASE_SAVED_OBJECT,
|
||||
|
|
|
@ -12,7 +12,7 @@ import type { FtrConfigProviderContext } from '@kbn/test';
|
|||
import { findTestPluginPaths } from '@kbn/test';
|
||||
import { ScoutTestRunConfigCategory } from '@kbn/scout-info';
|
||||
|
||||
import { getAllExternalServiceSimulatorPaths } from '@kbn/test-suites-xpack-platform/alerting_api_integration/common/lib/actions_simulations_utils';
|
||||
import { getAllExternalServiceSimulatorPaths } from '../../alerting_api_integration/common/lib/actions_simulations_utils';
|
||||
import { services } from './services';
|
||||
|
||||
interface CreateTestConfigOptions {
|
||||
|
@ -93,10 +93,7 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions)
|
|||
.map((key) => `--xpack.${key}.enabled=false`),
|
||||
...findTestPluginPaths([
|
||||
path.resolve(__dirname, 'plugins'),
|
||||
path.resolve(
|
||||
__dirname,
|
||||
'../../../platform/test/alerting_api_integration/common/plugins'
|
||||
),
|
||||
path.resolve(__dirname, '../../alerting_api_integration/common/plugins'),
|
||||
]),
|
||||
`--xpack.actions.preconfigured=${JSON.stringify({
|
||||
'preconfigured-servicenow': {
|
|
@ -7,22 +7,9 @@
|
|||
|
||||
import expect from '@kbn/expect';
|
||||
import type SuperTest from 'supertest';
|
||||
import type { estypes } from '@elastic/elasticsearch';
|
||||
import type { ToolingLog } from '@kbn/tooling-log';
|
||||
import { DETECTION_ENGINE_QUERY_SIGNALS_URL } from '@kbn/security-solution-plugin/common/constants';
|
||||
import type { DetectionAlert } from '@kbn/security-solution-plugin/common/api/detection_engine';
|
||||
import type { RiskEnrichmentFields } from '@kbn/security-solution-plugin/server/lib/detection_engine/rule_types/utils/enrichments/types';
|
||||
import type { Case } from '@kbn/cases-plugin/common';
|
||||
import { AttachmentType } from '@kbn/cases-plugin/common';
|
||||
import { ALERT_CASE_IDS } from '@kbn/rule-data-utils';
|
||||
import {
|
||||
getRuleForAlertTesting,
|
||||
createRule,
|
||||
waitForRuleSuccess,
|
||||
waitForAlertsToBePresent,
|
||||
getAlertsByIds,
|
||||
getQueryAlertIds,
|
||||
} from '../../../common/utils/security_solution';
|
||||
import { superUser } from './authentication/users';
|
||||
import type { User } from './authentication/types';
|
||||
import { getSpaceUrlPrefix } from './api/helpers';
|
||||
|
@ -30,36 +17,6 @@ import { createCase, deleteCases } from './api/case';
|
|||
import { createComment, deleteAllComments } from './api';
|
||||
import { postCaseReq } from './mock';
|
||||
|
||||
export const createSecuritySolutionAlerts = async (
|
||||
supertest: SuperTest.Agent,
|
||||
log: ToolingLog,
|
||||
numberOfSignals: number = 1
|
||||
): Promise<estypes.SearchResponse<DetectionAlert & RiskEnrichmentFields>> => {
|
||||
const rule = {
|
||||
...getRuleForAlertTesting(['auditbeat-*']),
|
||||
query: 'process.executable: "/usr/bin/sudo"',
|
||||
};
|
||||
const { id } = await createRule(supertest, log, rule);
|
||||
await waitForRuleSuccess({ supertest, log, id });
|
||||
await waitForAlertsToBePresent(supertest, log, numberOfSignals, [id]);
|
||||
const signals = await getAlertsByIds(supertest, log, [id]);
|
||||
|
||||
return signals;
|
||||
};
|
||||
|
||||
export const getSecuritySolutionAlerts = async (
|
||||
supertest: SuperTest.Agent,
|
||||
alertIds: string[]
|
||||
): Promise<estypes.SearchResponse<DetectionAlert & RiskEnrichmentFields>> => {
|
||||
const { body: updatedAlert } = await supertest
|
||||
.post(DETECTION_ENGINE_QUERY_SIGNALS_URL)
|
||||
.set('kbn-xsrf', 'true')
|
||||
.send(getQueryAlertIds(alertIds))
|
||||
.expect(200);
|
||||
|
||||
return updatedAlert;
|
||||
};
|
||||
|
||||
interface AlertResponse {
|
||||
'kibana.alert.case_ids'?: string[];
|
||||
}
|
|
@ -13,12 +13,10 @@ import type {
|
|||
CasesPatchRequest,
|
||||
} from '@kbn/cases-plugin/common/types/api';
|
||||
import type SuperTest from 'supertest';
|
||||
import type { ToolingLog } from '@kbn/tooling-log';
|
||||
import type { User } from '../authentication/types';
|
||||
|
||||
import { superUser } from '../authentication/users';
|
||||
import { getSpaceUrlPrefix, setupAuth } from './helpers';
|
||||
import { waitFor } from '../../../../common/utils/security_solution/detections_response';
|
||||
|
||||
export const createCase = async (
|
||||
supertest: SuperTest.Agent,
|
||||
|
@ -41,18 +39,6 @@ export const createCase = async (
|
|||
return theCase;
|
||||
};
|
||||
|
||||
export const waitForCases = async (supertest: SuperTest.Agent, log: ToolingLog): Promise<void> => {
|
||||
await waitFor(
|
||||
async () => {
|
||||
const response = await getCases(supertest);
|
||||
const cases = response;
|
||||
return cases != null && cases.cases.length > 0 && cases?.cases[0]?.totalAlerts > 0;
|
||||
},
|
||||
'waitForCaseToAttachAlert',
|
||||
log
|
||||
);
|
||||
};
|
||||
|
||||
export const getCases = async (
|
||||
supertest: SuperTest.Agent,
|
||||
expectedHttpCode: number = 200,
|
|
@ -16,10 +16,6 @@ import type {
|
|||
ActionTypeExecutorResult,
|
||||
FindActionResult,
|
||||
} from '@kbn/actions-plugin/server/types';
|
||||
import {
|
||||
getServiceNowServer,
|
||||
RecordingServiceNowSimulator,
|
||||
} from '@kbn/test-suites-xpack-platform/alerting_api_integration/common/lib/actions_simulations_utils';
|
||||
import type {
|
||||
Case,
|
||||
CaseConnector,
|
||||
|
@ -31,7 +27,11 @@ import type {
|
|||
GetCaseConnectorsResponse,
|
||||
} from '@kbn/cases-plugin/common/types/api';
|
||||
import { camelCase, mapKeys } from 'lodash';
|
||||
import type { ObjectRemover as ActionsRemover } from '@kbn/test-suites-xpack-platform/alerting_api_integration/common/lib';
|
||||
import {
|
||||
getServiceNowServer,
|
||||
RecordingServiceNowSimulator,
|
||||
} from '../../../../alerting_api_integration/common/lib/actions_simulations_utils';
|
||||
import type { ObjectRemover as ActionsRemover } from '../../../../alerting_api_integration/common/lib';
|
||||
import type { User } from '../authentication/types';
|
||||
import { superUser } from '../authentication/users';
|
||||
import { getPostCaseRequest } from '../mock';
|
|
@ -29,7 +29,6 @@ import {
|
|||
} from '@kbn/cases-plugin/common/constants';
|
||||
import type { CaseMetricsFeature } from '@kbn/cases-plugin/common';
|
||||
import type { SingleCaseMetricsResponse, CasesMetricsResponse } from '@kbn/cases-plugin/common';
|
||||
import type { SignalHit } from '@kbn/security-solution-plugin/server/lib/detection_engine/rule_types/types';
|
||||
import type { CasePersistedAttributes } from '@kbn/cases-plugin/server/common/types/case';
|
||||
import type { SavedObjectsRawDocSource } from '@kbn/core/server';
|
||||
import type { ConfigurationPersistedAttributes } from '@kbn/cases-plugin/server/common/types/configure';
|
||||
|
@ -78,59 +77,6 @@ export * from './telemetry';
|
|||
|
||||
export { getSpaceUrlPrefix } from './helpers';
|
||||
|
||||
function toArray<T>(input: T | T[]): T[] {
|
||||
if (Array.isArray(input)) {
|
||||
return input;
|
||||
}
|
||||
return [input];
|
||||
}
|
||||
|
||||
/**
|
||||
* Query Elasticsearch for a set of signals within a set of indices
|
||||
*/
|
||||
// TODO: fix this to use new API/schema
|
||||
export const getSignalsWithES = async ({
|
||||
es,
|
||||
indices,
|
||||
ids,
|
||||
}: {
|
||||
es: Client;
|
||||
indices: string | string[];
|
||||
ids: string | string[];
|
||||
}): Promise<Map<string, Map<string, estypes.SearchHit<SignalHit>>>> => {
|
||||
const signals: TransportResult<estypes.SearchResponse<SignalHit>, unknown> = await es.search(
|
||||
{
|
||||
index: indices,
|
||||
body: {
|
||||
size: 10000,
|
||||
query: {
|
||||
bool: {
|
||||
filter: [
|
||||
{
|
||||
ids: {
|
||||
values: toArray(ids),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{ meta: true }
|
||||
);
|
||||
|
||||
return signals.body.hits.hits.reduce((acc, hit) => {
|
||||
let indexMap = acc.get(hit._index);
|
||||
if (indexMap === undefined) {
|
||||
indexMap = new Map<string, estypes.SearchHit<SignalHit>>([[hit._id!, hit]]);
|
||||
} else {
|
||||
indexMap.set(hit._id!, hit);
|
||||
}
|
||||
acc.set(hit._index, indexMap);
|
||||
return acc;
|
||||
}, new Map<string, Map<string, estypes.SearchHit<SignalHit>>>());
|
||||
};
|
||||
|
||||
interface SetStatusCasesParams {
|
||||
id: string;
|
||||
version: string;
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "../../../../../../tsconfig.base.json",
|
||||
"extends": "../../../../../../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "target/types",
|
||||
"isolatedModules": true
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "../../../../../../tsconfig.base.json",
|
||||
"extends": "../../../../../../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "target/types",
|
||||
"isolatedModules": true
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": "../../../../../../tsconfig.base.json",
|
||||
"extends": "../../../../../../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "target/types",
|
||||
"isolatedModules": true
|
951
x-pack/platform/test/cases_api_integration/common/roles.ts
Normal file
951
x-pack/platform/test/cases_api_integration/common/roles.ts
Normal file
|
@ -0,0 +1,951 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import type { Role } from './lib/authentication/types';
|
||||
|
||||
/**
|
||||
* Roles for Cases in Security Solution
|
||||
*/
|
||||
|
||||
export const secAllCasesOnlyDelete: Role = {
|
||||
name: 'sec_all_cases_only_delete_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
siem: ['all'],
|
||||
securitySolutionCases: ['cases_delete'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const secAllCasesOnlyReadDelete: Role = {
|
||||
name: 'sec_all_cases_only_read_delete_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
siem: ['all'],
|
||||
securitySolutionCases: ['read', 'cases_delete'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const secAllCasesNoDelete: Role = {
|
||||
name: 'sec_all_cases_no_delete_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
siem: ['all'],
|
||||
securitySolutionCases: ['minimal_all'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const secAll: Role = {
|
||||
name: 'sec_all_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
siem: ['all'],
|
||||
securitySolutionCases: ['all'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const secCasesV2All: Role = {
|
||||
name: 'sec_cases_v2_all_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
siem: ['all'],
|
||||
securitySolutionCasesV2: ['all'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const secCasesV3All: Role = {
|
||||
name: 'sec_cases_v3_all_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
siem: ['all'],
|
||||
securitySolutionCasesV3: ['all'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const secCasesV2NoReopenWithCreateComment: Role = {
|
||||
name: 'sec_cases_v2_no_reopen_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
siem: ['all'],
|
||||
securitySolutionCasesV2: ['read', 'update', 'create', 'cases_delete', 'create_comment'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const secCasesV2NoCreateCommentWithReopen: Role = {
|
||||
name: 'sec_cases_v2_create_comment_no_reopen_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
siem: ['all'],
|
||||
securitySolutionCasesV2: ['read', 'update', 'create', 'delete', 'case_reopen'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const secAllSpace1: Role = {
|
||||
name: 'sec_all_role_space1_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
siem: ['all'],
|
||||
securitySolutionCases: ['all'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['space1'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const secAllCasesRead: Role = {
|
||||
name: 'sec_all_cases_read_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
siem: ['all'],
|
||||
securitySolutionCases: ['read'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const secAllCasesNone: Role = {
|
||||
name: 'sec_all_cases_none_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
siem: ['all'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const secReadCasesAll: Role = {
|
||||
name: 'sec_read_cases_all_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
siem: ['read'],
|
||||
securitySolutionCases: ['all'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const secReadCasesRead: Role = {
|
||||
name: 'sec_read_cases_read_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
siem: ['read'],
|
||||
securitySolutionCases: ['read'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const secRead: Role = {
|
||||
name: 'sec_read_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
siem: ['read'],
|
||||
securitySolutionCases: ['read'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const secReadCasesNone: Role = {
|
||||
name: 'sec_read_cases_none_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
siem: ['read'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const secNone: Role = {
|
||||
name: 'sec_none_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
siem: [],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Roles for Cases in the stack
|
||||
*/
|
||||
|
||||
export const casesOnlyDelete: Role = {
|
||||
name: 'cases_only_delete_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
generalCases: ['cases_delete'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const casesOnlyReadDelete: Role = {
|
||||
name: 'cases_only_read_delete_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
generalCases: ['read', 'cases_delete'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const casesNoDelete: Role = {
|
||||
name: 'cases_no_delete_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
generalCases: ['minimal_all'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const casesAll: Role = {
|
||||
name: 'cases_all_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
generalCases: ['all'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const casesV2All: Role = {
|
||||
name: 'cases_v2_all_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
spaces: ['*'],
|
||||
base: [],
|
||||
feature: {
|
||||
generalCasesV2: ['all'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const casesV3All: Role = {
|
||||
name: 'cases_v3_all_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
spaces: ['*'],
|
||||
base: [],
|
||||
feature: {
|
||||
generalCasesV3: ['all'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const casesV3NoAssignee: Role = {
|
||||
name: 'cases_v3_no_assignee_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
spaces: ['*'],
|
||||
base: [],
|
||||
feature: {
|
||||
generalCasesV3: ['minimal_read', 'cases_delete', 'case_reopen', 'create_comment'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const casesV3ReadAndAssignee: Role = {
|
||||
name: 'cases_v3_read_assignee_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
spaces: ['*'],
|
||||
base: [],
|
||||
feature: {
|
||||
generalCasesV3: ['minimal_read', 'cases_assign'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const casesV2NoReopenWithCreateComment: Role = {
|
||||
name: 'cases_v2_no_reopen_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
spaces: ['*'],
|
||||
base: [],
|
||||
feature: {
|
||||
generalCasesV2: ['read', 'update', 'create', 'cases_delete', 'create_comment'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const casesV2NoCreateCommentWithReopen: Role = {
|
||||
name: 'cases_v2_no_create_comment_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
spaces: ['*'],
|
||||
base: [],
|
||||
feature: {
|
||||
generalCasesV2: ['read', 'update', 'create', 'cases_delete', 'case_reopen'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const casesRead: Role = {
|
||||
name: 'cases_read_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
generalCases: ['read'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* Roles for Cases in Observability
|
||||
*/
|
||||
|
||||
export const obsCasesOnlyDelete: Role = {
|
||||
name: 'obs_cases_only_delete_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
observabilityCases: ['cases_delete'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const obsCasesOnlyReadDelete: Role = {
|
||||
name: 'obs_cases_only_read_delete_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
observabilityCases: ['read', 'cases_delete'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const obsCasesNoDelete: Role = {
|
||||
name: 'obs_cases_no_delete_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
observabilityCases: ['minimal_all'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const obsCasesAll: Role = {
|
||||
name: 'obs_cases_all_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
observabilityCases: ['all'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const obsCasesV2All: Role = {
|
||||
name: 'obs_cases_v2_all_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
spaces: ['*'],
|
||||
base: [],
|
||||
feature: {
|
||||
observabilityCasesV2: ['all'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const obsCasesV3All: Role = {
|
||||
name: 'obs_cases_v3_all_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
spaces: ['*'],
|
||||
base: [],
|
||||
feature: {
|
||||
observabilityCasesV3: ['all'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const obsCasesV2NoReopenWithCreateComment: Role = {
|
||||
name: 'obs_cases_v2_no_reopen_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
spaces: ['*'],
|
||||
base: [],
|
||||
feature: {
|
||||
observabilityCasesV2: [
|
||||
'read',
|
||||
'cases_update',
|
||||
'create',
|
||||
'cases_delete',
|
||||
'create_comment',
|
||||
],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const obsCasesV2NoCreateCommentWithReopen: Role = {
|
||||
name: 'obs_cases_v2_no_create_comment_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
spaces: ['*'],
|
||||
base: [],
|
||||
feature: {
|
||||
observabilityCasesV2: ['read', 'update', 'create', 'cases_delete', 'case_reopen'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const obsCasesRead: Role = {
|
||||
name: 'obs_cases_read_role_api_int',
|
||||
privileges: {
|
||||
elasticsearch: {
|
||||
indices: [
|
||||
{
|
||||
names: ['*'],
|
||||
privileges: ['all'],
|
||||
},
|
||||
],
|
||||
},
|
||||
kibana: [
|
||||
{
|
||||
feature: {
|
||||
observabilityCases: ['read'],
|
||||
actions: ['all'],
|
||||
actionsSimulators: ['all'],
|
||||
},
|
||||
spaces: ['*'],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const roles = [
|
||||
secAllCasesOnlyDelete,
|
||||
secAllCasesOnlyReadDelete,
|
||||
secAllCasesNoDelete,
|
||||
secAll,
|
||||
secCasesV2All,
|
||||
secCasesV3All,
|
||||
secCasesV2NoReopenWithCreateComment,
|
||||
secCasesV2NoCreateCommentWithReopen,
|
||||
secAllSpace1,
|
||||
secAllCasesRead,
|
||||
secAllCasesNone,
|
||||
secReadCasesAll,
|
||||
secReadCasesRead,
|
||||
secReadCasesNone,
|
||||
secRead,
|
||||
casesOnlyDelete,
|
||||
casesOnlyReadDelete,
|
||||
casesNoDelete,
|
||||
casesAll,
|
||||
casesV2All,
|
||||
casesV3All,
|
||||
casesV3NoAssignee,
|
||||
casesV3ReadAndAssignee,
|
||||
casesV2NoReopenWithCreateComment,
|
||||
casesV2NoCreateCommentWithReopen,
|
||||
casesRead,
|
||||
obsCasesOnlyDelete,
|
||||
obsCasesOnlyReadDelete,
|
||||
obsCasesNoDelete,
|
||||
obsCasesAll,
|
||||
obsCasesV2All,
|
||||
obsCasesV3All,
|
||||
obsCasesV2NoReopenWithCreateComment,
|
||||
obsCasesV2NoCreateCommentWithReopen,
|
||||
obsCasesRead,
|
||||
];
|
331
x-pack/platform/test/cases_api_integration/common/users.ts
Normal file
331
x-pack/platform/test/cases_api_integration/common/users.ts
Normal file
|
@ -0,0 +1,331 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import type { User } from './lib/authentication/types';
|
||||
import {
|
||||
casesAll,
|
||||
casesV2All,
|
||||
casesV3All,
|
||||
casesV3NoAssignee,
|
||||
casesV3ReadAndAssignee,
|
||||
casesNoDelete,
|
||||
casesOnlyDelete,
|
||||
casesOnlyReadDelete,
|
||||
casesRead,
|
||||
obsCasesAll,
|
||||
obsCasesV2All,
|
||||
obsCasesV3All,
|
||||
obsCasesNoDelete,
|
||||
obsCasesOnlyDelete,
|
||||
obsCasesOnlyReadDelete,
|
||||
obsCasesRead,
|
||||
secAll,
|
||||
secCasesV2All,
|
||||
secCasesV3All,
|
||||
secAllCasesNoDelete,
|
||||
secAllCasesNone,
|
||||
secAllCasesOnlyDelete,
|
||||
secAllCasesOnlyReadDelete,
|
||||
secAllCasesRead,
|
||||
secAllSpace1,
|
||||
secRead,
|
||||
secReadCasesAll,
|
||||
secReadCasesNone,
|
||||
secReadCasesRead,
|
||||
secNone,
|
||||
casesV2NoReopenWithCreateComment,
|
||||
obsCasesV2NoReopenWithCreateComment,
|
||||
secCasesV2NoReopenWithCreateComment,
|
||||
secCasesV2NoCreateCommentWithReopen,
|
||||
casesV2NoCreateCommentWithReopen,
|
||||
obsCasesV2NoCreateCommentWithReopen,
|
||||
} from './roles';
|
||||
|
||||
/**
|
||||
* Users for Cases in Security Solution
|
||||
*/
|
||||
|
||||
export const secAllCasesOnlyDeleteUser: User = {
|
||||
username: 'sec_all_cases_only_delete_user_api_int',
|
||||
password: 'password',
|
||||
roles: [secAllCasesOnlyDelete.name],
|
||||
};
|
||||
|
||||
export const secAllCasesOnlyReadDeleteUser: User = {
|
||||
username: 'sec_all_cases_only_read_delete_user_api_int',
|
||||
password: 'password',
|
||||
roles: [secAllCasesOnlyReadDelete.name],
|
||||
};
|
||||
|
||||
export const secAllCasesNoDeleteUser: User = {
|
||||
username: 'sec_all_cases_no_delete_user_api_int',
|
||||
password: 'password',
|
||||
roles: [secAllCasesNoDelete.name],
|
||||
};
|
||||
|
||||
export const secAllUser: User = {
|
||||
username: 'sec_all_user_api_int',
|
||||
password: 'password',
|
||||
roles: [secAll.name],
|
||||
};
|
||||
|
||||
export const secCasesV2AllUser: User = {
|
||||
username: 'sec_cases_v2_all_user_api_int',
|
||||
password: 'password',
|
||||
roles: [secCasesV2All.name],
|
||||
};
|
||||
|
||||
export const secCasesV3AllUser: User = {
|
||||
username: 'sec_cases_v3_all_user_api_int',
|
||||
password: 'password',
|
||||
roles: [secCasesV3All.name],
|
||||
};
|
||||
|
||||
export const secCasesV2NoReopenWithCreateCommentUser: User = {
|
||||
username: 'sec_cases_v2_no_reopen_with_create_comment_user_api_int',
|
||||
password: 'password',
|
||||
roles: [secCasesV2NoReopenWithCreateComment.name],
|
||||
};
|
||||
|
||||
export const secCasesV2NoCreateCommentWithReopenUser: User = {
|
||||
username: 'sec_cases_v2_no_create_comment_with_reopen_user_api_int',
|
||||
password: 'password',
|
||||
roles: [secCasesV2NoCreateCommentWithReopen.name],
|
||||
};
|
||||
|
||||
export const secAllSpace1User: User = {
|
||||
username: 'sec_all_space1_user_api_int',
|
||||
password: 'password',
|
||||
roles: [secAllSpace1.name],
|
||||
};
|
||||
|
||||
export const secAllCasesReadUser: User = {
|
||||
username: 'sec_all_cases_read_user_api_int',
|
||||
password: 'password',
|
||||
roles: [secAllCasesRead.name],
|
||||
};
|
||||
|
||||
export const secAllCasesNoneUser: User = {
|
||||
username: 'sec_all_cases_none_user_api_int',
|
||||
password: 'password',
|
||||
roles: [secAllCasesNone.name],
|
||||
};
|
||||
|
||||
export const secReadCasesAllUser: User = {
|
||||
username: 'sec_read_cases_all_user_api_int',
|
||||
password: 'password',
|
||||
roles: [secReadCasesAll.name],
|
||||
};
|
||||
|
||||
export const secReadCasesReadUser: User = {
|
||||
username: 'sec_read_cases_read_user_api_int',
|
||||
password: 'password',
|
||||
roles: [secReadCasesRead.name],
|
||||
};
|
||||
|
||||
export const secReadUser: User = {
|
||||
username: 'sec_read_user_api_int',
|
||||
password: 'password',
|
||||
roles: [secRead.name],
|
||||
};
|
||||
|
||||
export const secNoneUser: User = {
|
||||
username: 'sec_none_user_api_int',
|
||||
password: 'password',
|
||||
roles: [secNone.name],
|
||||
};
|
||||
|
||||
export const secReadCasesNoneUser: User = {
|
||||
username: 'sec_read_cases_none_user_api_int',
|
||||
password: 'password',
|
||||
roles: [secReadCasesNone.name],
|
||||
};
|
||||
|
||||
/**
|
||||
* Users for Cases in the Stack
|
||||
*/
|
||||
|
||||
export const casesOnlyDeleteUser: User = {
|
||||
username: 'cases_only_delete_user_api_int',
|
||||
password: 'password',
|
||||
roles: [casesOnlyDelete.name],
|
||||
};
|
||||
|
||||
export const casesOnlyReadDeleteUser: User = {
|
||||
username: 'cases_only_read_delete_user_api_int',
|
||||
password: 'password',
|
||||
roles: [casesOnlyReadDelete.name],
|
||||
};
|
||||
|
||||
export const casesNoDeleteUser: User = {
|
||||
username: 'cases_no_delete_user_api_int',
|
||||
password: 'password',
|
||||
roles: [casesNoDelete.name],
|
||||
};
|
||||
|
||||
export const casesAllUser: User = {
|
||||
username: 'cases_all_user_api_int',
|
||||
password: 'password',
|
||||
roles: [casesAll.name],
|
||||
};
|
||||
|
||||
export const casesV2AllUser: User = {
|
||||
username: 'cases_v2_all_user_api_int',
|
||||
password: 'password',
|
||||
roles: [casesV2All.name],
|
||||
};
|
||||
|
||||
export const casesV3AllUser: User = {
|
||||
username: 'cases_v3_all_user_api_int',
|
||||
password: 'password',
|
||||
roles: [casesV3All.name],
|
||||
};
|
||||
|
||||
export const casesV3NoAssigneeUser: User = {
|
||||
username: 'cases_v3_no_assignee_user_api_int',
|
||||
password: 'password',
|
||||
roles: [casesV3NoAssignee.name],
|
||||
};
|
||||
|
||||
export const casesV3ReadAndAssignUser: User = {
|
||||
username: 'cases_v3_read_and_assignee_user_api_int',
|
||||
password: 'password',
|
||||
roles: [casesV3ReadAndAssignee.name],
|
||||
};
|
||||
|
||||
export const casesV2NoReopenWithCreateCommentUser: User = {
|
||||
username: 'cases_v2_no_reopen_with_create_comment_user_api_int',
|
||||
password: 'password',
|
||||
roles: [casesV2NoReopenWithCreateComment.name],
|
||||
};
|
||||
|
||||
export const casesV2NoCreateCommentWithReopenUser: User = {
|
||||
username: 'cases_v2_no_create_comment_with_reopen_user_api_int',
|
||||
password: 'password',
|
||||
roles: [casesV2NoCreateCommentWithReopen.name],
|
||||
};
|
||||
|
||||
export const casesReadUser: User = {
|
||||
username: 'cases_read_user_api_int',
|
||||
password: 'password',
|
||||
roles: [casesRead.name],
|
||||
};
|
||||
|
||||
/**
|
||||
* Users for Cases in Observability
|
||||
*/
|
||||
|
||||
export const obsCasesOnlyDeleteUser: User = {
|
||||
username: 'obs_cases_only_delete_user_api_int',
|
||||
password: 'password',
|
||||
roles: [obsCasesOnlyDelete.name],
|
||||
};
|
||||
|
||||
export const obsCasesOnlyReadDeleteUser: User = {
|
||||
username: 'obs_cases_only_read_delete_user_api_int',
|
||||
password: 'password',
|
||||
roles: [obsCasesOnlyReadDelete.name],
|
||||
};
|
||||
|
||||
export const obsCasesNoDeleteUser: User = {
|
||||
username: 'obs_cases_no_delete_user_api_int',
|
||||
password: 'password',
|
||||
roles: [obsCasesNoDelete.name],
|
||||
};
|
||||
|
||||
export const obsCasesAllUser: User = {
|
||||
username: 'obs_cases_all_user_api_int',
|
||||
password: 'password',
|
||||
roles: [obsCasesAll.name],
|
||||
};
|
||||
|
||||
export const obsCasesV2AllUser: User = {
|
||||
username: 'obs_cases_v2_all_user_api_int',
|
||||
password: 'password',
|
||||
roles: [obsCasesV2All.name],
|
||||
};
|
||||
|
||||
export const obsCasesV3AllUser: User = {
|
||||
username: 'obs_cases_v3_all_user_api_int',
|
||||
password: 'password',
|
||||
roles: [obsCasesV3All.name],
|
||||
};
|
||||
|
||||
export const obsCasesV2NoReopenWithCreateCommentUser: User = {
|
||||
username: 'obs_cases_v2_no_reopen_with_create_comment_user_api_int',
|
||||
password: 'password',
|
||||
roles: [obsCasesV2NoReopenWithCreateComment.name],
|
||||
};
|
||||
|
||||
export const obsCasesV2NoCreateCommentWithReopenUser: User = {
|
||||
username: 'obs_cases_v2_no_create_comment_with_reopen_user_api_int',
|
||||
password: 'password',
|
||||
roles: [obsCasesV2NoCreateCommentWithReopen.name],
|
||||
};
|
||||
|
||||
export const obsCasesReadUser: User = {
|
||||
username: 'obs_cases_read_user_api_int',
|
||||
password: 'password',
|
||||
roles: [obsCasesRead.name],
|
||||
};
|
||||
|
||||
/**
|
||||
* Users for Observability and Security Solution
|
||||
*/
|
||||
|
||||
export const obsSecCasesAllUser: User = {
|
||||
username: 'obs_sec_cases_all_user_api_int',
|
||||
password: 'password',
|
||||
roles: [obsCasesAll.name, secAll.name],
|
||||
};
|
||||
|
||||
export const obsSecCasesReadUser: User = {
|
||||
username: 'obs_sec_cases_read_user_api_int',
|
||||
password: 'password',
|
||||
roles: [obsCasesRead.name, secRead.name],
|
||||
};
|
||||
|
||||
export const users = [
|
||||
secAllCasesOnlyDeleteUser,
|
||||
secAllCasesOnlyReadDeleteUser,
|
||||
secAllCasesNoDeleteUser,
|
||||
secAllUser,
|
||||
secCasesV2AllUser,
|
||||
secCasesV3AllUser,
|
||||
secCasesV2NoReopenWithCreateCommentUser,
|
||||
secCasesV2NoCreateCommentWithReopenUser,
|
||||
secAllSpace1User,
|
||||
secAllCasesReadUser,
|
||||
secAllCasesNoneUser,
|
||||
secReadCasesAllUser,
|
||||
secReadCasesReadUser,
|
||||
secReadUser,
|
||||
secNoneUser,
|
||||
secReadCasesNoneUser,
|
||||
casesOnlyDeleteUser,
|
||||
casesOnlyReadDeleteUser,
|
||||
casesNoDeleteUser,
|
||||
casesAllUser,
|
||||
casesV2AllUser,
|
||||
casesV3AllUser,
|
||||
casesV3NoAssigneeUser,
|
||||
casesV3ReadAndAssignUser,
|
||||
casesV2NoReopenWithCreateCommentUser,
|
||||
casesV2NoCreateCommentWithReopenUser,
|
||||
casesReadUser,
|
||||
obsCasesOnlyDeleteUser,
|
||||
obsCasesOnlyReadDeleteUser,
|
||||
obsCasesNoDeleteUser,
|
||||
obsCasesAllUser,
|
||||
obsCasesV2AllUser,
|
||||
obsCasesV3AllUser,
|
||||
obsCasesV2NoReopenWithCreateCommentUser,
|
||||
obsCasesV2NoCreateCommentWithReopenUser,
|
||||
obsCasesReadUser,
|
||||
obsSecCasesAllUser,
|
||||
obsSecCasesReadUser,
|
||||
];
|
|
@ -15,7 +15,7 @@ export default ({ getService }: FtrProviderContext): void => {
|
|||
|
||||
/**
|
||||
* Attachment types are being registered in
|
||||
* x-pack/test/cases_api_integration/common/plugins/cases/server/plugin.ts
|
||||
* x-pack/platform/test/cases_api_integration/common/plugins/cases/server/plugin.ts
|
||||
*/
|
||||
describe('Persistable state attachments', () => {
|
||||
// This test is intended to fail when new persistable state attachment types are registered.
|
|
@ -17,7 +17,7 @@ export default ({ getService }: FtrProviderContext): void => {
|
|||
describe('get_connectors', () => {
|
||||
/**
|
||||
* A ServiceNow preconfigured connector is registered here
|
||||
* x-pack/test/cases_api_integration/common/config.ts
|
||||
* x-pack/platform/test/cases_api_integration/common/config.ts
|
||||
*
|
||||
* The license for this test is set to basic. ServiceNow connectors
|
||||
* needs license >= platinum. The test below ensures
|
|
@ -41,7 +41,7 @@ export default ({ getService }: FtrProviderContext): void => {
|
|||
|
||||
/**
|
||||
* Attachment types are being registered in
|
||||
* x-pack/test/cases_api_integration/common/plugins/cases/server/plugin.ts
|
||||
* x-pack/platform/test/cases_api_integration/common/plugins/cases/server/plugin.ts
|
||||
*/
|
||||
describe('External references', () => {
|
||||
afterEach(async () => {
|
|
@ -39,7 +39,7 @@ export default ({ getService }: FtrProviderContext): void => {
|
|||
|
||||
/**
|
||||
* Attachment types are being registered in
|
||||
* x-pack/test/cases_api_integration/common/plugins/cases/server/plugin.ts
|
||||
* x-pack/platform/test/cases_api_integration/common/plugins/cases/server/plugin.ts
|
||||
*/
|
||||
describe('Persistable state attachments', () => {
|
||||
describe('references', () => {
|
|
@ -44,7 +44,7 @@ export default ({ getService }: FtrProviderContext): void => {
|
|||
* is to test the bulkCreate method of the cases client in
|
||||
* x-pack/platform/plugins/shared/cases/server/client/cases/bulk_create.ts
|
||||
*
|
||||
* The test route is configured here x-pack/test/cases_api_integration/common/plugins/cases/server/routes.ts
|
||||
* The test route is configured here x-pack/platform/test/cases_api_integration/common/plugins/cases/server/routes.ts
|
||||
*/
|
||||
describe('bulk_create_cases', () => {
|
||||
const bulkCreateCases = async ({
|
|
@ -31,7 +31,7 @@ import type {
|
|||
PushedUserAction,
|
||||
} from '@kbn/cases-plugin/common/types/domain';
|
||||
import type { CasePostRequest } from '@kbn/cases-plugin/common';
|
||||
import { ObjectRemover as ActionsRemover } from '@kbn/test-suites-xpack-platform/alerting_api_integration/common/lib';
|
||||
import { ObjectRemover as ActionsRemover } from '../../../../../alerting_api_integration/common/lib';
|
||||
import {
|
||||
deleteAllCaseItems,
|
||||
createCase,
|
|
@ -12,7 +12,7 @@ import {
|
|||
CustomFieldTypes,
|
||||
} from '@kbn/cases-plugin/common/types/domain';
|
||||
import type { ConfigurationPatchRequest } from '@kbn/cases-plugin/common/types/api';
|
||||
import { ObjectRemover as ActionsRemover } from '@kbn/test-suites-xpack-platform/alerting_api_integration/common/lib';
|
||||
import { ObjectRemover as ActionsRemover } from '../../../../../alerting_api_integration/common/lib';
|
||||
import type { FtrProviderContext } from '../../../../common/ftr_provider_context';
|
||||
|
||||
import {
|
|
@ -12,7 +12,7 @@ import {
|
|||
CustomFieldTypes,
|
||||
} from '@kbn/cases-plugin/common/types/domain';
|
||||
import { MAX_CUSTOM_FIELD_LABEL_LENGTH } from '@kbn/cases-plugin/common/constants';
|
||||
import { ObjectRemover as ActionsRemover } from '@kbn/test-suites-xpack-platform/alerting_api_integration/common/lib';
|
||||
import { ObjectRemover as ActionsRemover } from '../../../../../alerting_api_integration/common/lib';
|
||||
import type { FtrProviderContext } from '../../../../common/ftr_provider_context';
|
||||
|
||||
import {
|
|
@ -13,22 +13,16 @@ export default ({ loadTestFile }: FtrProviderContext): void => {
|
|||
/**
|
||||
* Public routes
|
||||
*/
|
||||
loadTestFile(require.resolve('./client/update_alert_status'));
|
||||
loadTestFile(require.resolve('./comments/delete_comment'));
|
||||
loadTestFile(require.resolve('./comments/delete_comments'));
|
||||
loadTestFile(require.resolve('./comments/find_comments'));
|
||||
loadTestFile(require.resolve('./comments/get_comment'));
|
||||
loadTestFile(require.resolve('./comments/get_all_comments'));
|
||||
loadTestFile(require.resolve('./comments/patch_comment'));
|
||||
loadTestFile(require.resolve('./comments/post_comment'));
|
||||
loadTestFile(require.resolve('./files/post_file'));
|
||||
loadTestFile(require.resolve('./alerts/get_cases'));
|
||||
loadTestFile(require.resolve('./alerts/get_alerts_attached_to_case'));
|
||||
loadTestFile(require.resolve('./cases/delete_cases'));
|
||||
loadTestFile(require.resolve('./cases/import_export'));
|
||||
loadTestFile(require.resolve('./cases/find_cases'));
|
||||
loadTestFile(require.resolve('./cases/get_case'));
|
||||
loadTestFile(require.resolve('./cases/patch_cases'));
|
||||
loadTestFile(require.resolve('./cases/post_case'));
|
||||
loadTestFile(require.resolve('./cases/resolve_case'));
|
||||
loadTestFile(require.resolve('./cases/reporters/get_reporters'));
|
||||
|
@ -50,7 +44,6 @@ export default ({ loadTestFile }: FtrProviderContext): void => {
|
|||
/**
|
||||
* Internal routes
|
||||
*/
|
||||
loadTestFile(require.resolve('./internal/bulk_create_attachments'));
|
||||
loadTestFile(require.resolve('./internal/bulk_get_cases'));
|
||||
loadTestFile(require.resolve('./internal/bulk_get_attachments'));
|
||||
loadTestFile(require.resolve('./internal/get_connectors'));
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
|
||||
import type { FtrProviderContext } from '../../../../common/ftr_provider_context';
|
||||
import {
|
||||
createSpacesAndUsers,
|
||||
deleteSpacesAndUsers,
|
||||
activateUserProfiles,
|
||||
} from '../../../../common/lib/authentication';
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default ({ loadTestFile, getService }: FtrProviderContext): void => {
|
||||
describe('cases security and spaces enabled: trial', function () {
|
||||
before(async () => {
|
||||
await createSpacesAndUsers(getService);
|
||||
// once a user profile is created the only way to remove it is to delete the user and roles, so best to activate
|
||||
// before all the tests
|
||||
await activateUserProfiles(getService);
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await deleteSpacesAndUsers(getService);
|
||||
});
|
||||
|
||||
loadTestFile(require.resolve('..'));
|
||||
});
|
||||
};
|
|
@ -41,8 +41,8 @@ import {
|
|||
secAllUser,
|
||||
secReadUser,
|
||||
users as api_int_users,
|
||||
} from '../../../../../api_integration/apis/cases/common/users';
|
||||
import { roles as api_int_roles } from '../../../../../api_integration/apis/cases/common/roles';
|
||||
} from '../../../../common/users';
|
||||
import { roles as api_int_roles } from '../../../../common/roles';
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default ({ getService }: FtrProviderContext): void => {
|
|
@ -8,7 +8,7 @@
|
|||
import expect from '@kbn/expect';
|
||||
import { ConnectorTypes } from '@kbn/cases-plugin/common/types/domain';
|
||||
import { CaseMetricsFeature } from '@kbn/cases-plugin/common';
|
||||
import { ObjectRemover as ActionsRemover } from '@kbn/test-suites-xpack-platform/alerting_api_integration/common/lib';
|
||||
import { ObjectRemover as ActionsRemover } from '../../../../../../alerting_api_integration/common/lib';
|
||||
import { getPostCaseRequest } from '../../../../../common/lib/mock';
|
||||
|
||||
import type { FtrProviderContext } from '../../../../../common/ftr_provider_context';
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue