gnodet-bot commented on code in PR #27022:
URL: https://github.com/apache/camel/pull/27022#discussion_r4126407540


##########
core/camel-core-catalog/src/main/java/org/apache/camel/catalog/impl/AbstractCamelCatalog.java:
##########
@@ -1112,7 +1127,11 @@ private static String wrapRAW(String key, String val, 
Map<String, BaseOptionMode
             return val;
         }
 
-        if (option.isSecret() && !val.startsWith("#") && 
!val.startsWith("RAW(")) {
+        if (option.isSecret() && !val.startsWith("#") && 
!val.startsWith("RAW(") && !val.startsWith("RAW{")) {
+            // use RAW{} when the value contains ) as that would end RAW()
+            if (val.indexOf(')') != -1 && val.indexOf('}') == -1) {
+                return "RAW{" + val + "}";
+            }
             return "RAW(" + val + ")";

Review Comment:
   💡 **Note**: When a secret value contains **both** `)` and `}`, this falls 
through to `RAW(val)` — the `)` in the value will prematurely end the RAW 
block. This is an inherent limitation of the RAW encoding scheme (both 
delimiters are taken), not a bug in this PR. Worth a comment for future readers:
   
   ```suggestion
               // use RAW{} when the value contains ) as that would end RAW()
               // note: if the value contains both ) and }, RAW() is used and 
the ) may
               // prematurely end the block — this is a known limitation of the 
RAW encoding
               if (val.indexOf(')') != -1 && val.indexOf('}') == -1) {
                   return "RAW{" + val + "}";
               }
               return "RAW(" + val + ")";
   ```



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