Class PermissionsPolicyHeaderWriter

java.lang.Object
org.springframework.security.web.header.writers.PermissionsPolicyHeaderWriter
All Implemented Interfaces:
HeaderWriter

public final class PermissionsPolicyHeaderWriter extends Object implements HeaderWriter
Provides support for Permisisons Policy.

Permissions Policy allows web developers to selectively enable, disable, and modify the behavior of certain APIs and web features in the browser.

A declaration of a permissions policy contains a set of security policies, each responsible for declaring the restrictions for a particular feature type.

Since:
5.5
  • Constructor Details

  • Method Details

    • setPolicy

      public void setPolicy(String policy)
      Sets the policy to be used in the response header.
      Parameters:
      policy - a permissions policy
      Throws:
      IllegalArgumentException - if policy is null
    • writeHeaders

      public void writeHeaders(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      Description copied from interface: HeaderWriter
      Create a Header instance.
      Specified by:
      writeHeaders in interface HeaderWriter
      Parameters:
      request - the request
      response - the response
    • toString

      public String toString()
      Overrides:
      toString in class Object