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


##########
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:
   This (lines 90-98) is what breaks the build: `createClient` is now `(String, 
OpaHttpClient)` and the evaluator constructor takes the transport as its second 
argument.
   
   ```java
               OpaHttpClient transport = null;
               if (opaClient == null) {
                   // createClient moved to OpaRestEvaluator when the evaluator 
became an abstract base
                   transport = OpaRestEvaluator.createTransport(
                           bearerToken, connectionTimeout, requestTimeout, 
createSslContext(route.getCamelContext()));
                   opaClient = OpaRestEvaluator.createClient(serverUrl, 
transport);
                   ownsClient = true;
               }
               evaluator = new OpaRestEvaluator(
                       opaClient, transport, policyPath, allowKey, 
includeHeaders, includeProperties, includeBody,
                       failOpen);
           }
   ```
   
   (`OpaHttpClient` is package-private in `org.apache.camel.component.opa`, so 
it will need to become public — or `createTransport` return the `HTTPClient` 
interface — for this call site in the `security` sub-package.)



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