From d05759e4e5a78248922097ea994a58119b15af4f Mon Sep 17 00:00:00 2001 From: Nikhil Shahi Date: Sat, 1 Oct 2022 01:46:50 -0500 Subject: [PATCH] formatting and remove hasher log --- backend/src/index.ts | 5 ++++- backend/src/services/get-endpoints/index.ts | 4 ++-- backend/src/services/jobs/queries.ts | 2 +- backend/src/utils/hash.ts | 1 - frontend/src/api/home/index.ts | 4 +++- frontend/src/components/Alert/AlertDetail.tsx | 1 - frontend/src/components/EndpointList/Filters.tsx | 7 ++----- frontend/src/components/Home/HomeUpdateEmailView.tsx | 3 ++- 8 files changed, 14 insertions(+), 13 deletions(-) diff --git a/backend/src/index.ts b/backend/src/index.ts index 3fad9302..5c93f76f 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -51,7 +51,10 @@ import { getVulnerabilitySummaryHandler } from "api/alert/vulnerability" import { getAttackHandler, getAttacksHandler } from "api/attacks" import { inSandboxMode } from "utils" import { createKey, deleteKey, listKeys } from "api/keys" -import { getInstanceSettingsHandler, putInstanceSettingsHandler } from "api/settings" +import { + getInstanceSettingsHandler, + putInstanceSettingsHandler, +} from "api/settings" const app: Express = express() const port = process.env.PORT || 8080 diff --git a/backend/src/services/get-endpoints/index.ts b/backend/src/services/get-endpoints/index.ts index f2e6490a..d3202ba3 100644 --- a/backend/src/services/get-endpoints/index.ts +++ b/backend/src/services/get-endpoints/index.ts @@ -74,9 +74,9 @@ export class GetEndpointsService { } } if (getEndpointParams?.isAuthenticatedDetected) { - whereConditions= { + whereConditions = { ...whereConditions, - isAuthenticatedDetected: getEndpointParams.isAuthenticatedDetected + isAuthenticatedDetected: getEndpointParams.isAuthenticatedDetected, } } diff --git a/backend/src/services/jobs/queries.ts b/backend/src/services/jobs/queries.ts index d610a37f..bede1ace 100644 --- a/backend/src/services/jobs/queries.ts +++ b/backend/src/services/jobs/queries.ts @@ -160,4 +160,4 @@ export const updateUnauthenticatedEndpoints = ` AND "sessionMeta" ->> 'authenticationProvided' = 'false' AND "sessionMeta" ->> 'authenticationSuccessful' = 'true' ) -` \ No newline at end of file +` diff --git a/backend/src/utils/hash.ts b/backend/src/utils/hash.ts index a9be55f6..08b0c9b7 100644 --- a/backend/src/utils/hash.ts +++ b/backend/src/utils/hash.ts @@ -2,7 +2,6 @@ import crypto from "crypto" export const hasher = key => { let salt = process.env.ENCRYPTION_KEY - console.log(salt) let hash = crypto.createHmac("sha512", salt) hash.update(key) let value = hash.digest("base64") diff --git a/frontend/src/api/home/index.ts b/frontend/src/api/home/index.ts index 90fa0b3f..9851a656 100644 --- a/frontend/src/api/home/index.ts +++ b/frontend/src/api/home/index.ts @@ -17,7 +17,9 @@ export const getSummary = async (): Promise => { export const getInstanceSettings = async (): Promise => { try { - const resp = await axios.get(`${getAPIURL()}/instance-settings`) + const resp = await axios.get( + `${getAPIURL()}/instance-settings`, + ) return resp.data } catch (err) { console.error(`Error fetching instance settings: ${err}`) diff --git a/frontend/src/components/Alert/AlertDetail.tsx b/frontend/src/components/Alert/AlertDetail.tsx index 5e82f472..92ddaf6b 100644 --- a/frontend/src/components/Alert/AlertDetail.tsx +++ b/frontend/src/components/Alert/AlertDetail.tsx @@ -200,7 +200,6 @@ export const AlertDetail: React.FC = ({ const [rightPanel, setRightPanel] = useState(null) const scrollRef = useRef(null) const topDivRef = useRef(null) - console.log(providedSpecExtension) const executeScroll = () => { scrollRef.current?.scrollIntoView() diff --git a/frontend/src/components/EndpointList/Filters.tsx b/frontend/src/components/EndpointList/Filters.tsx index a6783603..177f5353 100644 --- a/frontend/src/components/EndpointList/Filters.tsx +++ b/frontend/src/components/EndpointList/Filters.tsx @@ -124,15 +124,12 @@ const EndpointFilters: React.FC = React.memo(