Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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, excludedPathsincludedMimeTypesexcludedMimeTypesincludedHttpMethods, 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 NameTypeDefaultImportanceDescriptionExample for Value
response.http.headersLIST""medium

Defines names of headers which will be separated by comma.
The name could be any string which uniquely identify header. 
Validate Values: string not containing white spaces

default, connector1, connector2
response.http.headers.{name}.header.configSTRING""low

Define a set of HTTP headers for header defined by {name} which will be one of names defined in property response.http.headers.
Validate Values: See Detailed Explanation section

for this property due to the format is more complex

.

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.pathsSTRING""low

It is comma separated values of included path specs applied to HTTP headers.
Validate Values: See path spec rules section.

/connectors/connector1/topics/*
response.http.headers.{name}.excluded.pathsSTRING""low

It is comma separated values of excluded path specs applied to HTTP headers. 
Validate Values: See path spec rules section.

/connectors/connector1/status
response.http.headers.{name}.included.mime.typesSTRING""low

It is comma separated values of included mime types applied to HTTP headers
Validate Values: see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types

application/json
response.http.headers.{name}.excluded.mime.typesSTRING""low

It is comma separated values of excluded mime types applied to HTTP headers.
Validate Values: see https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types

application/xml
response.http.headers.{name}.included.http.methodsSTRING""lowIt is 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.methodsSTRING""lowIt is 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

...