Versions Compared

Key

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

...

The current Connect REST server only sets a few default HTTP response headers. It's missing many headers, including most headers related to security. The Connect REST server uses an embedded Jetty server as the Java HTTP server and Java Servlet container, so users have no way to configure HTTP response headers for Connect REST server. Many customers using Connect REST server are demanding some headers related to security in the HTTP response. Some examples of headers are X-XSS-Protection, Content-Security-PolicyStrict-Transport-Security and X-Content-Type-Options.  Some resources need more protected than others due to security required. So we will allow site administrators to control which resources the user agent is allowed or is not allowed to load for given page. For this case, the sensitive resources need use Content-Security-Policy in response header. Some resources can only be accessed by HTTPS instead of HTTP, then Strict-Transport-Security response header (often abbreviated as HSTS) need be set to let a web site tell browsers that it should only be accessed using HTTPS. So that is why we provide feature to support configuring different headers for different resources.

Public Interfaces

There is no any changes on public interfaces. We follow same pattern like configuring different kafka listeners. We define a new property response.http.headers which define how many headers will be configured. The default value for response.http.headers is empty string which mean there is no any header configured for HTTP response. We define a new prefix "response.http.headers.<name>{name}.", then followed by a set of properties which define rules for header. The {name} will be one defined in response.http.headers. The following section has detailed description.

...

Description of Properties

response.http.headers

header.config

The format for header.config will be "[[action] [header]:[header value],..." which is a list of [action] [header]:[value] separated by comma ",". So it is a CSV of actions to perform on headers with the following syntax:
[action] [header name]: [header value],
[action] can be one of "set, add, setDate, or addDate" which specify an action will perform on header. 

...