From 61d12a1fe4c902a751ada4fdcba22f005d97cc8e Mon Sep 17 00:00:00 2001 From: Christos Nasikas Date: Thu, 16 Jul 2020 13:48:43 +0300 Subject: [PATCH] [Security Solution] Refactor for inclusive language (#71858) --- .../draggable_wrapper_hover_content.test.tsx | 26 +++++++++---------- .../components/drag_and_drop/helpers.test.ts | 6 ++--- .../components/drag_and_drop/helpers.ts | 6 ++--- .../public/common/components/links/index.tsx | 6 ++--- .../public/resolver/store/index.ts | 4 +-- .../system/generic_file_details.test.tsx | 4 +-- 6 files changed, 26 insertions(+), 26 deletions(-) diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.test.tsx b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.test.tsx index 3f06a8168b5ce..8e76a88572e42 100644 --- a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.test.tsx +++ b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper_hover_content.test.tsx @@ -436,14 +436,14 @@ describe('DraggableWrapperHoverContent', () => { expect(wrapper.find('[data-test-subj="show-top-field"]').first().exists()).toBe(true); }); - test(`it renders the 'Show top field' button when showTopN is false and a whitelisted signal field is provided`, async () => { - const whitelistedField = 'signal.rule.name'; + test(`it renders the 'Show top field' button when showTopN is false and a allowlisted signal field is provided`, async () => { + const allowlistedField = 'signal.rule.name'; const wrapper = mount( @@ -473,13 +473,13 @@ describe('DraggableWrapperHoverContent', () => { }); test(`it should invokes goGetTimelineId when user is over the 'Show top field' button`, () => { - const whitelistedField = 'signal.rule.name'; + const allowlistedField = 'signal.rule.name'; const wrapper = mount( @@ -491,13 +491,13 @@ describe('DraggableWrapperHoverContent', () => { }); test(`invokes the toggleTopN function when the 'Show top field' button is clicked`, async () => { - const whitelistedField = 'signal.rule.name'; + const allowlistedField = 'signal.rule.name'; const wrapper = mount( @@ -512,13 +512,13 @@ describe('DraggableWrapperHoverContent', () => { }); test(`it does NOT render the Top N histogram when when showTopN is false`, async () => { - const whitelistedField = 'signal.rule.name'; + const allowlistedField = 'signal.rule.name'; const wrapper = mount( @@ -532,13 +532,13 @@ describe('DraggableWrapperHoverContent', () => { }); test(`it does NOT render the 'Show top field' button when showTopN is true`, async () => { - const whitelistedField = 'signal.rule.name'; + const allowlistedField = 'signal.rule.name'; const wrapper = mount( @@ -551,13 +551,13 @@ describe('DraggableWrapperHoverContent', () => { }); test(`it renders the Top N histogram when when showTopN is true`, async () => { - const whitelistedField = 'signal.rule.name'; + const allowlistedField = 'signal.rule.name'; const wrapper = mount( diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.test.ts b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.test.ts index afdfde6e08224..68032fb7dc512 100644 --- a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.test.ts +++ b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.test.ts @@ -658,7 +658,7 @@ describe('helpers', () => { ).toBe(true); }); - test('it returns true for a whitelisted non-BrowserField', () => { + test('it returns true for a allowlisted non-BrowserField', () => { expect( allowTopN({ browserField: undefined, @@ -717,11 +717,11 @@ describe('helpers', () => { ).toBe(false); }); - test('it returns false for a non-whitelisted field when a BrowserField is not provided', () => { + test('it returns false for a non-allowlisted field when a BrowserField is not provided', () => { expect( allowTopN({ browserField: undefined, - fieldName: 'non-whitelisted', + fieldName: 'non-allowlisted', }) ).toBe(false); }); diff --git a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts index ba328eff62e51..132ab054c3afd 100644 --- a/x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts +++ b/x-pack/plugins/security_solution/public/common/components/drag_and_drop/helpers.ts @@ -264,8 +264,8 @@ export const allowTopN = ({ 'string', ].includes(fieldType); - // TODO: remove this explicit whitelist when the ECS documentation includes alerts - const isWhitelistedNonBrowserField = [ + // TODO: remove this explicit allowlist when the ECS documentation includes alerts + const isAllowlistedNonBrowserField = [ 'signal.ancestors.depth', 'signal.ancestors.id', 'signal.ancestors.rule', @@ -336,7 +336,7 @@ export const allowTopN = ({ 'signal.status', ].includes(fieldName); - return isWhitelistedNonBrowserField || (isAggregatable && isAllowedType); + return isAllowlistedNonBrowserField || (isAggregatable && isAllowedType); }; export const getTimelineIdFromColumnDroppableId = (droppableId: string) => diff --git a/x-pack/plugins/security_solution/public/common/components/links/index.tsx b/x-pack/plugins/security_solution/public/common/components/links/index.tsx index 3b92faff91517..4a9ad94d8f36d 100644 --- a/x-pack/plugins/security_solution/public/common/components/links/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/links/index.tsx @@ -78,7 +78,7 @@ const HostDetailsLinkComponent: React.FC<{ children?: React.ReactNode; hostName: }; export const HostDetailsLink = React.memo(HostDetailsLinkComponent); -const whitelistUrlSchemes = ['http://', 'https://']; +const allowedUrlSchemes = ['http://', 'https://']; export const ExternalLink = React.memo<{ url: string; children?: React.ReactNode; @@ -96,8 +96,8 @@ export const ExternalLink = React.memo<{ const lastVisibleItemIndex = overflowIndexStart - 1; const lastItemIndex = allItemsLimit - 1; const lastIndexToShow = Math.max(0, Math.min(lastVisibleItemIndex, lastItemIndex)); - const inWhitelist = whitelistUrlSchemes.some((scheme) => url.indexOf(scheme) === 0); - return url && inWhitelist && !isUrlInvalid(url) && children ? ( + const inAllowlist = allowedUrlSchemes.some((scheme) => url.indexOf(scheme) === 0); + return url && inAllowlist && !isUrlInvalid(url) && children ? ( {children} diff --git a/x-pack/plugins/security_solution/public/resolver/store/index.ts b/x-pack/plugins/security_solution/public/resolver/store/index.ts index 9809e443d2d13..d9e750241ced1 100644 --- a/x-pack/plugins/security_solution/public/resolver/store/index.ts +++ b/x-pack/plugins/security_solution/public/resolver/store/index.ts @@ -16,10 +16,10 @@ import { ResolverAction } from './actions'; export const storeFactory = ( context?: KibanaReactContextValue ): Store => { - const actionsBlacklist: Array = ['userMovedPointer']; + const actionsDenylist: Array = ['userMovedPointer']; const composeEnhancers = composeWithDevTools({ name: 'Resolver', - actionsBlacklist, + actionsBlacklist: actionsDenylist, }); const middlewareEnhancer = applyMiddleware(resolverMiddlewareFactory(context)); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.test.tsx index 52c232f377f79..2c207ea8a1562 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/system/generic_file_details.test.tsx @@ -1231,8 +1231,8 @@ describe('SystemGenericFileDetails', () => { }); }); - test('it does NOT render the text "via" when eventAction is not a whitelisted action', () => { - const eventAction = 'a_non_whitelisted_event_action'; + test('it does NOT render the text "via" when eventAction is not a allowlisted action', () => { + const eventAction = 'a_non_allowlisted_event_action'; const wrapper = mount(