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
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
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
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- val directives: Seq[CSPDirective]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val hashes: Seq[CSPHashConfig]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val nonce: CSPNonceConfig
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val reportOnly: Boolean
- val shouldFilterRequest: (RequestHeader) ⇒ Boolean
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- 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