From badaec26f360fc5dc09bfccbfa35772feaa55bdb Mon Sep 17 00:00:00 2001 From: Eran Turgeman Date: Tue, 2 Jun 2026 14:04:41 +0300 Subject: [PATCH] improving logs for V2 --- scanrepository/scanrepository.go | 1 + utils/params.go | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/scanrepository/scanrepository.go b/scanrepository/scanrepository.go index 8ca503b66..0dee66434 100644 --- a/scanrepository/scanrepository.go +++ b/scanrepository/scanrepository.go @@ -583,6 +583,7 @@ func (cfp *ScanRepositoryCmd) cloneRepositoryOrUseLocalAndCheckoutToBranch() (te log.Debug("Created temp working directory:", tempWd) if cfp.scanDetails.UseLocalRepository { + log.Debug("JF_USE_LOCAL_REPOSITORY was set to true. Copying local repository to tmp dir...") var curDir string if curDir, err = os.Getwd(); err != nil { return diff --git a/utils/params.go b/utils/params.go index 2d7ca6066..c298e5226 100644 --- a/utils/params.go +++ b/utils/params.go @@ -35,6 +35,7 @@ import ( const ( frogbotConfigDir = ".frogbot" FrogbotConfigFile = "frogbot-config.yml" + maskedValue = "***" ) var ( @@ -525,6 +526,7 @@ func GetFrogbotDetails(commandName string) (frogbotDetails *FrogbotDetails, err if err != nil { return } + printAggregatorParams(configAggregator[0].Params) // TODO when deprecating multiple repositories support, pass the correct projectKey from the single repo we have to getConfigProfileIfExistsAndValid configProfile, repoCloneUrl, err := getConfigProfileIfExistsAndValid(xrayVersion, jfrogServer, client, gitParamsFromEnv, configAggregator[0].JFrogProjectKey) @@ -931,3 +933,23 @@ func verifyConfigProfileValidity(configProfile *services.ConfigProfile) (err err log.Info(fmt.Sprintf("Using Config profile '%s'. jfrog-apps-config will be ignored if exists", configProfile.ProfileName)) return } +func printAggregatorParams(params Params) { + params.Scan.EmailDetails.SmtpServer = replaceIfNotEmpty(params.Scan.EmailDetails.SmtpServer) + params.Scan.EmailDetails.SmtpPort = replaceIfNotEmpty(params.Scan.EmailDetails.SmtpPort) + params.Scan.EmailDetails.SmtpUser = replaceIfNotEmpty(params.Scan.EmailDetails.SmtpUser) + params.Scan.EmailDetails.SmtpPassword = replaceIfNotEmpty(params.Scan.EmailDetails.SmtpPassword) + params.Git.VcsInfo.Username = replaceIfNotEmpty(params.Git.VcsInfo.Username) + params.Git.VcsInfo.Token = replaceIfNotEmpty(params.Git.VcsInfo.Token) + + configAggregatorParamsString, e := json.Marshal(params) + if e == nil { + log.Debug(fmt.Sprintf("extracted config aggregator params: %s", configAggregatorParamsString)) + } +} + +func replaceIfNotEmpty(value string) string { + if value != "" { + return maskedValue + } + return value +}