CSRF

object CSRF
Companion:
class
class Object
trait Matchable
class Any
CSRF.type

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]]

Value members

Concrete methods

def buildSigningKey[F[_]](array: Array[Byte])(implicit F: Sync[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://datatracker.ietf.org/doc/html/rfc2104#section-3

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

def checkCSRFDefault[F[_], G[_]](implicit F: Sync[F]): CSRF[F, G] => F => G
def checkCSRFinHeaderAndForm[F[_], G[_] : Concurrent](fieldName: String, nt: FunctionK[G, F])(implicit evidence$12: Concurrent[G], F: Sync[F]): CSRF[F, G] => F => G
def generateSigningKey[F[_]]()(implicit F: Sync[F]): F[SecretKey]

Generate a signing Key for the CSRF token

Generate a signing Key for the CSRF token

def isEqual(s1: String, s2: String): Boolean

A Constant-time string equality

A Constant-time string equality

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

A Constant-time string equality

A Constant-time string equality

def withDefaultOriginCheck[F[_] : Sync, G[_] : Applicative](key: SecretKey, host: String, scheme: Scheme, port: Option[Int]): CSRFBuilder[F, G]
def withDefaultOriginCheckFormAware[F[_] : Sync, G[_] : Concurrent](fieldName: String, nt: FunctionK[G, F])(key: SecretKey, host: String, scheme: Scheme, port: Option[Int]): CSRFBuilder[F, G]
def withGeneratedKey[F[_] : Sync, G[_] : Applicative](headerCheck: Request[G] => Boolean): F[CSRFBuilder[F, G]]
def withKeyBytes[F[_] : Sync, G[_] : Applicative](keyBytes: Array[Byte], headerCheck: Request[G] => Boolean): F[CSRFBuilder[F, G]]

Concrete fields

Deprecated fields

@deprecated("Unused. Will be removed", "0.20.10")
Deprecated