derrickaw commented on code in PR #41591:
URL: https://github.com/apache/beam/pull/41591#discussion_r4683627495


##########
infra/enforcement/account_keys.py:
##########
@@ -337,12 +341,11 @@ def check_compliance(self) -> List[str]:
         extracted_secrets = 
[f"{self._denormalize_account_email(account['account_id'])}-key" for account in 
file_service_accounts]
 
         # Check for managed secrets that are not declared
-        for secret in managed_secrets:
-            if secret not in extracted_secrets:
-                masked_secret = f"{secret[:4]}***{secret[-4:]}" if len(secret) 
>= 8 else "***"
-                msg = f"Managed secret '{masked_secret}' is not declared in 
the service account keys file."
-                compliance_issues.append(msg)
-                self.logger.warning(msg)
+        undeclared_count = sum(1 for item in managed_secrets if item not in 
extracted_secrets)
+        if undeclared_count:
+            msg = f"{undeclared_count} managed secret(s) in Secret Manager are 
not declared in the service account keys file."

Review Comment:
   The gemini review comments were resolved beforehand (actually none in this 
instance earlier), but another gemini review got kicked off later after opening 
for review that uncovered this comment here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to