...
We will add a set of new properties in the org.apache.kafka.connect.runtime.WorkerConfig
class. It will allow the REST server administrator to configure headers based on their security policies. We borrow and take advantage of the Jetty HeaderFilter
class and use the same format of headerConfig
, includedPaths
, excludedPaths
, includedMimeTypes
, excludedMimeTypes
, includedHttpMethods
, and excludedHttpMethods
init parameters as HeaderFilter
. Please see two references for Jetty HeaderFilter.
https://www.eclipse.org/jetty/documentation/current/header-filter.html
https://www.eclipse.org/jetty/javadoc/9.4.24.v20191120/org/eclipse/jetty/servlets/HeaderFilter.html
Description of Properties
Property Name | Type | Default | Importance | Description | Example for Value |
---|---|---|---|---|---|
response.http.headers | LIST | "" | medium | Defines names of headers which will be separated by comma. | default, connector1, connector2 |
response.http.headers.{name}.header.config | STRING | "" | low | Define a set of HTTP headers for header defined by {name} which will be one of names defined in property response.http.headers. . | set X-Frame-Options: DENY, "add Cache-Control: no-cache, no-store, must-revalidate", setDate Expires: 31540000000, addDate Last-Modified: 0 |
response.http.headers.{name}. included.paths | STRING | "" | low | It is a comma separated values of included path specs applied to HTTP headers. | /connectors/connector1/topics/* |
response.http.headers.{name}.excluded.paths | STRING | "" | low | It is a comma separated values of excluded path specs applied to HTTP headers. | /connectors/connector1/status |
response.http.headers.{name}.included.mime.types | STRING | "" | low | It is a comma separated values of included mime types applied to HTTP headers | application/json |
response.http.headers.{name}.excluded.mime.types | STRING | "" | low | It is a comma separated values of excluded mime types applied to HTTP headers. | application/xml |
response.http.headers.{name}.included.http.methods | STRING | "" | low | It is a comma separated values of included http methods applied to HTTP headers Validate Values: see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods | POST,PUT |
response.http.headers.{name}.excluded.http.methods | STRING | "" | low | It is a comma separated values of excluded http methods applied to HTTP headers Validate Values: see https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods | GET |
Detailed Explanation for response.http.headers.{name}.header.config
...