Copilot commented on code in PR #2461:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/2461#discussion_r2189214868


##########
internal/provider/adc/executor.go:
##########
@@ -138,6 +138,19 @@ func (e *DefaultADCExecutor) prepareEnv(serverAddr, mode, 
token string) []string
        }
 }
 
+// filterSensitiveEnv filters out sensitive information from environment 
variables for logging
+func filterSensitiveEnv(env []string) []string {
+       filtered := make([]string, 0, len(env))
+       for _, envVar := range env {
+               if strings.Contains(envVar, "ADC_TOKEN=") {

Review Comment:
   Use strings.HasPrefix instead of strings.Contains when checking for 
"ADC_TOKEN=" to avoid accidental masking of variables that include this 
substring elsewhere.
   ```suggestion
                if strings.HasPrefix(envVar, "ADC_TOKEN=") {
   ```



-- 
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: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to