@ConfigurationProperties(value="micronaut.views.csp")
public class CspConfiguration
extends java.lang.Object
implements io.micronaut.core.util.Toggleable
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_ENABLED |
static java.lang.String |
DEFAULT_FILTER_PATH |
static boolean |
DEFAULT_REPORT_ONLY |
static java.lang.String |
FILTER_PATH
The path for endpoints settings.
|
static java.lang.String |
PREFIX
The prefix for csp configuration.
|
Constructor and Description |
---|
CspConfiguration() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFilterPath() |
java.util.Optional<java.lang.String> |
getPolicyDirectives() |
boolean |
isEnabled() |
boolean |
isReportOnly() |
void |
setEnabled(boolean enabled)
Sets whether CSP is enabled.
|
void |
setFilterPath(java.lang.String filterPath)
Sets the path the CSP filter should apply to.
|
void |
setPolicyDirectives(java.lang.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 java.lang.String PREFIX
public static final java.lang.String FILTER_PATH
public static final boolean DEFAULT_ENABLED
public static final boolean DEFAULT_REPORT_ONLY
public static final java.lang.String DEFAULT_FILTER_PATH
public boolean isEnabled()
isEnabled
in interface io.micronaut.core.util.Toggleable
public java.util.Optional<java.lang.String> getPolicyDirectives()
public boolean isReportOnly()
public void setEnabled(boolean enabled)
enabled
- True if CSP is enabledpublic void setPolicyDirectives(@Nullable java.lang.String policyDirectives)
policyDirectives
- CSP policy directivespublic void setReportOnly(boolean reportOnly)
reportOnly
- set to true for reporting purpose onlypublic java.lang.String getFilterPath()
public void setFilterPath(java.lang.String filterPath)
filterPath
- The filter path