gnodet commented on code in PR #27669:
URL: https://github.com/apache/camel/pull/27669#discussion_r4239741828


##########
components/camel-hashicorp-vault/src/main/java/org/apache/camel/component/hashicorp/vault/HashicorpVaultPropertiesFunction.java:
##########
@@ -268,9 +297,20 @@ public CamelContext getCamelContext() {
     }
 
     /**
-     * Ids of the secrets in use
+     * Ids of the secrets in use, as engine:secret, or only the secret for the 
default secret engine
      */
     public Set<String> getSecrets() {
         return secrets;

Review Comment:
   💡 **Suggestion (low severity, pre-existing):** `getSecrets()` returns the 
backing `ConcurrentHashMap` key set directly, exposing a mutable view. Callers 
can add/remove entries from the live set unintentionally.
   
   Consider wrapping in `Collections.unmodifiableSet()` to make the contract 
explicit:
   
   ```suggestion
           return Collections.unmodifiableSet(secrets);
   ```
   
   (This was also true with the old `HashSet` — the change to 
`ConcurrentHashMap.newKeySet()` doesn't change the exposure.)



-- 
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