From 4ca9b1f38b4f6ad875cc3216fc2b886e61119b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=AATzuriel=20Weisberg=E2=80=AC=E2=80=8F?= Date: Thu, 2 Jun 2022 11:09:10 +0300 Subject: [PATCH] feat(cmd): add keys validation (#117) --- pkg/buildClient/client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/buildClient/client.go b/pkg/buildClient/client.go index 137be892..fda15166 100644 --- a/pkg/buildClient/client.go +++ b/pkg/buildClient/client.go @@ -57,6 +57,10 @@ func Get(scanPath string, c *cli.Context) (Client, error) { return nil, fmt.Errorf("could not find the AQUA_SECRET environment variable") } + if aquaKey == "" || aquaSecret == "" { + return nil, fmt.Errorf("could not continue with empty value for AQUA_KEY or AQUA_SECRET environment variables") + } + log.Logger.Debugf("Logging in to CSPM") jwtToken, err := obtainJWT(aquaKey, aquaSecret, cspmURL) if err != nil {