object CSRF

Source
CSRF.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CSRF
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type CSRFCheckFailed = CSRFCheckFailed.type
  2. abstract type CSRFToken

Value Members

  1. val CSRFTokenLength: Int
  2. val SHA1ByteLen: Int
  3. val SigningAlgo: String
  4. def apply[F[_], G[_]](headerName: CaseInsensitiveString = ..., cookieName: String = "csrf-token", clock: Clock = Clock.systemUTC(), secure: Boolean = false, onFailure: Response[G] = Response[G](Status.Forbidden), createIfNotFound: Boolean = true, key: SecretKey, headerCheck: (Request[G]) ⇒ Boolean)(implicit arg0: Sync[F], arg1: Applicative[G]): CSRF[F, G]

    Default method for constructing CSRF middleware *

  5. def buildSigningKey[F[_]](array: Array[Byte])(implicit F: Sync[F]): F[SecretKey]

    Build a new HMACSHA1 Key for our CSRF Middleware from key bytes.

    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, and any value above will be truncated (not good for entropy).

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

  6. def default[F[_], G[_]](headerName: CaseInsensitiveString = ..., cookieName: String = "csrf-token", clock: Clock = Clock.systemUTC(), secure: Boolean = false, onFailure: Response[G] = Response[G](Status.Forbidden), createIfNotFound: Boolean = true, key: SecretKey, host: String, sc: Scheme, port: Option[Int])(implicit arg0: Sync[F], arg1: Applicative[G]): CSRF[F, G]

    Default method for constructing CSRF middleware *

  7. def defaultOriginCheck[F[_]](r: Request[F], host: String, sc: Scheme, port: Option[Int]): Boolean

    Check origin matches our proposed origin.

  8. def generateSigningKey[F[_]]()(implicit F: Sync[F]): F[SecretKey]

    Generate a signing Key for the CSRF token *

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

    A Constant-time string equality *

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

    A Constant-time string equality *

  12. def unlift(s: CSRFToken): String
  13. def withGeneratedKey[F[_], G[_]](headerName: CaseInsensitiveString = ..., cookieName: String = "csrf-token", clock: Clock = Clock.systemUTC(), secure: Boolean = false, onFailure: Response[G] = Response[G](Status.Forbidden), createIfNotFound: Boolean = true, headerCheck: (Request[G]) ⇒ Boolean)(implicit arg0: Sync[F], arg1: Applicative[G]): F[CSRF[F, G]]

    Sugar for instantiating a middleware by generating a key *

  14. def withKeyBytes[F[_], G[_]](keyBytes: Array[Byte], headerName: CaseInsensitiveString = ..., cookieName: String = "csrf-token", clock: Clock = Clock.systemUTC(), onFailure: Response[G] = Response[G](Status.Forbidden), secure: Boolean = false, createIfNotFound: Boolean = true, headerCheck: (Request[G]) ⇒ Boolean)(implicit arg0: Sync[F], arg1: Applicative[G]): F[CSRF[F, G]]

    Sugar for pre-loading a key *

  15. object CSRFCheckFailed extends Exception with NoStackTrace with Product with Serializable