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 a92bf23454c CAMEL-22081: camel-http: fix: adding oauth2ResourceIndicator where applicable a92bf23454c is described below commit a92bf23454c2b43fd70815e88eacf099a6b5c969 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Tue May 20 13:28:27 2025 +0200 CAMEL-22081: camel-http: fix: adding oauth2ResourceIndicator where applicable --- .../org/apache/camel/catalog/components/http.json | 9 ++-- .../org/apache/camel/catalog/components/https.json | 9 ++-- .../atmosphere/websocket/WebsocketEndpoint.java | 6 +-- .../camel/http/common/HttpCommonEndpoint.java | 55 +++++++++++++--------- .../component/http/HttpEndpointConfigurer.java | 6 +++ .../component/http/HttpEndpointUriFactory.java | 3 +- .../org/apache/camel/component/http/http.json | 9 ++-- .../org/apache/camel/component/http/https.json | 9 ++-- .../camel-http/src/main/docs/http-component.adoc | 2 +- .../endpoint/dsl/HttpEndpointBuilderFactory.java | 16 ++++++- 10 files changed, 80 insertions(+), 44 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/http.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/http.json index 0c68d9a4c50..10d843bf738 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/http.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/http.json @@ -148,9 +148,10 @@ "oauth2CacheTokens": { "index": 56, "kind": "parameter", "displayName": "Oauth2 Cache Tokens", "group": "security", "label": "producer,security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to cache OAuth2 client tokens." }, "oauth2ClientId": { "index": 57, "kind": "parameter", "displayName": "Oauth2 Client Id", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "OAuth2 client id" }, "oauth2ClientSecret": { "index": 58, "kind": "parameter", "displayName": "Oauth2 Client Secret", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "OAuth2 client secret" }, - "oauth2Scope": { "index": 59, "kind": "parameter", "displayName": "Oauth2 Scope", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 scope" }, - "oauth2TokenEndpoint": { "index": 60, "kind": "parameter", "displayName": "Oauth2 Token Endpoint", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 Token endpoint" }, - "sslContextParameters": { "index": 61, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "description": "To configure security using SSLContextParameters. Important: Only one instance of org.apache.camel.util.jsse.SSLContextParameters is supported per HttpComponent. If you [...] - "x509HostnameVerifier": { "index": 62, "kind": "parameter", "displayName": "X509 Hostname Verifier", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "javax.net.ssl.HostnameVerifier", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom X509HostnameVerifier such as DefaultHostnameVerifier or NoopHostnameVerifier" } + "oauth2ResourceIndicator": { "index": 59, "kind": "parameter", "displayName": "Oauth2 Resource Indicator", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 Token endpoint" }, + "oauth2Scope": { "index": 60, "kind": "parameter", "displayName": "Oauth2 Scope", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 scope" }, + "oauth2TokenEndpoint": { "index": 61, "kind": "parameter", "displayName": "Oauth2 Token Endpoint", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 Resource Indicator" }, + "sslContextParameters": { "index": 62, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "description": "To configure security using SSLContextParameters. Important: Only one instance of org.apache.camel.util.jsse.SSLContextParameters is supported per HttpComponent. If you [...] + "x509HostnameVerifier": { "index": 63, "kind": "parameter", "displayName": "X509 Hostname Verifier", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "javax.net.ssl.HostnameVerifier", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom X509HostnameVerifier such as DefaultHostnameVerifier or NoopHostnameVerifier" } } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/https.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/https.json index 60b5e229cc2..b0ea6dc4976 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/https.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/https.json @@ -148,9 +148,10 @@ "oauth2CacheTokens": { "index": 56, "kind": "parameter", "displayName": "Oauth2 Cache Tokens", "group": "security", "label": "producer,security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to cache OAuth2 client tokens." }, "oauth2ClientId": { "index": 57, "kind": "parameter", "displayName": "Oauth2 Client Id", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "OAuth2 client id" }, "oauth2ClientSecret": { "index": 58, "kind": "parameter", "displayName": "Oauth2 Client Secret", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "OAuth2 client secret" }, - "oauth2Scope": { "index": 59, "kind": "parameter", "displayName": "Oauth2 Scope", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 scope" }, - "oauth2TokenEndpoint": { "index": 60, "kind": "parameter", "displayName": "Oauth2 Token Endpoint", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 Token endpoint" }, - "sslContextParameters": { "index": 61, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "description": "To configure security using SSLContextParameters. Important: Only one instance of org.apache.camel.util.jsse.SSLContextParameters is supported per HttpComponent. If you [...] - "x509HostnameVerifier": { "index": 62, "kind": "parameter", "displayName": "X509 Hostname Verifier", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "javax.net.ssl.HostnameVerifier", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom X509HostnameVerifier such as DefaultHostnameVerifier or NoopHostnameVerifier" } + "oauth2ResourceIndicator": { "index": 59, "kind": "parameter", "displayName": "Oauth2 Resource Indicator", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 Token endpoint" }, + "oauth2Scope": { "index": 60, "kind": "parameter", "displayName": "Oauth2 Scope", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 scope" }, + "oauth2TokenEndpoint": { "index": 61, "kind": "parameter", "displayName": "Oauth2 Token Endpoint", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 Resource Indicator" }, + "sslContextParameters": { "index": 62, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "description": "To configure security using SSLContextParameters. Important: Only one instance of org.apache.camel.util.jsse.SSLContextParameters is supported per HttpComponent. If you [...] + "x509HostnameVerifier": { "index": 63, "kind": "parameter", "displayName": "X509 Hostname Verifier", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "javax.net.ssl.HostnameVerifier", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom X509HostnameVerifier such as DefaultHostnameVerifier or NoopHostnameVerifier" } } } diff --git a/components/camel-atmosphere-websocket/src/main/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpoint.java b/components/camel-atmosphere-websocket/src/main/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpoint.java index b323e2556eb..93651e17097 100644 --- a/components/camel-atmosphere-websocket/src/main/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpoint.java +++ b/components/camel-atmosphere-websocket/src/main/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpoint.java @@ -34,14 +34,14 @@ import org.apache.camel.util.StringHelper; * Expose WebSocket endpoints using the Atmosphere framework. */ @UriEndpoint(firstVersion = "2.14.0", scheme = "atmosphere-websocket", extendsScheme = "servlet", - title = "Atmosphere Websocket", - syntax = "atmosphere-websocket:servicePath", category = { Category.HTTP, Category.NETWORKING }, + title = "Atmosphere Websocket", syntax = "atmosphere-websocket:servicePath", category = { + Category.HTTP, Category.NETWORKING }, headersClass = WebsocketConstants.class) @Metadata(excludeProperties = "httpUri,contextPath,cookieHandler,connectionClose,authMethod,authMethodPriority,authUsername,authPassword,authDomain,authHost,authBearerToken," + "copyHeaders,httpMethod,ignoreResponseBody,preserveHostHeader,throwExceptionOnFailure,okStatusCodeRange," + "proxyAuthScheme,proxyAuthMethod,proxyAuthUsername,proxyAuthPassword,proxyAuthHost,proxyAuthPort,proxyAuthDomain," + "proxyAuthNtHost,proxyAuthScheme,proxyHost,proxyPort," - + "oauth2ClientId,oauth2ClientSecret,oauth2TokenEndpoint,oauth2Scope,oauth2CacheTokens,oauth2CachedTokensDefaultExpirySeconds,oauth2CachedTokensExpirationMarginSeconds", + + "oauth2ClientId,oauth2ClientSecret,oauth2TokenEndpoint,oauth2Scope,oauth2CacheTokens,oauth2CachedTokensDefaultExpirySeconds,oauth2CachedTokensExpirationMarginSeconds,oauth2ResourceIndicator", annotations = { "protocol=http", }) diff --git a/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpCommonEndpoint.java b/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpCommonEndpoint.java index 0b8c337b386..121079341f3 100644 --- a/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpCommonEndpoint.java +++ b/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpCommonEndpoint.java @@ -34,7 +34,8 @@ import org.apache.camel.util.CollectionHelper; public abstract class HttpCommonEndpoint extends DefaultEndpoint implements HeaderFilterStrategyAware, DiscoverableService, EndpointServiceLocation { - // Note: all options must be documented with description in annotations so extended components can access the documentation + // Note: all options must be documented with description in annotations so + // extended components can access the documentation HttpCommonComponent component; @@ -66,17 +67,16 @@ public abstract class HttpCommonEndpoint extends DefaultEndpoint @UriParam(defaultValue = "true", description = "If this option is false the Servlet will disable the HTTP streaming and set the content-length header on the response") boolean chunked = true; - @UriParam(label = "common", - description = "Determines whether or not the raw input stream is cached or not." - + " The Camel consumer (camel-servlet, camel-jetty etc.) will by default cache the input stream to support reading it multiple times to ensure it Camel" - + " can retrieve all data from the stream. However you can set this option to true when you for example need" - + " to access the raw stream, such as streaming it directly to a file or other persistent store." - + " DefaultHttpBinding will copy the request input stream into a stream cache and put it into message body" - + " if this option is false to support reading the stream multiple times." - + " If you use Servlet to bridge/proxy an endpoint then consider enabling this option to improve performance," - + " in case you do not need to read the message payload multiple times." - + " The producer (camel-http) will by default cache the response body stream. If setting this option to true," - + " then the producers will not cache the response body stream but use the response stream as-is (the stream can only be read once) as the message body.") + @UriParam(label = "common", description = "Determines whether or not the raw input stream is cached or not." + + " The Camel consumer (camel-servlet, camel-jetty etc.) will by default cache the input stream to support reading it multiple times to ensure it Camel" + + " can retrieve all data from the stream. However you can set this option to true when you for example need" + + " to access the raw stream, such as streaming it directly to a file or other persistent store." + + " DefaultHttpBinding will copy the request input stream into a stream cache and put it into message body" + + " if this option is false to support reading the stream multiple times." + + " If you use Servlet to bridge/proxy an endpoint then consider enabling this option to improve performance," + + " in case you do not need to read the message payload multiple times." + + " The producer (camel-http) will by default cache the response body stream. If setting this option to true," + + " then the producers will not cache the response body stream but use the response stream as-is (the stream can only be read once) as the message body.") boolean disableStreamCache; @UriParam(label = "common", description = "If enabled and an Exchange failed processing on the consumer side, and if the caused Exception was send back serialized" @@ -105,8 +105,7 @@ public abstract class HttpCommonEndpoint extends DefaultEndpoint @UriParam(label = "consumer", description = "Used to only allow consuming if the HttpMethod matches, such as GET/POST/PUT etc. Multiple methods can be specified separated by comma.") String httpMethodRestrict; - @UriParam(label = "consumer", - description = "To use a custom buffer size on the jakarta.servlet.ServletResponse.") + @UriParam(label = "consumer", description = "To use a custom buffer size on the jakarta.servlet.ServletResponse.") Integer responseBufferSize; @UriParam(label = "producer,advanced", description = "If this option is true, The http producer won't read response body and cache the input stream") @@ -135,8 +134,7 @@ public abstract class HttpCommonEndpoint extends DefaultEndpoint description = "The status codes which are considered a success response. The values are inclusive. Multiple ranges can be" + " defined, separated by comma, e.g. 200-204,209,301-304. Each range must be a single number or from-to with the dash included.") private String okStatusCodeRange = "200-299"; - @UriParam(label = "consumer", defaultValue = "false", - description = "Configure the consumer to work in async mode") + @UriParam(label = "consumer", defaultValue = "false", description = "Configure the consumer to work in async mode") private boolean async; @UriParam(label = "producer,advanced", description = "Configure a cookie handler to maintain a HTTP session") private CookieHandler cookieHandler; @@ -161,11 +159,12 @@ public abstract class HttpCommonEndpoint extends DefaultEndpoint @UriParam(label = "producer,security", secret = true, description = "OAuth2 client secret") private String oauth2ClientSecret; @UriParam(label = "producer,security", description = "OAuth2 Token endpoint") + private String oauth2ResourceIndicator; + @UriParam(label = "producer,security", description = "OAuth2 Resource Indicator") private String oauth2TokenEndpoint; @UriParam(label = "producer,security", description = "OAuth2 scope") private String oauth2Scope; - @UriParam(label = "producer,security", defaultValue = "false", - description = "Whether to cache OAuth2 client tokens.") + @UriParam(label = "producer,security", defaultValue = "false", description = "Whether to cache OAuth2 client tokens.") private boolean oauth2CacheTokens = false; @UriParam(label = "producer,security", defaultValue = "3600", description = "Default expiration time for cached OAuth2 tokens, in seconds. Used if token response does not contain 'expires_in' field.") @@ -250,12 +249,13 @@ public abstract class HttpCommonEndpoint extends DefaultEndpoint @Override public boolean isLenientProperties() { - // true to allow dynamic URI options to be configured and passed to external system for eg. the HttpProducer + // true to allow dynamic URI options to be configured and passed to external + // system for eg. the HttpProducer return true; } // Service Registration - //------------------------------------------------------------------------- + // ------------------------------------------------------------------------- @Override public Map<String, String> getServiceProperties() { @@ -266,7 +266,7 @@ public abstract class HttpCommonEndpoint extends DefaultEndpoint } // Properties - //------------------------------------------------------------------------- + // ------------------------------------------------------------------------- /** * @deprecated use {@link #getHttpBinding()} @@ -302,7 +302,7 @@ public abstract class HttpCommonEndpoint extends DefaultEndpoint } public String getPath() { - //if the path is empty, we just return the default path here + // if the path is empty, we just return the default path here return httpUri.getPath().isEmpty() ? "/" : httpUri.getPath(); } @@ -867,6 +867,17 @@ public abstract class HttpCommonEndpoint extends DefaultEndpoint return oauth2Scope; } + /** + * OAuth2 Resource Indicator + */ + public void setOauth2ResourceIndicator(String oauth2ResourceIndicator) { + this.oauth2ResourceIndicator = oauth2ResourceIndicator; + } + + public String getOauth2ResourceIndicator() { + return this.oauth2ResourceIndicator; + } + /** * OAuth2 scope */ diff --git a/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointConfigurer.java b/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointConfigurer.java index f5b6522253b..2d2fc64d1cb 100644 --- a/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointConfigurer.java +++ b/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointConfigurer.java @@ -105,6 +105,8 @@ public class HttpEndpointConfigurer extends PropertyConfigurerSupport implements case "oauth2ClientId": target.setOauth2ClientId(property(camelContext, java.lang.String.class, value)); return true; case "oauth2clientsecret": case "oauth2ClientSecret": target.setOauth2ClientSecret(property(camelContext, java.lang.String.class, value)); return true; + case "oauth2resourceindicator": + case "oauth2ResourceIndicator": target.setOauth2ResourceIndicator(property(camelContext, java.lang.String.class, value)); return true; case "oauth2scope": case "oauth2Scope": target.setOauth2Scope(property(camelContext, java.lang.String.class, value)); return true; case "oauth2tokenendpoint": @@ -236,6 +238,8 @@ public class HttpEndpointConfigurer extends PropertyConfigurerSupport implements case "oauth2ClientId": return java.lang.String.class; case "oauth2clientsecret": case "oauth2ClientSecret": return java.lang.String.class; + case "oauth2resourceindicator": + case "oauth2ResourceIndicator": return java.lang.String.class; case "oauth2scope": case "oauth2Scope": return java.lang.String.class; case "oauth2tokenendpoint": @@ -368,6 +372,8 @@ public class HttpEndpointConfigurer extends PropertyConfigurerSupport implements case "oauth2ClientId": return target.getOauth2ClientId(); case "oauth2clientsecret": case "oauth2ClientSecret": return target.getOauth2ClientSecret(); + case "oauth2resourceindicator": + case "oauth2ResourceIndicator": return target.getOauth2ResourceIndicator(); case "oauth2scope": case "oauth2Scope": return target.getOauth2Scope(); case "oauth2tokenendpoint": diff --git a/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointUriFactory.java b/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointUriFactory.java index 6195464445e..9138d8da85c 100644 --- a/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointUriFactory.java +++ b/components/camel-http/src/generated/java/org/apache/camel/component/http/HttpEndpointUriFactory.java @@ -24,7 +24,7 @@ public class HttpEndpointUriFactory extends org.apache.camel.support.component.E private static final Set<String> SECRET_PROPERTY_NAMES; private static final Set<String> MULTI_VALUE_PREFIXES; static { - Set<String> props = new HashSet<>(63); + Set<String> props = new HashSet<>(64); props.add("authBearerToken"); props.add("authDomain"); props.add("authHost"); @@ -67,6 +67,7 @@ public class HttpEndpointUriFactory extends org.apache.camel.support.component.E props.add("oauth2CachedTokensExpirationMarginSeconds"); props.add("oauth2ClientId"); props.add("oauth2ClientSecret"); + props.add("oauth2ResourceIndicator"); props.add("oauth2Scope"); props.add("oauth2TokenEndpoint"); props.add("okStatusCodeRange"); diff --git a/components/camel-http/src/generated/resources/META-INF/org/apache/camel/component/http/http.json b/components/camel-http/src/generated/resources/META-INF/org/apache/camel/component/http/http.json index 0c68d9a4c50..10d843bf738 100644 --- a/components/camel-http/src/generated/resources/META-INF/org/apache/camel/component/http/http.json +++ b/components/camel-http/src/generated/resources/META-INF/org/apache/camel/component/http/http.json @@ -148,9 +148,10 @@ "oauth2CacheTokens": { "index": 56, "kind": "parameter", "displayName": "Oauth2 Cache Tokens", "group": "security", "label": "producer,security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to cache OAuth2 client tokens." }, "oauth2ClientId": { "index": 57, "kind": "parameter", "displayName": "Oauth2 Client Id", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "OAuth2 client id" }, "oauth2ClientSecret": { "index": 58, "kind": "parameter", "displayName": "Oauth2 Client Secret", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "OAuth2 client secret" }, - "oauth2Scope": { "index": 59, "kind": "parameter", "displayName": "Oauth2 Scope", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 scope" }, - "oauth2TokenEndpoint": { "index": 60, "kind": "parameter", "displayName": "Oauth2 Token Endpoint", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 Token endpoint" }, - "sslContextParameters": { "index": 61, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "description": "To configure security using SSLContextParameters. Important: Only one instance of org.apache.camel.util.jsse.SSLContextParameters is supported per HttpComponent. If you [...] - "x509HostnameVerifier": { "index": 62, "kind": "parameter", "displayName": "X509 Hostname Verifier", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "javax.net.ssl.HostnameVerifier", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom X509HostnameVerifier such as DefaultHostnameVerifier or NoopHostnameVerifier" } + "oauth2ResourceIndicator": { "index": 59, "kind": "parameter", "displayName": "Oauth2 Resource Indicator", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 Token endpoint" }, + "oauth2Scope": { "index": 60, "kind": "parameter", "displayName": "Oauth2 Scope", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 scope" }, + "oauth2TokenEndpoint": { "index": 61, "kind": "parameter", "displayName": "Oauth2 Token Endpoint", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 Resource Indicator" }, + "sslContextParameters": { "index": 62, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "description": "To configure security using SSLContextParameters. Important: Only one instance of org.apache.camel.util.jsse.SSLContextParameters is supported per HttpComponent. If you [...] + "x509HostnameVerifier": { "index": 63, "kind": "parameter", "displayName": "X509 Hostname Verifier", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "javax.net.ssl.HostnameVerifier", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom X509HostnameVerifier such as DefaultHostnameVerifier or NoopHostnameVerifier" } } } diff --git a/components/camel-http/src/generated/resources/META-INF/org/apache/camel/component/http/https.json b/components/camel-http/src/generated/resources/META-INF/org/apache/camel/component/http/https.json index 60b5e229cc2..b0ea6dc4976 100644 --- a/components/camel-http/src/generated/resources/META-INF/org/apache/camel/component/http/https.json +++ b/components/camel-http/src/generated/resources/META-INF/org/apache/camel/component/http/https.json @@ -148,9 +148,10 @@ "oauth2CacheTokens": { "index": 56, "kind": "parameter", "displayName": "Oauth2 Cache Tokens", "group": "security", "label": "producer,security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to cache OAuth2 client tokens." }, "oauth2ClientId": { "index": 57, "kind": "parameter", "displayName": "Oauth2 Client Id", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "OAuth2 client id" }, "oauth2ClientSecret": { "index": 58, "kind": "parameter", "displayName": "Oauth2 Client Secret", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "OAuth2 client secret" }, - "oauth2Scope": { "index": 59, "kind": "parameter", "displayName": "Oauth2 Scope", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 scope" }, - "oauth2TokenEndpoint": { "index": 60, "kind": "parameter", "displayName": "Oauth2 Token Endpoint", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 Token endpoint" }, - "sslContextParameters": { "index": 61, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "description": "To configure security using SSLContextParameters. Important: Only one instance of org.apache.camel.util.jsse.SSLContextParameters is supported per HttpComponent. If you [...] - "x509HostnameVerifier": { "index": 62, "kind": "parameter", "displayName": "X509 Hostname Verifier", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "javax.net.ssl.HostnameVerifier", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom X509HostnameVerifier such as DefaultHostnameVerifier or NoopHostnameVerifier" } + "oauth2ResourceIndicator": { "index": 59, "kind": "parameter", "displayName": "Oauth2 Resource Indicator", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 Token endpoint" }, + "oauth2Scope": { "index": 60, "kind": "parameter", "displayName": "Oauth2 Scope", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 scope" }, + "oauth2TokenEndpoint": { "index": 61, "kind": "parameter", "displayName": "Oauth2 Token Endpoint", "group": "security", "label": "producer,security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "OAuth2 Resource Indicator" }, + "sslContextParameters": { "index": 62, "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "autowired": false, "secret": false, "description": "To configure security using SSLContextParameters. Important: Only one instance of org.apache.camel.util.jsse.SSLContextParameters is supported per HttpComponent. If you [...] + "x509HostnameVerifier": { "index": 63, "kind": "parameter", "displayName": "X509 Hostname Verifier", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "javax.net.ssl.HostnameVerifier", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom X509HostnameVerifier such as DefaultHostnameVerifier or NoopHostnameVerifier" } } } diff --git a/components/camel-http/src/main/docs/http-component.adoc b/components/camel-http/src/main/docs/http-component.adoc index 01df39e161a..35d4fe65f2a 100644 --- a/components/camel-http/src/main/docs/http-component.adoc +++ b/components/camel-http/src/main/docs/http-component.adoc @@ -372,7 +372,7 @@ String scope = "my-scope"; // optional scope String resourceIndicator = "https://localhost:9090"; // optional, for RFC 8707 from("direct:start") - .to("https://localhost:9090/?oauth2ClientId=" + clientId + "&oauth2ClientSecret=" + clientSecret + "&oauth2TokenEndpoint=" + tokenEndpoint + "&oauth2Scope=" + scope + "&resource=" + resourceIndicator); + .to("https://localhost:9090/?oauth2ClientId=" + clientId + "&oauth2ClientSecret=" + clientSecret + "&oauth2TokenEndpoint=" + tokenEndpoint + "&oauth2Scope=" + scope + "&oauth2ResourceIndicator=" + resourceIndicator); ------------------------------------------------------------------------------------ NOTE: Resource Indicator is the URL to the actual endpoint as defined in the component URI. diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HttpEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HttpEndpointBuilderFactory.java index 9096f6707c3..b9ff0d858ee 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HttpEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HttpEndpointBuilderFactory.java @@ -835,6 +835,20 @@ public interface HttpEndpointBuilderFactory { doSetProperty("oauth2ClientSecret", oauth2ClientSecret); return this; } + /** + * OAuth2 Token endpoint. + * + * The option is a: <code>java.lang.String</code> type. + * + * Group: security + * + * @param oauth2ResourceIndicator the value to set + * @return the dsl builder + */ + default HttpEndpointBuilder oauth2ResourceIndicator(String oauth2ResourceIndicator) { + doSetProperty("oauth2ResourceIndicator", oauth2ResourceIndicator); + return this; + } /** * OAuth2 scope. * @@ -850,7 +864,7 @@ public interface HttpEndpointBuilderFactory { return this; } /** - * OAuth2 Token endpoint. + * OAuth2 Resource Indicator. * * The option is a: <code>java.lang.String</code> type. *