Skip to content

Commit

Permalink
integrations specify type in standalone report + issuer/subject color…
Browse files Browse the repository at this point in the history
…ed/multiline
  • Loading branch information
TobySalusky committed Sep 3, 2021
1 parent 53dd71e commit 53043ec
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
14 changes: 12 additions & 2 deletions src/Layouts/TableLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import {DataLayout} from "./DataLayout";
import React, {useState} from "react";
import {makeColorElems, makeUnbreakable, toColorText, trySnipDate, typeColors} from "../Util/Util";
import {
makeColorElems,
makeUnbreakable,
toColorElemsMultiline,
toColorText,
trySnipDate,
typeColors
} from "../Util/Util";
import {ASCENDING, DESCENDING} from "../Util/SortUtil";
import {LinkOut} from "../Components/LinkBack";
import {MaxLen} from "../Util/ElemUtil";
Expand Down Expand Up @@ -64,9 +71,12 @@ const makeColumn = (columnable: Columnable): Column => {
}

switch (str) {
case 'color':
case 'color_inline':
column.genContents = value => <span>{makeColorElems(value)}</span>;
break;
case 'color':
column.genContents = value => <div>{toColorElemsMultiline(toColorText(value))}</div>;
break;
case 'stringify_inline':
const func = (value: any) => toColorText(value, {multiline: false}).genText();
column.genContents = func;
Expand Down
8 changes: 4 additions & 4 deletions src/Types/Integration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ export class Integration {

genStandaloneReportText(): string {
const iData = this.genIndicatorData();
const indicatorDeclaration = `${ITypes[iData.type]}${(iData.subType === ISubTypes.NONE ? '' : `(${ISubTypes[iData.subType]})`)}: ${iData.value}`;
return `${indicatorDeclaration}\n\n${this.genReportText()}`;
const header = `${this.type} for ${iData.value}`;
return `${header}\n\n${this.genReportText()}`;
}

genReportText(): string {
Expand Down Expand Up @@ -652,8 +652,8 @@ export class ShodanIntegration extends Integration {
['', linkOutColumn(value => {
return `https://search.censys.io/certificates?q=${value}`
})],
['issuer', 'stringify_inline'],
['subject', 'stringify_inline'],
['issuer', 'color'],
['subject', 'color'],
],
(rowData => {
const {issued, expires, fingerprint, issuer, subject} = rowData?.ssl?.cert || {};
Expand Down

0 comments on commit 53043ec

Please sign in to comment.