From 6870da8ee63492b3c563e54b4e43182cc8d22cc6 Mon Sep 17 00:00:00 2001 From: Stacy Kim Date: Tue, 10 Oct 2023 17:05:14 -0700 Subject: [PATCH] Rename Source and Destination `Service` to `Identity` The "Source Service" and "Destination Service" columns' namings were slightly confusing as they appear to be security identities rather than service identities, a non-existent concept. This renames references of "Source Service" to "Source Identity" and "Destination Service" to "Destination Identity". Fixes: #249 Signed-off-by: Stacy Kim --- src/components/FlowsTable/Cell.tsx | 4 ++-- src/components/FlowsTable/Header.tsx | 8 ++++---- src/components/FlowsTable/Row.tsx | 8 ++++---- src/components/FlowsTable/general.ts | 8 ++++---- src/storage/local/__tests__/store-restore.test.ts | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/components/FlowsTable/Cell.tsx b/src/components/FlowsTable/Cell.tsx index 425faf2e8..524914148 100644 --- a/src/components/FlowsTable/Cell.tsx +++ b/src/components/FlowsTable/Cell.tsx @@ -32,7 +32,7 @@ export const Cell = memo(function FlowsTableCell(props) { case Column.SrcIp: { return
{props.flow.sourceIp}
; } - case Column.SrcService: { + case Column.SrcIdentity: { const appName = props.flow.sourceIdentityName ?? 'No app name'; const subtitle = props.flow.sourceNamespace ? ( {props.flow.sourceNamespace} @@ -55,7 +55,7 @@ export const Cell = memo(function FlowsTableCell(props) { case Column.DstIp: { return
{props.flow.destinationIp}
; } - case Column.DstService: { + case Column.DstIdentity: { const appName = props.flow.destinationDns ? props.flow.destinationDns : props.flow.destinationIdentityName ?? '—'; diff --git a/src/components/FlowsTable/Header.tsx b/src/components/FlowsTable/Header.tsx index d7c064b7a..7d60d7b65 100644 --- a/src/components/FlowsTable/Header.tsx +++ b/src/components/FlowsTable/Header.tsx @@ -14,8 +14,8 @@ export const Header = memo(function FlowsTableHeader(props) { {props.visibleColumns.has(Column.SrcIp) && (
{getColumnLabel(Column.SrcIp)}
)} - {props.visibleColumns.has(Column.SrcService) && ( -
{getColumnLabel(Column.SrcService)}
+ {props.visibleColumns.has(Column.SrcIdentity) && ( +
{getColumnLabel(Column.SrcIdentity)}
)} {props.visibleColumns.has(Column.DstPod) && (
{getColumnLabel(Column.DstPod)}
@@ -23,8 +23,8 @@ export const Header = memo(function FlowsTableHeader(props) { {props.visibleColumns.has(Column.DstIp) && (
{getColumnLabel(Column.DstIp)}
)} - {props.visibleColumns.has(Column.DstService) && ( -
{getColumnLabel(Column.DstService)}
+ {props.visibleColumns.has(Column.DstIdentity) && ( +
{getColumnLabel(Column.DstIdentity)}
)} {props.visibleColumns.has(Column.DstPort) && (
diff --git a/src/components/FlowsTable/Row.tsx b/src/components/FlowsTable/Row.tsx index d548b9893..344636405 100644 --- a/src/components/FlowsTable/Row.tsx +++ b/src/components/FlowsTable/Row.tsx @@ -59,8 +59,8 @@ export const Row = memo(function FlowsTableRow(props) { {props.visibleColumns.has(Column.SrcIp) && ( )} - {props.visibleColumns.has(Column.SrcService) && ( - + {props.visibleColumns.has(Column.SrcIdentity) && ( + )} {props.visibleColumns.has(Column.DstPod) && ( @@ -68,8 +68,8 @@ export const Row = memo(function FlowsTableRow(props) { {props.visibleColumns.has(Column.DstIp) && ( )} - {props.visibleColumns.has(Column.DstService) && ( - + {props.visibleColumns.has(Column.DstIdentity) && ( + )} {props.visibleColumns.has(Column.DstPort) && ( diff --git a/src/components/FlowsTable/general.ts b/src/components/FlowsTable/general.ts index 916ed3333..872915bdb 100644 --- a/src/components/FlowsTable/general.ts +++ b/src/components/FlowsTable/general.ts @@ -6,10 +6,10 @@ export enum Column { Auth = 'Authentication', SrcPod = 'Source Pod', SrcIp = 'Source IP', - SrcService = 'Source Service', + SrcIdentity = 'Source Identity', DstPod = 'Destination Pod', DstIp = 'Destination IP', - DstService = 'Destination Service', + DstIdentity = 'Destination Identity', DstPort = 'Destination Port', L7Info = 'L7 info', Verdict = 'Verdict', @@ -34,8 +34,8 @@ export const getColumnKey = (col: Column): ColumnKey => { }; export const defaultVisibleColumns = new Set([ - Column.SrcService, - Column.DstService, + Column.SrcIdentity, + Column.DstIdentity, Column.DstPort, Column.L7Info, Column.Verdict, diff --git a/src/storage/local/__tests__/store-restore.test.ts b/src/storage/local/__tests__/store-restore.test.ts index c2e98a7d0..128224676 100644 --- a/src/storage/local/__tests__/store-restore.test.ts +++ b/src/storage/local/__tests__/store-restore.test.ts @@ -20,14 +20,14 @@ describe('consistency tests for setItem / getItem', () => { const getItem = jest.spyOn(Storage.prototype, 'getItem'); const setItem = jest.spyOn(Storage.prototype, 'setItem'); - const arr = [Column.SrcService]; + const arr = [Column.SrcIdentity]; saveFlowsTableVisibleColumns(new Set(arr)); expect(setItem.mock.calls.length).toBe(1); expect(setItem.mock.calls[0][1]).toBe(JSON.stringify(arr)); const data = getFlowsTableVisibleColumns(); - expect(data).toEqual(new Set([Column.SrcService])); + expect(data).toEqual(new Set([Column.SrcIdentity])); }); test('flows table visible columns 3', () => {