case class CSPConfig(reportOnly: Boolean = false, shouldFilterRequest: (RequestHeader) => Boolean = _ => true, nonce: CSPNonceConfig = CSPNonceConfig(), hashes: Seq[CSPHashConfig] = Seq.empty, directives: Seq[CSPDirective] = Seq.empty) extends Product with Serializable
CSP Configuration.
- reportOnly
true if the header should be Content-Security-Policy-Report-Only.
- shouldFilterRequest
A function that decides based on the headers of the request if a check is needed.
- nonce
the CSP nonce configuration
- hashes
a list of CSP hashes that can be added to the header
- directives
the CSP directives configuration
- Source
- CSPConfig.scala
- See also
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- CSPConfig
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Instance Constructors
- new CSPConfig()
Java Constructor
- new CSPConfig(reportOnly: Boolean = false, shouldFilterRequest: (RequestHeader) => Boolean = _ => true, nonce: CSPNonceConfig = CSPNonceConfig(), hashes: Seq[CSPHashConfig] = Seq.empty, directives: Seq[CSPDirective] = Seq.empty)
- reportOnly
true if the header should be Content-Security-Policy-Report-Only.
- shouldFilterRequest
A function that decides based on the headers of the request if a check is needed.
- nonce
the CSP nonce configuration
- hashes
a list of CSP hashes that can be added to the header
- directives
the CSP directives configuration
Value Members
- val directives: Seq[CSPDirective]
- val hashes: Seq[CSPHashConfig]
- val nonce: CSPNonceConfig
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val reportOnly: Boolean
- val shouldFilterRequest: (RequestHeader) => Boolean
- def withDirectives(directives: List[CSPDirective]): CSPConfig
- def withHashes(hashes: List[CSPHashConfig]): CSPConfig
- def withNonce(nonce: CSPNonceConfig): CSPConfig
- def withReportOnly(reportOnly: Boolean): CSPConfig
- def withShouldProtect(shouldFilterRequest: Predicate[RequestHeader]): CSPConfig