This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch camel-3.11.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.11.x by this push:
new 4f78bc7 CAMEL-16793: Document how useXForwardHeaders influences the
API host configuration
4f78bc7 is described below
commit 4f78bc7c2b5f48f236fdbba54720ee0c78b0a391
Author: James Netherton <[email protected]>
AuthorDate: Tue Sep 7 08:49:44 2021 +0100
CAMEL-16793: Document how useXForwardHeaders influences the API host
configuration
---
.../org/apache/camel/catalog/docs/openapi-java.adoc | 18 ++++++++++++++++++
.../org/apache/camel/catalog/docs/swagger-java.adoc | 18 ++++++++++++++++++
.../camel-openapi-java/src/main/docs/openapi-java.adoc | 18 ++++++++++++++++++
.../camel-swagger-java/src/main/docs/swagger-java.adoc | 18 ++++++++++++++++++
docs/components/modules/others/pages/openapi-java.adoc | 18 ++++++++++++++++++
docs/components/modules/others/pages/swagger-java.adoc | 18 ++++++++++++++++++
6 files changed, 108 insertions(+)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/openapi-java.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/openapi-java.adoc
index 897cab1..8bae92d 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/openapi-java.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/openapi-java.adoc
@@ -194,6 +194,24 @@ the HTTP Accept header is used to detect if json or yaml
can be
accepted. If either both is accepted or none was set as accepted then
json is returned as the default format.
+== useXForwardHeaders and API URL resolution
+
+The OpenApi specification allows you to specify the host, port & path that is
serving the API. In OpenApi V2 this is done
+via the `host` field and in OpenAPI V3 it is part of the `servers` field.
+
+By default, the value for these fields is determined by `X-Forwarded` headers,
`X-Forwarded-Host` & `X-Forwarded-Proto`.
+
+This can be overridden by disabling the lookup of `X-Forwarded` headers and by
specifying your own host, port & scheme on the REST configuration.
+
+[source,java]
+----
+restConfiguration().component("netty-http")
+ .useXForwardHeaders(false)
+ .apiProperty("schemes", "https");
+ .host("localhost")
+ .port(8080);
+----
+
== Examples
In the Apache Camel distribution we ship the `camel-example-openapi-cdi`
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/swagger-java.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/swagger-java.adoc
index d17fbf4..593c336 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/swagger-java.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/swagger-java.adoc
@@ -194,6 +194,24 @@ the HTTP Accept header is used to detect if json or yaml
can be
accepted. If either both is accepted or none was set as accepted then
json is returned as the default format.
+== useXForwardHeaders and API URL resolution
+
+The Swagger specification allows you to specify the host, port & path that is
serving the API. This is done
+via the `host` field.
+
+By default, the value for these fields is determined by `X-Forwarded` headers,
`X-Forwarded-Host` & `X-Forwarded-Proto`.
+
+This can be overridden by disabling the lookup of `X-Forwarded` headers and by
specifying your own host, port & scheme on the REST configuration.
+
+[source,java]
+----
+restConfiguration().component("netty-http")
+ .useXForwardHeaders(false)
+ .apiProperty("schemes", "https");
+ .host("localhost")
+ .port(8080);
+----
+
== Examples
In the Apache Camel distribution we ship
diff --git a/components/camel-openapi-java/src/main/docs/openapi-java.adoc
b/components/camel-openapi-java/src/main/docs/openapi-java.adoc
index 897cab1..8bae92d 100644
--- a/components/camel-openapi-java/src/main/docs/openapi-java.adoc
+++ b/components/camel-openapi-java/src/main/docs/openapi-java.adoc
@@ -194,6 +194,24 @@ the HTTP Accept header is used to detect if json or yaml
can be
accepted. If either both is accepted or none was set as accepted then
json is returned as the default format.
+== useXForwardHeaders and API URL resolution
+
+The OpenApi specification allows you to specify the host, port & path that is
serving the API. In OpenApi V2 this is done
+via the `host` field and in OpenAPI V3 it is part of the `servers` field.
+
+By default, the value for these fields is determined by `X-Forwarded` headers,
`X-Forwarded-Host` & `X-Forwarded-Proto`.
+
+This can be overridden by disabling the lookup of `X-Forwarded` headers and by
specifying your own host, port & scheme on the REST configuration.
+
+[source,java]
+----
+restConfiguration().component("netty-http")
+ .useXForwardHeaders(false)
+ .apiProperty("schemes", "https");
+ .host("localhost")
+ .port(8080);
+----
+
== Examples
In the Apache Camel distribution we ship the `camel-example-openapi-cdi`
diff --git a/components/camel-swagger-java/src/main/docs/swagger-java.adoc
b/components/camel-swagger-java/src/main/docs/swagger-java.adoc
index d17fbf4..593c336 100644
--- a/components/camel-swagger-java/src/main/docs/swagger-java.adoc
+++ b/components/camel-swagger-java/src/main/docs/swagger-java.adoc
@@ -194,6 +194,24 @@ the HTTP Accept header is used to detect if json or yaml
can be
accepted. If either both is accepted or none was set as accepted then
json is returned as the default format.
+== useXForwardHeaders and API URL resolution
+
+The Swagger specification allows you to specify the host, port & path that is
serving the API. This is done
+via the `host` field.
+
+By default, the value for these fields is determined by `X-Forwarded` headers,
`X-Forwarded-Host` & `X-Forwarded-Proto`.
+
+This can be overridden by disabling the lookup of `X-Forwarded` headers and by
specifying your own host, port & scheme on the REST configuration.
+
+[source,java]
+----
+restConfiguration().component("netty-http")
+ .useXForwardHeaders(false)
+ .apiProperty("schemes", "https");
+ .host("localhost")
+ .port(8080);
+----
+
== Examples
In the Apache Camel distribution we ship
diff --git a/docs/components/modules/others/pages/openapi-java.adoc
b/docs/components/modules/others/pages/openapi-java.adoc
index e2c7683..e02dd69 100644
--- a/docs/components/modules/others/pages/openapi-java.adoc
+++ b/docs/components/modules/others/pages/openapi-java.adoc
@@ -196,6 +196,24 @@ the HTTP Accept header is used to detect if json or yaml
can be
accepted. If either both is accepted or none was set as accepted then
json is returned as the default format.
+== useXForwardHeaders and API URL resolution
+
+The OpenApi specification allows you to specify the host, port & path that is
serving the API. In OpenApi V2 this is done
+via the `host` field and in OpenAPI V3 it is part of the `servers` field.
+
+By default, the value for these fields is determined by `X-Forwarded` headers,
`X-Forwarded-Host` & `X-Forwarded-Proto`.
+
+This can be overridden by disabling the lookup of `X-Forwarded` headers and by
specifying your own host, port & scheme on the REST configuration.
+
+[source,java]
+----
+restConfiguration().component("netty-http")
+ .useXForwardHeaders(false)
+ .apiProperty("schemes", "https");
+ .host("localhost")
+ .port(8080);
+----
+
== Examples
In the Apache Camel distribution we ship the `camel-example-openapi-cdi`
diff --git a/docs/components/modules/others/pages/swagger-java.adoc
b/docs/components/modules/others/pages/swagger-java.adoc
index c2b971b..d966ea2 100644
--- a/docs/components/modules/others/pages/swagger-java.adoc
+++ b/docs/components/modules/others/pages/swagger-java.adoc
@@ -196,6 +196,24 @@ the HTTP Accept header is used to detect if json or yaml
can be
accepted. If either both is accepted or none was set as accepted then
json is returned as the default format.
+== useXForwardHeaders and API URL resolution
+
+The Swagger specification allows you to specify the host, port & path that is
serving the API. This is done
+via the `host` field.
+
+By default, the value for these fields is determined by `X-Forwarded` headers,
`X-Forwarded-Host` & `X-Forwarded-Proto`.
+
+This can be overridden by disabling the lookup of `X-Forwarded` headers and by
specifying your own host, port & scheme on the REST configuration.
+
+[source,java]
+----
+restConfiguration().component("netty-http")
+ .useXForwardHeaders(false)
+ .apiProperty("schemes", "https");
+ .host("localhost")
+ .port(8080);
+----
+
== Examples
In the Apache Camel distribution we ship