From 993abd092197aa8212cd80f09642a9a4e96ef14e Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Mon, 17 Jul 2023 21:28:47 -0400 Subject: [PATCH] add secret scanning status to api --- backend/src/index.ts | 2 +- backend/src/routes/status/status.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/index.ts b/backend/src/index.ts index 251340526..b5f1b6ddd 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -88,7 +88,7 @@ const main = async () => { }) ); - if (await getSecretScanningGitAppId()) { + if (await getSecretScanningGitAppId() && await getSecretScanningWebhookSecret() && await getSecretScanningPrivateKey()) { const probot = new Probot({ appId: await getSecretScanningGitAppId(), privateKey: await getSecretScanningPrivateKey(), diff --git a/backend/src/routes/status/status.ts b/backend/src/routes/status/status.ts index 0af4bb5c2..ce13775cb 100644 --- a/backend/src/routes/status/status.ts +++ b/backend/src/routes/status/status.ts @@ -1,5 +1,5 @@ import express, { Request, Response } from "express"; -import { getSmtpConfigured } from "../../config"; +import { getSecretScanningGitAppId, getSecretScanningPrivateKey, getSecretScanningWebhookSecret, getSmtpConfigured } from "../../config"; const router = express.Router(); @@ -10,6 +10,7 @@ router.get( date: new Date(), message: "Ok", emailConfigured: await getSmtpConfigured(), + secretScanningConfigured: await getSecretScanningGitAppId() && await getSecretScanningWebhookSecret() && await getSecretScanningPrivateKey(), }) } );