Skip to content

Commit

Permalink
[Security Solution] Refactor for inclusive language (#71858)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas authored Jul 16, 2020
1 parent 7e533f2 commit 61d12a1
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<TestProviders>
<DraggableWrapperHoverContent
{...{
...defaultProps,
field: whitelistedField,
field: allowlistedField,
}}
/>
</TestProviders>
Expand Down Expand Up @@ -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(
<TestProviders>
<DraggableWrapperHoverContent
{...{
...defaultProps,
field: whitelistedField,
field: allowlistedField,
timelineId: undefined,
}}
/>
Expand All @@ -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(
<TestProviders>
<DraggableWrapperHoverContent
{...{
...defaultProps,
field: whitelistedField,
field: allowlistedField,
}}
/>
</TestProviders>
Expand All @@ -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(
<TestProviders>
<DraggableWrapperHoverContent
{...{
...defaultProps,
field: whitelistedField,
field: allowlistedField,
}}
/>
</TestProviders>
Expand All @@ -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(
<TestProviders>
<DraggableWrapperHoverContent
{...{
...defaultProps,
field: whitelistedField,
field: allowlistedField,
showTopN: true,
}}
/>
Expand All @@ -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(
<TestProviders>
<DraggableWrapperHoverContent
{...{
...defaultProps,
field: whitelistedField,
field: allowlistedField,
showTopN: true,
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -336,7 +336,7 @@ export const allowTopN = ({
'signal.status',
].includes(fieldName);

return isWhitelistedNonBrowserField || (isAggregatable && isAllowedType);
return isAllowlistedNonBrowserField || (isAggregatable && isAllowedType);
};

export const getTimelineIdFromColumnDroppableId = (droppableId: string) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 ? (
<EuiToolTip content={url} position="top" data-test-subj="externalLinkTooltip">
<EuiLink href={url} target="_blank" rel="noopener" data-test-subj="externalLink">
{children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import { ResolverAction } from './actions';
export const storeFactory = (
context?: KibanaReactContextValue<StartServices>
): Store<ResolverState, ResolverAction> => {
const actionsBlacklist: Array<ResolverAction['type']> = ['userMovedPointer'];
const actionsDenylist: Array<ResolverAction['type']> = ['userMovedPointer'];
const composeEnhancers = composeWithDevTools({
name: 'Resolver',
actionsBlacklist,
actionsBlacklist: actionsDenylist,
});
const middlewareEnhancer = applyMiddleware(resolverMiddlewareFactory(context));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<TestProviders>
Expand Down

0 comments on commit 61d12a1

Please sign in to comment.