CSRF

object CSRF extends CSRFSingletonPlatform
Companion
class
trait CSRFSingletonPlatform
class Object
trait Matchable
class Any

Type members

Classlikes

class CSRFBuilder[F[_], G[_]]
case object CSRFCheckFailed extends Exception with NoStackTrace

Types

type CSRFCheck[F[_], G[_]] = (Request[G], F[Response[G]]) => F[Response[G]]
type CSRFToken

Inherited types

type SecretKey = SecretKey
Inherited from
CSRFSingletonPlatform

Value members

Concrete methods

def apply[F[_], G[_]](key: SecretKey, headerCheck: Request[G] => Boolean)(implicit evidence$2: Async[F], evidence$3: Applicative[G]): CSRFBuilder[F, G]
def checkCSRFDefault[F[_], G[_]](implicit F: Async[F]): CSRF[F, G] => F => G
def checkCSRFinHeaderAndForm[F[_], G[_]](fieldName: String, nt: FunctionK[G, F])(implicit evidence$12: Concurrent[G], F: Async[F]): CSRF[F, G] => F => G
def defaultOriginCheck[F[_]](r: Request[F], host: String, sc: Scheme, port: Option[Int]): Boolean

Check origin matches our proposed origin.

Check origin matches our proposed origin.

def proxyOriginCheck[F[_]](r: Request[F], host: Host, xff: X-Forwarded-For): Boolean
def tokensEqual(s1: CSRFToken, s2: CSRFToken): Boolean

A Constant-time string equality

A Constant-time string equality

def unlift(s: CSRFToken): String
def withDefaultOriginCheck[F[_], G[_]](key: SecretKey, host: String, scheme: Scheme, port: Option[Int])(implicit evidence$4: Async[F], evidence$5: Applicative[G]): CSRFBuilder[F, G]
def withDefaultOriginCheckFormAware[F[_], G[_]](fieldName: String, nt: FunctionK[G, F])(key: SecretKey, host: String, scheme: Scheme, port: Option[Int])(implicit evidence$6: Async[F], evidence$7: Concurrent[G]): CSRFBuilder[F, G]
def withGeneratedKey[F[_], G[_]](headerCheck: Request[G] => Boolean)(implicit evidence$8: Async[F], evidence$9: Applicative[G]): F[CSRFBuilder[F, G]]
def withKeyBytes[F[_], G[_]](keyBytes: Array[Byte], headerCheck: Request[G] => Boolean)(implicit evidence$10: Async[F], evidence$11: Applicative[G]): F[CSRFBuilder[F, G]]

Inherited methods

def buildSigningKey[F[_]](array: Array[Byte])(implicit F: Async[F]): F[SecretKey]

Build a new HMACSHA1 Key for our CSRF Middleware from key bytes. This operation is unsafe, in that any amount less than 20 bytes will throw an exception when loaded into Mac. Any keys larger than 64 bytes are just hashed.

Build a new HMACSHA1 Key for our CSRF Middleware from key bytes. This operation is unsafe, in that any amount less than 20 bytes will throw an exception when loaded into Mac. Any keys larger than 64 bytes are just hashed.

For more information, refer to: https://tools.ietf.org/html/rfc2104#section-3

Use for loading a key from a config file, after having generated one safely

Inherited from
CSRFSingletonPlatform
def generateSigningKey[F[_]](implicit F: Async[F]): F[SecretKey]

Generate a signing Key for the CSRF token

Generate a signing Key for the CSRF token

Inherited from
CSRFSingletonPlatform
def isEqual(s1: String, s2: String): Boolean

A Constant-time string equality

A Constant-time string equality

Inherited from
CSRFSingletonPlatform

Concrete fields

val CSRFTokenLength: Int

Deprecated fields

@deprecated("Unused. Will be removed", "0.20.10")
val SHA1ByteLen: Int
Deprecated

Inherited fields

val SigningAlgo: String
Inherited from
CSRFSingletonPlatform