forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
app features configs relocation to package
- Loading branch information
Showing
52 changed files
with
711 additions
and
702 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 0 additions & 19 deletions
19
x-pack/packages/security-solution/features/mocks/context.ts
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
x-pack/packages/security-solution/features/src/__mocks__/context.tsx
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
x-pack/packages/security-solution/features/src/__mocks__/navigation.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
x-pack/packages/security-solution/features/src/assistant/app_feature_config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* 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 { AssistantSubFeatureId } from '../app_features_keys'; | ||
import { AppFeatureAssistantKey } from '../app_features_keys'; | ||
import type { AppFeatureKibanaConfig } from '../types'; | ||
|
||
/** | ||
* App features privileges configuration for the Security Assistant Kibana Feature app. | ||
* These are the configs that are shared between both offering types (ess and serverless). | ||
* They can be extended on each offering plugin to register privileges using different way on each offering type. | ||
* | ||
* Privileges can be added in different ways: | ||
* - `privileges`: the privileges that will be added directly into the main Security feature. | ||
* - `subFeatureIds`: the ids of the sub-features that will be added into the Security subFeatures entry. | ||
* - `subFeaturesPrivileges`: the privileges that will be added into the existing Security subFeature with the privilege `id` specified. | ||
*/ | ||
export const assistantDefaultAppFeaturesConfig: Record< | ||
AppFeatureAssistantKey, | ||
AppFeatureKibanaConfig<AssistantSubFeatureId> | ||
> = { | ||
[AppFeatureAssistantKey.assistant]: { | ||
privileges: { | ||
all: { | ||
ui: ['ai-assistant'], | ||
}, | ||
}, | ||
}, | ||
}; |
19 changes: 19 additions & 0 deletions
19
x-pack/packages/security-solution/features/src/assistant/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* 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 { AssistantSubFeatureId } from '../app_features_keys'; | ||
import type { AppFeatureParams } from '../types'; | ||
import { getAssistantBaseKibanaFeature } from './kibana_features'; | ||
import { | ||
getAssistantBaseKibanaSubFeatureIds, | ||
assistantSubFeaturesMap, | ||
} from './kibana_sub_features'; | ||
|
||
export const getAssistantFeature = (): AppFeatureParams<AssistantSubFeatureId> => ({ | ||
baseKibanaFeature: getAssistantBaseKibanaFeature(), | ||
baseKibanaSubFeatureIds: getAssistantBaseKibanaSubFeatureIds(), | ||
subFeaturesMap: assistantSubFeaturesMap, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
x-pack/packages/security-solution/features/src/cases/app_feature_config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* 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 { AppFeatureCasesKey } from '../app_features_keys'; | ||
import { APP_ID } from '../constants'; | ||
import type { DefaultCasesAppFeaturesConfig } from './types'; | ||
|
||
/** | ||
* App features privileges configuration for the Security Cases Kibana Feature app. | ||
* These are the configs that are shared between both offering types (ess and serverless). | ||
* They can be extended on each offering plugin to register privileges using different way on each offering type. | ||
* | ||
* Privileges can be added in different ways: | ||
* - `privileges`: the privileges that will be added directly into the main Security feature. | ||
* - `subFeatureIds`: the ids of the sub-features that will be added into the Security subFeatures entry. | ||
* - `subFeaturesPrivileges`: the privileges that will be added into the existing Security subFeature with the privilege `id` specified. | ||
*/ | ||
export const getCasesDefaultAppFeaturesConfig = ({ | ||
apiTags, | ||
uiCapabilities, | ||
}: { | ||
apiTags: { connectors: string }; | ||
uiCapabilities: { connectors: string }; | ||
}): DefaultCasesAppFeaturesConfig => ({ | ||
[AppFeatureCasesKey.casesConnectors]: { | ||
privileges: { | ||
all: { | ||
api: [apiTags.connectors], | ||
ui: [uiCapabilities.connectors], | ||
cases: { | ||
push: [APP_ID], | ||
}, | ||
}, | ||
read: { | ||
api: [apiTags.connectors], | ||
ui: [uiCapabilities.connectors], | ||
}, | ||
}, | ||
}, | ||
}); |
19 changes: 19 additions & 0 deletions
19
x-pack/packages/security-solution/features/src/cases/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* 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 { CasesSubFeatureId } from '../app_features_keys'; | ||
import type { AppFeatureParams } from '../types'; | ||
import { getCasesBaseKibanaFeature } from './kibana_features'; | ||
import { getCasesBaseKibanaSubFeatureIds, getCasesSubFeaturesMap } from './kibana_sub_features'; | ||
import type { CasesFeatureParams } from './types'; | ||
|
||
export const getCasesFeature = ( | ||
params: CasesFeatureParams | ||
): AppFeatureParams<CasesSubFeatureId> => ({ | ||
baseKibanaFeature: getCasesBaseKibanaFeature(params), | ||
baseKibanaSubFeatureIds: getCasesBaseKibanaSubFeatureIds(), | ||
subFeaturesMap: getCasesSubFeaturesMap(params), | ||
}); |
61 changes: 61 additions & 0 deletions
61
x-pack/packages/security-solution/features/src/cases/kibana_features.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* 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 { i18n } from '@kbn/i18n'; | ||
|
||
import { DEFAULT_APP_CATEGORIES } from '@kbn/core-application-common'; | ||
import type { BaseKibanaFeatureConfig } from '../types'; | ||
import { APP_ID, CASES_FEATURE_ID } from '../constants'; | ||
import type { CasesFeatureParams } from './types'; | ||
|
||
export const getCasesBaseKibanaFeature = ({ | ||
uiCapabilities, | ||
apiTags, | ||
savedObjects, | ||
}: CasesFeatureParams): BaseKibanaFeatureConfig => { | ||
return { | ||
id: CASES_FEATURE_ID, | ||
name: i18n.translate('xpack.securitySolution.featureRegistry.linkSecuritySolutionCaseTitle', { | ||
defaultMessage: 'Cases', | ||
}), | ||
order: 1100, | ||
category: DEFAULT_APP_CATEGORIES.security, | ||
app: [CASES_FEATURE_ID, 'kibana'], | ||
catalogue: [APP_ID], | ||
cases: [APP_ID], | ||
privileges: { | ||
all: { | ||
api: apiTags.all, | ||
app: [CASES_FEATURE_ID, 'kibana'], | ||
catalogue: [APP_ID], | ||
cases: { | ||
create: [APP_ID], | ||
read: [APP_ID], | ||
update: [APP_ID], | ||
}, | ||
savedObject: { | ||
all: [...savedObjects.files], | ||
read: [...savedObjects.files], | ||
}, | ||
ui: uiCapabilities.all, | ||
}, | ||
read: { | ||
api: apiTags.read, | ||
app: [CASES_FEATURE_ID, 'kibana'], | ||
catalogue: [APP_ID], | ||
cases: { | ||
read: [APP_ID], | ||
}, | ||
savedObject: { | ||
all: [], | ||
read: [...savedObjects.files], | ||
}, | ||
ui: uiCapabilities.read, | ||
}, | ||
}, | ||
}; | ||
}; |
Oops, something went wrong.