oscerd commented on code in PR #26524:
URL: https://github.com/apache/camel/pull/26524#discussion_r4034248333


##########
components/camel-opa/src/main/java/org/apache/camel/component/opa/security/OpaSecurityPolicy.java:
##########
@@ -78,7 +89,9 @@ public void beforeWrap(Route route, NamedNode definition) {
             StringHelper.notEmpty(policyPath, "policyPath", this);
             if (opaClient == null) {
                 // createClient moved to OpaRestEvaluator when the evaluator 
became an abstract base
-                opaClient = OpaRestEvaluator.createClient(serverUrl, 
bearerToken);
+                opaClient = OpaRestEvaluator.createClient(
+                        serverUrl, bearerToken, connectionTimeout, 
requestTimeout,
+                        createSslContext(route.getCamelContext()));
                 ownsClient = true;
             }
             evaluator = new OpaRestEvaluator(

Review Comment:
   Fixed — the policy now uses `createTransport` + `createClient(String, 
OpaHttpClient)` and the transport-carrying constructor, matching `OpaEndpoint`. 
Reproduced the failure locally first rather than applying the suggestion blind; 
it was exactly the two lines you pointed at.
   
   While there I also took your point 5: 
`route.getCamelContext().addService(evaluator)` right after, so the transport 
this branch creates is closed on shutdown instead of outliving the routes.
   
   _Claude Code on behalf of @oscerd_



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