Packages

object HandlerAspect extends HandlerAspects with Serializable

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HandlerAspect
  2. Serializable
  3. HandlerAspects
  4. HeaderModifier
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. final class Allow extends AnyVal
  2. final class AllowZIO extends AnyVal
  3. final class InterceptPatch[State] extends AnyVal
  4. final class InterceptPatchZIO[Env, State] extends AnyVal

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addCookie(cookie: Cookie.Response): HandlerAspect[Any, Unit]

    Sets a cookie in the response headers

    Sets a cookie in the response headers

    Definition Classes
    HandlerAspects
  5. def addCookieZIO[Env](cookie: ZIO[Env, Nothing, Cookie.Response])(implicit trace: Trace): HandlerAspect[Env, Unit]

    Sets an effectfully created cookie in the response headers.

    Sets an effectfully created cookie in the response headers.

    Definition Classes
    HandlerAspects
  6. final def addHeader(name: CharSequence, value: CharSequence): HandlerAspect[Any, Unit]
    Attributes
    protected
    Definition Classes
    HandlerAspectHeaderModifier
  7. final def addHeader[T](value: T)(implicit schema: Schema[T]): HandlerAspect[Any, Unit]

    Adds headers based on the given value.

    Adds headers based on the given value. The type of the value must have a schema and be a case class and all fields will be added as headers. So fields must be of primitive types (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these. The header names are the field names.

    Definition Classes
    HeaderModifier
  8. final def addHeader[T](name: String, value: T)(implicit schema: Schema[T]): HandlerAspect[Any, Unit]

    Adds a header / headers with the specified name and based on the given value.

    Adds a header / headers with the specified name and based on the given value. The value type must have a schema and can be a primitive type (e.g. Int, String, UUID, Instant etc.), a case class with a single field or a collection of either of these.

    Definition Classes
    HeaderModifier
  9. final def addHeader(header: Header): HandlerAspect[Any, Unit]
    Definition Classes
    HeaderModifier
  10. final def addHeaders(headers: Iterable[(CharSequence, CharSequence)]): HandlerAspect[Any, Unit]
    Definition Classes
    HeaderModifier
  11. final def addHeaders(headers: Headers): HandlerAspect[Any, Unit]
    Definition Classes
    HeaderModifier
  12. def allow: Allow

    Creates a middleware which can allow or disallow access to an http based on the predicate

    Creates a middleware which can allow or disallow access to an http based on the predicate

    Definition Classes
    HandlerAspects
  13. def allowZIO: AllowZIO

    Creates a middleware which can allow or disallow access to an http based on the effectful predicate.

    Creates a middleware which can allow or disallow access to an http based on the effectful predicate.

    Definition Classes
    HandlerAspects
  14. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  15. def basicAuth(u: String, p: String): HandlerAspect[Any, Unit]

    Creates a middleware for basic authentication that checks if the credentials are same as the ones given

    Creates a middleware for basic authentication that checks if the credentials are same as the ones given

    Definition Classes
    HandlerAspects
  16. def basicAuth(f: (Credentials) => Boolean): HandlerAspect[Any, Unit]

    Creates a middleware for basic authentication

    Creates a middleware for basic authentication

    Definition Classes
    HandlerAspects
  17. def basicAuthZIO[Env](f: (Credentials) => ZIO[Env, Response, Boolean])(implicit trace: Trace): HandlerAspect[Env, Unit]

    Creates a middleware for basic authentication using an effectful verification function

    Creates a middleware for basic authentication using an effectful verification function

    Definition Classes
    HandlerAspects
  18. def bearerAuth(f: (Secret) => Boolean): HandlerAspect[Any, Unit]

    Creates a middleware for bearer authentication that checks the token using the given function

    Creates a middleware for bearer authentication that checks the token using the given function

    Definition Classes
    HandlerAspects
  19. def bearerAuthZIO[Env](f: (Secret) => ZIO[Env, Response, Boolean])(implicit trace: Trace): HandlerAspect[Env, Unit]

    Creates a middleware for bearer authentication that checks the token using the given effectful function

    Creates a middleware for bearer authentication that checks the token using the given effectful function

    Definition Classes
    HandlerAspects
  20. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  21. def customAuth(verify: (Request) => Boolean, responseHeaders: Headers = Headers.empty, responseStatus: Status = Status.Unauthorized): HandlerAspect[Any, Unit]

    Creates an authentication middleware that only allows authenticated requests to be passed on to the app.

    Creates an authentication middleware that only allows authenticated requests to be passed on to the app.

    Definition Classes
    HandlerAspects
  22. final def customAuthProviding[Context](provide: (Request) => Option[Context], responseHeaders: Headers = Headers.empty, responseStatus: Status = Status.Unauthorized): HandlerAspect[Any, Context]

    Creates an authentication middleware that only allows authenticated requests to be passed on to the app, and provides a context to the request handlers.

    Creates an authentication middleware that only allows authenticated requests to be passed on to the app, and provides a context to the request handlers.

    Definition Classes
    HandlerAspects
  23. def customAuthProvidingZIO[Env, Context](provide: (Request) => ZIO[Env, Response, Option[Context]], responseHeaders: Headers = Headers.empty, responseStatus: Status = Status.Unauthorized): HandlerAspect[Env, Context]

    Creates an authentication middleware that only allows authenticated requests to be passed on to the app, and provides a context to the request handlers.

    Creates an authentication middleware that only allows authenticated requests to be passed on to the app, and provides a context to the request handlers.

    Definition Classes
    HandlerAspects
  24. def customAuthZIO[Env](verify: (Request) => ZIO[Env, Response, Boolean], responseHeaders: Headers = Headers.empty, responseStatus: Status = Status.Unauthorized): HandlerAspect[Env, Unit]

    Creates an authentication middleware that only allows authenticated requests to be passed on to the app using an effectful verification function.

    Creates an authentication middleware that only allows authenticated requests to be passed on to the app using an effectful verification function.

    Definition Classes
    HandlerAspects
  25. def debug: HandlerAspect[Any, Unit]

    Creates middleware that debugs request and response.

    Creates middleware that debugs request and response.

    Definition Classes
    HandlerAspects
  26. def dropTrailingSlash(onlyIfNoQueryParams: Boolean): HandlerAspect[Any, Unit]

    Creates middleware that drops trailing slashes from the request URL.

    Creates middleware that drops trailing slashes from the request URL.

    Definition Classes
    HandlerAspects
  27. def dropTrailingSlash: HandlerAspect[Any, Unit]

    Creates middleware that drops trailing slashes from the request URL.

    Creates middleware that drops trailing slashes from the request URL.

    Definition Classes
    HandlerAspects
  28. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  30. def fail(response: Response): HandlerAspect[Any, Unit]

    Creates middleware that aborts the request with the specified response.

    Creates middleware that aborts the request with the specified response. No downstream middleware will be invoked.

    Definition Classes
    HandlerAspects
  31. def failWith(f: (Request) => Response): HandlerAspect[Any, Unit]

    Creates middleware that aborts the request with the specified response.

    Creates middleware that aborts the request with the specified response. No downstream middleware will be invoked.

    Definition Classes
    HandlerAspects
  32. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  33. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  34. val identity: HandlerAspect[Any, Unit]

    The identity middleware, which has no effect on request or response.

    The identity middleware, which has no effect on request or response.

    Definition Classes
    HandlerAspects
  35. def ifHeaderThenElse[Env, Ctx](condition: (Headers) => Boolean)(ifTrue: HandlerAspect[Env, Ctx], ifFalse: HandlerAspect[Env, Ctx]): HandlerAspect[Env, Ctx]

    Creates conditional middleware that switches between one middleware and another based on the result of the predicate, applied to the incoming request's headers.

    Creates conditional middleware that switches between one middleware and another based on the result of the predicate, applied to the incoming request's headers.

    Definition Classes
    HandlerAspects
  36. def ifMethodThenElse[Env, Ctx](condition: (Method) => Boolean)(ifTrue: HandlerAspect[Env, Ctx], ifFalse: HandlerAspect[Env, Ctx]): HandlerAspect[Env, Ctx]

    Creates conditional middleware that switches between one middleware and another based on the result of the predicate, applied to the incoming request's method.

    Creates conditional middleware that switches between one middleware and another based on the result of the predicate, applied to the incoming request's method.

    Definition Classes
    HandlerAspects
  37. def ifRequestThenElse[Env, CtxOut](predicate: (Request) => Boolean)(ifTrue: HandlerAspect[Env, CtxOut], ifFalse: HandlerAspect[Env, CtxOut]): HandlerAspect[Env, CtxOut]

    Creates conditional middleware that switches between one middleware and another based on the result of the predicate, applied to the incoming request.

    Creates conditional middleware that switches between one middleware and another based on the result of the predicate, applied to the incoming request.

    Definition Classes
    HandlerAspects
  38. def ifRequestThenElseZIO[Env, CtxOut](predicate: (Request) => ZIO[Env, Response, Boolean])(ifTrue: HandlerAspect[Env, CtxOut], ifFalse: HandlerAspect[Env, CtxOut]): HandlerAspect[Env, CtxOut]

    Creates conditional middleware that switches between one middleware and another based on the result of the predicate, effectfully applied to the incoming request.

    Creates conditional middleware that switches between one middleware and another based on the result of the predicate, effectfully applied to the incoming request.

    Definition Classes
    HandlerAspects
  39. def intercept(fromRequestAndResponse: (Request, Response) => Response): HandlerAspect[Any, Unit]

    Creates middleware that modifies the response, potentially using the request.

    Creates middleware that modifies the response, potentially using the request.

    Definition Classes
    HandlerAspects
  40. def interceptHandler[Env, CtxOut](incoming0: Handler[Env, Response, Request, (Request, CtxOut)])(outgoing0: Handler[Env, Nothing, Response, Response]): HandlerAspect[Env, CtxOut]

    Creates middleware that will apply the specified stateless handlers to incoming and outgoing requests.

    Creates middleware that will apply the specified stateless handlers to incoming and outgoing requests. If the incoming handler fails, then the outgoing handler will not be invoked.

    Definition Classes
    HandlerAspects
  41. def interceptHandlerStateful[Env, State0, CtxOut](incoming0: Handler[Env, Response, Request, (State0, (Request, CtxOut))])(outgoing0: Handler[Env, Nothing, (State0, Response), Response]): HandlerAspect[Env, CtxOut]

    Creates middleware that will apply the specified stateful handlers to incoming and outgoing requests.

    Creates middleware that will apply the specified stateful handlers to incoming and outgoing requests. If the incoming handler fails, then the outgoing handler will not be invoked.

    Definition Classes
    HandlerAspects
  42. def interceptIncomingHandler[Env, CtxOut](handler: Handler[Env, Response, Request, (Request, CtxOut)]): HandlerAspect[Env, CtxOut]

    Creates middleware that will apply the specified handler to incoming requests.

    Creates middleware that will apply the specified handler to incoming requests.

    Definition Classes
    HandlerAspects
  43. def interceptOutgoingHandler[Env](handler: Handler[Env, Nothing, Response, Response]): HandlerAspect[Env, Unit]

    Creates middleware that will apply the specified handler to outgoing responses.

    Creates middleware that will apply the specified handler to outgoing responses.

    Definition Classes
    HandlerAspects
  44. def interceptPatch[S](fromRequest: (Request) => S): InterceptPatch[S]

    Creates a new middleware using transformation functions

    Creates a new middleware using transformation functions

    Definition Classes
    HandlerAspects
  45. def interceptPatchZIO[Env, S](fromRequest: (Request) => ZIO[Env, Response, S]): InterceptPatchZIO[Env, S]

    Creates a new middleware using effectful transformation functions

    Creates a new middleware using effectful transformation functions

    Definition Classes
    HandlerAspects
  46. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  47. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  48. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  49. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  50. def patch(f: (Response) => Patch): HandlerAspect[Any, Unit]

    Creates a middleware that produces a Patch for the Response

    Creates a middleware that produces a Patch for the Response

    Definition Classes
    HandlerAspects
  51. def patchZIO[Env](f: (Response) => ZIO[Env, Response, Patch]): HandlerAspect[Env, Unit]

    Creates a middleware that produces a Patch for the Response effectfully.

    Creates a middleware that produces a Patch for the Response effectfully.

    Definition Classes
    HandlerAspects
  52. def redirect(url: URL, isPermanent: Boolean = false): HandlerAspect[Any, Unit]

    Creates a middleware that will redirect requests to the specified URL.

    Creates a middleware that will redirect requests to the specified URL.

    Definition Classes
    HandlerAspects
  53. def redirectTrailingSlash(isPermanent: Boolean = false): HandlerAspect[Any, Unit]

    Creates middleware that will redirect requests with trailing slash to the same path without trailing slash.

    Creates middleware that will redirect requests with trailing slash to the same path without trailing slash.

    Definition Classes
    HandlerAspects
  54. final def removeHeader(name: String): HandlerAspect[Any, Unit]
    Definition Classes
    HeaderModifier
  55. final def removeHeader(headerType: HeaderType): HandlerAspect[Any, Unit]
    Definition Classes
    HeaderModifier
  56. final def removeHeaders(headers: Set[String]): HandlerAspect[Any, Unit]
    Definition Classes
    HeaderModifier
  57. def requestLogging(level: (Status) => LogLevel = (_: Status) => LogLevel.Info, loggedRequestHeaders: Set[HeaderTypeBase] = Set.empty, loggedResponseHeaders: Set[HeaderTypeBase] = Set.empty, logRequestBody: Boolean = false, logResponseBody: Boolean = false, requestCharset: Charset = StandardCharsets.UTF_8, responseCharset: Charset = StandardCharsets.UTF_8)(implicit trace: Trace): HandlerAspect[Any, Unit]

    Creates middleware that will perform request logging.

    Creates middleware that will perform request logging.

    Definition Classes
    HandlerAspects
  58. def runAfter[Env](effect: ZIO[Env, Nothing, Any])(implicit trace: Trace): HandlerAspect[Env, Unit]

    Creates middleware that will run the specified effect after every request.

    Creates middleware that will run the specified effect after every request.

    Definition Classes
    HandlerAspects
  59. def runBefore[Env](effect: ZIO[Env, Nothing, Any])(implicit trace: Trace): HandlerAspect[Env, Unit]

    Creates middleware that will run the specified effect before every request.

    Creates middleware that will run the specified effect before every request.

    Definition Classes
    HandlerAspects
  60. final def setHeaders(headers: Headers): HandlerAspect[Any, Unit]
    Definition Classes
    HeaderModifier
  61. def signCookies(secret: String): HandlerAspect[Any, Unit]

    Creates a middleware for signing cookies

    Creates a middleware for signing cookies

    Definition Classes
    HandlerAspects
  62. def status(status: Status): HandlerAspect[Any, Unit]

    Creates middleware that will update the status of the response.

    Creates middleware that will update the status of the response.

    Definition Classes
    HandlerAspects
  63. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  64. def toString(): String
    Definition Classes
    AnyRef → Any
  65. def updateHeaders(update: (Headers) => Headers)(implicit trace: Trace): HandlerAspect[Any, Unit]

    Creates middleware that will update the headers of the response.

    Creates middleware that will update the headers of the response.

    Definition Classes
    HandlerAspects → HeaderModifier
  66. def updateMethod(update: (Method) => Method): HandlerAspect[Any, Unit]

    Creates middleware that will update the method of the request.

    Creates middleware that will update the method of the request.

    Definition Classes
    HandlerAspects
  67. def updatePath(update: (Path) => Path): HandlerAspect[Any, Unit]

    Creates middleware that will update the path of the request.

    Creates middleware that will update the path of the request.

    Definition Classes
    HandlerAspects
  68. def updateRequest(update: (Request) => Request): HandlerAspect[Any, Unit]

    Creates middleware that will update the request.

    Creates middleware that will update the request.

    Definition Classes
    HandlerAspects
  69. def updateRequestZIO[Env](update: (Request) => ZIO[Env, Response, Request]): HandlerAspect[Env, Unit]

    Creates middleware that will update the request effectfully.

    Creates middleware that will update the request effectfully.

    Definition Classes
    HandlerAspects
  70. def updateResponse(update: (Response) => Response): HandlerAspect[Any, Unit]

    Creates middleware that will update the response.

    Creates middleware that will update the response.

    Definition Classes
    HandlerAspects
  71. def updateResponseZIO[Env](update: (Response) => ZIO[Env, Nothing, Response]): HandlerAspect[Env, Unit]

    Creates middleware that will update the response effectfully.

    Creates middleware that will update the response effectfully.

    Definition Classes
    HandlerAspects
  72. def updateURL(update: (URL) => URL): HandlerAspect[Any, Unit]

    Creates middleware that will update the URL of the request.

    Creates middleware that will update the URL of the request.

    Definition Classes
    HandlerAspects
  73. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  74. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  75. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  76. def when[Env](condition: (Request) => Boolean)(middleware: HandlerAspect[Env, Unit]): HandlerAspect[Env, Unit]

    Applies the middleware only if the condition function evaluates to true

    Applies the middleware only if the condition function evaluates to true

    Definition Classes
    HandlerAspects
  77. def whenHeader[Env](condition: (Headers) => Boolean)(middleware: HandlerAspect[Env, Unit]): HandlerAspect[Env, Unit]

    Applies the middleware only when the header-based condition evaluates to true.

    Applies the middleware only when the header-based condition evaluates to true.

    Definition Classes
    HandlerAspects
  78. def whenResponse(condition: (Response) => Boolean)(f: (Response) => Response): HandlerAspect[Any, Unit]

    Applies the middleware only if the condition function evaluates to true

    Applies the middleware only if the condition function evaluates to true

    Definition Classes
    HandlerAspects
  79. def whenResponseZIO[Env](condition: (Response) => ZIO[Env, Response, Boolean])(f: (Response) => ZIO[Env, Response, Response]): HandlerAspect[Env, Unit]

    Applies the middleware only if the condition function effectfully evaluates to true

    Applies the middleware only if the condition function effectfully evaluates to true

    Definition Classes
    HandlerAspects
  80. def whenZIO[Env](condition: (Request) => ZIO[Env, Response, Boolean])(middleware: HandlerAspect[Env, Unit]): HandlerAspect[Env, Unit]

    Applies the middleware only if the condition function effectfully evaluates to true

    Applies the middleware only if the condition function effectfully evaluates to true

    Definition Classes
    HandlerAspects

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from Serializable

Inherited from HandlerAspects

Inherited from AnyRef

Inherited from Any

Ungrouped