This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new ca28c3da82f CAMEL-22380: camel-platform-http-main - Authentication
path does not work
ca28c3da82f is described below
commit ca28c3da82fae623cfabe5bb47b15a8eb2e3e43a
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Aug 27 13:17:26 2025 +0200
CAMEL-22380: camel-platform-http-main - Authentication path does not work
---
.../authentication/BasicAuthenticationConfigurer.java | 16 +++++++++++++---
.../main/authentication/JWTAuthenticationConfigurer.java | 16 +++++++++++++---
2 files changed, 26 insertions(+), 6 deletions(-)
diff --git
a/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/BasicAuthenticationConfigurer.java
b/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/BasicAuthenticationConfigurer.java
index 4c43f2e5f82..ae9cff89f8b 100644
---
a/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/BasicAuthenticationConfigurer.java
+++
b/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/BasicAuthenticationConfigurer.java
@@ -23,7 +23,7 @@ import
org.apache.camel.component.platform.http.vertx.auth.AuthenticationConfig.
import org.apache.camel.main.HttpManagementServerConfigurationProperties;
import org.apache.camel.main.HttpServerConfigurationProperties;
-import static org.apache.camel.util.ObjectHelper.isEmpty;
+import static org.apache.camel.util.ObjectHelper.isNotEmpty;
public class BasicAuthenticationConfigurer implements
MainAuthenticationConfigurer {
@@ -32,7 +32,12 @@ public class BasicAuthenticationConfigurer implements
MainAuthenticationConfigur
AuthenticationConfig authenticationConfig,
HttpServerConfigurationProperties properties) {
String authPropertiesFileName = properties.getBasicPropertiesFile();
- String path = isEmpty(properties.getAuthenticationPath()) ?
properties.getAuthenticationPath() : "/*";
+ String path
+ = isNotEmpty(properties.getAuthenticationPath()) ?
properties.getAuthenticationPath() : properties.getPath();
+ // root means to authenticate everything
+ if ("/".equals(path)) {
+ path = "/*";
+ }
AuthenticationConfigEntry entry = new AuthenticationConfigEntry();
entry.setPath(path);
@@ -49,7 +54,12 @@ public class BasicAuthenticationConfigurer implements
MainAuthenticationConfigur
AuthenticationConfig authenticationConfig,
HttpManagementServerConfigurationProperties properties) {
String authPropertiesFileName = properties.getBasicPropertiesFile();
- String path = isEmpty(properties.getAuthenticationPath()) ?
properties.getAuthenticationPath() : "/*";
+ String path
+ = isNotEmpty(properties.getAuthenticationPath()) ?
properties.getAuthenticationPath() : properties.getPath();
+ // root means to authenticate everything
+ if ("/".equals(path)) {
+ path = "/*";
+ }
AuthenticationConfigEntry entry = new AuthenticationConfigEntry();
entry.setPath(path);
diff --git
a/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/JWTAuthenticationConfigurer.java
b/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/JWTAuthenticationConfigurer.java
index 41bbdab45ab..6503993344c 100644
---
a/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/JWTAuthenticationConfigurer.java
+++
b/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/JWTAuthenticationConfigurer.java
@@ -28,7 +28,7 @@ import
org.apache.camel.component.platform.http.vertx.auth.AuthenticationConfig.
import org.apache.camel.main.HttpManagementServerConfigurationProperties;
import org.apache.camel.main.HttpServerConfigurationProperties;
-import static org.apache.camel.util.ObjectHelper.isEmpty;
+import static org.apache.camel.util.ObjectHelper.isNotEmpty;
public class JWTAuthenticationConfigurer implements
MainAuthenticationConfigurer {
@@ -37,7 +37,12 @@ public class JWTAuthenticationConfigurer implements
MainAuthenticationConfigurer
AuthenticationConfig authenticationConfig,
HttpServerConfigurationProperties properties) {
- String path = isEmpty(properties.getAuthenticationPath()) ?
properties.getAuthenticationPath() : "/*";
+ String path
+ = isNotEmpty(properties.getAuthenticationPath()) ?
properties.getAuthenticationPath() : properties.getPath();
+ // root means to authenticate everything
+ if ("/".equals(path)) {
+ path = "/*";
+ }
AuthenticationConfigEntry entry = new AuthenticationConfigEntry();
entry.setPath(path);
@@ -66,7 +71,12 @@ public class JWTAuthenticationConfigurer implements
MainAuthenticationConfigurer
AuthenticationConfig authenticationConfig,
HttpManagementServerConfigurationProperties properties) {
- String path = isEmpty(properties.getAuthenticationPath()) ?
properties.getAuthenticationPath() : "/*";
+ String path
+ = isNotEmpty(properties.getAuthenticationPath()) ?
properties.getAuthenticationPath() : properties.getPath();
+ // root means to authenticate everything
+ if ("/".equals(path)) {
+ path = "/*";
+ }
AuthenticationConfigEntry entry = new AuthenticationConfigEntry();
entry.setPath(path);