@ConfigurationProperties(value="micronaut.views.csp") public class CspConfiguration extends Object implements Toggleable
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_ENABLED |
static String |
DEFAULT_FILTER_PATH |
static boolean |
DEFAULT_REPORT_ONLY |
static String |
FILTER_PATH
The path for endpoints settings.
|
static String |
PREFIX
The prefix for csp configuration.
|
Constructor and Description |
---|
CspConfiguration() |
Modifier and Type | Method and Description |
---|---|
String |
getFilterPath() |
Optional<String> |
getPolicyDirectives() |
boolean |
isEnabled() |
boolean |
isReportOnly() |
void |
setEnabled(boolean enabled)
Sets whether CSP is enabled.
|
void |
setFilterPath(String filterPath)
Sets the path the CSP filter should apply to.
|
void |
setPolicyDirectives(String policyDirectives)
Sets the policy directives.
|
void |
setReportOnly(boolean reportOnly)
If true, the Content-Security-Policy-Report-Only header will be sent instead
of Content-Security-Policy.
|
public static final String PREFIX
public static final String FILTER_PATH
public static final boolean DEFAULT_ENABLED
public static final boolean DEFAULT_REPORT_ONLY
public static final String DEFAULT_FILTER_PATH
public boolean isEnabled()
isEnabled
in interface Toggleable
public boolean isReportOnly()
public void setEnabled(boolean enabled)
enabled
- True if CSP is enabledpublic void setPolicyDirectives(@Nullable String policyDirectives)
policyDirectives
- CSP policy directivespublic void setReportOnly(boolean reportOnly)
reportOnly
- set to true for reporting purpose onlypublic String getFilterPath()