-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Cases] Integrating file service and registering file kinds #152031
Merged
jonathan-buttner
merged 29 commits into
elastic:main
from
jonathan-buttner:cases-files-be
Mar 2, 2023
Merged
Changes from 26 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
81b27ad
Adding file service into cases
jonathan-buttner 8cabedd
Merge branch 'main' of github.com:elastic/kibana into cases-files-be
jonathan-buttner b2f75f3
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine a6c62bf
Typing owner info
jonathan-buttner 869474a
Adding more mime types
jonathan-buttner 770253e
Adding initial tests
jonathan-buttner 03e450b
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 3314aa9
Moving to integration directory and adding more
jonathan-buttner 75e71d5
Merge branch 'cases-files-be' of github.com:jonathan-buttner/kibana i…
jonathan-buttner 50f806a
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 73d55bc
Adding delete test
jonathan-buttner 4e6b026
Merge branch 'cases-files-be' of github.com:jonathan-buttner/kibana i…
jonathan-buttner a8e0344
Merge branch 'main' of github.com:elastic/kibana into cases-files-be
jonathan-buttner 6d36d1a
Adding image file size limit
jonathan-buttner 4163a04
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine 6407130
Removing duplicate mime types
jonathan-buttner 8316e85
Merge branch 'cases-files-be' of github.com:jonathan-buttner/kibana i…
jonathan-buttner c4e09a5
Merge branch 'main' into cases-files-be
jonathan-buttner 89c50f7
Merge branch 'main' into cases-files-be
jonathan-buttner 71e8482
Merge branch 'main' into cases-files-be
jonathan-buttner b9cb6a5
Merge branch 'main' into cases-files-be
jonathan-buttner 218b2ac
Addressing feedback
jonathan-buttner 69aab41
Merge branch 'cases-files-be' of github.com:jonathan-buttner/kibana i…
jonathan-buttner fb62610
Making files plugin required for observability
jonathan-buttner 9828325
Merge branch 'main' into cases-files-be
jonathan-buttner d4dcc78
Merge branch 'main' into cases-files-be
jonathan-buttner 5bd1018
Merge branch 'main' of github.com:elastic/kibana into cases-files-be
jonathan-buttner e8d2639
Addressing feedback
jonathan-buttner 506d718
Fixing tests
jonathan-buttner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 { CASE_VIEW_PAGE_TABS } from '../types'; | ||
|
||
/** | ||
* Application | ||
*/ | ||
|
||
export const APP_ID = 'cases' as const; | ||
export const FEATURE_ID = 'generalCases' as const; | ||
export const APP_OWNER = 'cases' as const; | ||
export const APP_PATH = '/app/management/insightsAndAlerting/cases' as const; | ||
export const CASES_CREATE_PATH = '/create' as const; | ||
export const CASES_CONFIGURE_PATH = '/configure' as const; | ||
export const CASE_VIEW_PATH = '/:detailName' as const; | ||
export const CASE_VIEW_COMMENT_PATH = `${CASE_VIEW_PATH}/:commentId` as const; | ||
export const CASE_VIEW_ALERT_TABLE_PATH = | ||
`${CASE_VIEW_PATH}/?tabId=${CASE_VIEW_PAGE_TABS.ALERTS}` as const; | ||
export const CASE_VIEW_TAB_PATH = `${CASE_VIEW_PATH}/?tabId=:tabId` as const; | ||
|
||
/** | ||
* The main Cases application is in the stack management under the | ||
* Alerts and Insights section. To do that, Cases registers to the management | ||
* application. This constant holds the application ID of the management plugin | ||
*/ | ||
export const STACK_APP_ID = 'management' as const; |
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,14 @@ | ||
/* | ||
* 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 { HttpApiTagOperation, Owner } from './types'; | ||
|
||
export const MAX_FILE_SIZE = 100 * 1024 * 1024; // 100 MiB | ||
|
||
export const constructFilesHttpOperationTag = (owner: Owner, operation: HttpApiTagOperation) => { | ||
return `${owner}FilesCases${operation}`; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/** | ||
* These were retrieved from https://www.iana.org/assignments/media-types/media-types.xhtml#image | ||
*/ | ||
const imageMimeTypes = [ | ||
'image/aces', | ||
'image/apng', | ||
'image/avci', | ||
'image/avcs', | ||
'image/avif', | ||
'image/bmp', | ||
'image/cgm', | ||
'image/dicom-rle', | ||
'image/dpx', | ||
'image/emf', | ||
'image/example', | ||
'image/fits', | ||
'image/g3fax', | ||
'image/heic', | ||
'image/heic-sequence', | ||
'image/heif', | ||
'image/heif-sequence', | ||
'image/hej2k', | ||
'image/hsj2', | ||
'image/jls', | ||
'image/jp2', | ||
'image/jpeg', | ||
'image/jph', | ||
'image/jphc', | ||
'image/jpm', | ||
'image/jpx', | ||
'image/jxr', | ||
'image/jxrA', | ||
'image/jxrS', | ||
'image/jxs', | ||
'image/jxsc', | ||
'image/jxsi', | ||
'image/jxss', | ||
'image/ktx', | ||
'image/ktx2', | ||
'image/naplps', | ||
'image/png', | ||
'image/prs.btif', | ||
'image/prs.pti', | ||
'image/pwg-raster', | ||
'image/svg+xml', | ||
'image/t38', | ||
'image/tiff', | ||
'image/tiff-fx', | ||
'image/vnd.adobe.photoshop', | ||
'image/vnd.airzip.accelerator.azv', | ||
'image/vnd.cns.inf2', | ||
'image/vnd.dece.graphic', | ||
'image/vnd.djvu', | ||
'image/vnd.dwg', | ||
'image/vnd.dxf', | ||
'image/vnd.dvb.subtitle', | ||
'image/vnd.fastbidsheet', | ||
'image/vnd.fpx', | ||
'image/vnd.fst', | ||
'image/vnd.fujixerox.edmics-mmr', | ||
'image/vnd.fujixerox.edmics-rlc', | ||
'image/vnd.globalgraphics.pgb', | ||
'image/vnd.microsoft.icon', | ||
'image/vnd.mix', | ||
'image/vnd.ms-modi', | ||
'image/vnd.mozilla.apng', | ||
'image/vnd.net-fpx', | ||
'image/vnd.pco.b16', | ||
'image/vnd.radiance', | ||
'image/vnd.sealed.png', | ||
'image/vnd.sealedmedia.softseal.gif', | ||
'image/vnd.sealedmedia.softseal.jpg', | ||
'image/vnd.svf', | ||
'image/vnd.tencent.tap', | ||
'image/vnd.valve.source.texture', | ||
'image/vnd.wap.wbmp', | ||
'image/vnd.xiff', | ||
'image/vnd.zbrush.pcx', | ||
'image/webp', | ||
'image/wmf', | ||
]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow, extensive!! |
||
|
||
const textMimeTypes = ['text/plain', 'text/csv', 'text/json', 'application/json']; | ||
|
||
const compressionMimeTypes = [ | ||
'application/zip', | ||
'application/gzip', | ||
'application/x-bzip', | ||
'application/x-bzip2', | ||
'application/x-7z-compressed', | ||
'application/x-tar', | ||
]; | ||
|
||
const pdfMimeTypes = ['application/pdf']; | ||
|
||
export const ALLOWED_MIME_TYPES = [ | ||
...imageMimeTypes, | ||
...textMimeTypes, | ||
...compressionMimeTypes, | ||
...pdfMimeTypes, | ||
]; | ||
|
||
export const IMAGE_MIME_TYPES = new Set(imageMimeTypes); |
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,50 @@ | ||
/* | ||
* 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 { APP_ID } from './application'; | ||
import type { Owner } from './types'; | ||
|
||
/** | ||
* Owner | ||
*/ | ||
export const SECURITY_SOLUTION_OWNER = 'securitySolution' as const; | ||
export const OBSERVABILITY_OWNER = 'observability' as const; | ||
export const GENERAL_CASES_OWNER = APP_ID; | ||
|
||
export const OWNERS = [SECURITY_SOLUTION_OWNER, OBSERVABILITY_OWNER, GENERAL_CASES_OWNER] as const; | ||
|
||
interface RouteInfo { | ||
id: Owner; | ||
appId: string; | ||
label: string; | ||
iconType: string; | ||
appRoute: string; | ||
} | ||
|
||
export const OWNER_INFO: Record<Owner, RouteInfo> = { | ||
[SECURITY_SOLUTION_OWNER]: { | ||
id: SECURITY_SOLUTION_OWNER, | ||
appId: 'securitySolutionUI', | ||
label: 'Security', | ||
iconType: 'logoSecurity', | ||
appRoute: '/app/security', | ||
}, | ||
[OBSERVABILITY_OWNER]: { | ||
id: OBSERVABILITY_OWNER, | ||
appId: 'observability-overview', | ||
label: 'Observability', | ||
iconType: 'logoObservability', | ||
appRoute: '/app/observability', | ||
}, | ||
[GENERAL_CASES_OWNER]: { | ||
id: GENERAL_CASES_OWNER, | ||
appId: 'management', | ||
label: 'Stack', | ||
iconType: 'casesApp', | ||
appRoute: '/app/management/insightsAndAlerting', | ||
}, | ||
} as const; |
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,17 @@ | ||
/* | ||
* 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 { OWNERS } from './owners'; | ||
|
||
export enum HttpApiTagOperation { | ||
Read = 'Read', | ||
Create = 'Create', | ||
Update = 'Update', | ||
Delete = 'Delete', | ||
} | ||
|
||
export type Owner = typeof OWNERS[number]; |
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
61 changes: 61 additions & 0 deletions
61
x-pack/plugins/cases/common/utils/__snapshots__/api_tags.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split this file up to move the file service constants to their own place and moved various other constants to avoid circular references.