Skip to content

Releases: zio/zio-http

v3.0.1

17 Sep 06:57
1988b18
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v3.0.0...v3.0.1

v3.0.0

10 Sep 13:10
188ff2e
Compare
Choose a tag to compare

Finally 3.0! 🎉

Thanks for 3.0

We finally made the 3.0 release 🎉🎊 . Which is also the first real production-ready release with stable API of zio-http.
I am very happy to have reached this milestone.

Thanks to all the contributors and users of ZIO HTTP!
Especially thanks to:

  • @jdegoes for his vision, code contribution, mentoring and sponsoring of the project.
  • @vigoo for a lot of code contribution at the beginning of the 3.x series.
  • @kyri-petrou for optimizations and bug fixes.
  • @khajavi for his work on the documentation.

I hope you will enjoy working with zio-http as much as I do working with it and developing it.

Best regards,
Nabil Abdel-Hafeez aka @987Nabil 🥳

What's Changed since v3.0.0-RC10

Full Changelog: v3.0.0-RC10...v3.0.0

What's Changed since v.0.5.0

Read more

v3.0.0-RC10

30 Aug 22:24
16e2e2f
Compare
Choose a tag to compare

Breaking changes

Query Codec

QueryCodec is now Schema based. Therefore calls that would before look like HttpCodec.queryInt or HttpCodec.queryTo[Int] become HttpCodec.query[Int]. (See the docs for more details)
This also enables using a case class to extract multiple parameters.

Client

The ZClient got some rework done. Most important is, that there is now an explicit streaming and non-streaming API.
The reason is, that for streaming bodies we depended on Scope for which some users used the default application scope.
To reduce possible errors, we offer now batched requests. They do not need a scope. For the streaming ones, please use for example ZIO.scoped to set boundaries in which the streaming body is available. See the docs for more details.

Replaced Endpoint Middleware with explicit security concept

An example says more then 1000 words.

  private val basicAuthContext = HandlerAspect.customAuthProviding[AuthContext] { r =>
    {
      r.headers.get(Header.Authorization).flatMap {
        case Header.Authorization.Basic(uname, password) if Secret(uname.reverse) == password =>
          Some(AuthContext(uname))
        case _                                                                                =>
          None
      }

    }
  }
  
    val endpoint = Endpoint(Method.GET / "test").out[String](MediaType.text.`plain`).auth(AuthType.Basic)
    val routes   =
      Routes(
        endpoint.implementHandler(handler((_: Unit) => withContext((ctx: AuthContext) => ctx.value))),
      ) @@ basicAuthContext

    val response = for {
      client <- ZIO.service[Client]
      locator    = EndpointLocator.fromURL(url"http://localhost:8080")
      executor   = EndpointExecutor(client, locator, Header.Authorization.Basic("admin", "admin".reverse))
      invocation = endpoint(())
      response <- ZIO.scoped(executor(invocation))
    } yield response

This endpoint has a clear auth requirement and uses an aspect to extract information from the headers to be provided to the handler.
Note that the providing works on the level of Routes, so multiple routes can request AuthContext and you need to add the aspect only once.

The endpoint client call requires an EndpointExecutor, that can provide the authentication requirement set on the endpoint.
Either via a value like in the example or an effect.

Replaced Warning header and beautifyErrors with more explicit error config

The default way to handover errors has been the warning header so far. That had multiple problems.
Therefore we replaced it with ErrorResponseConfig. Which should be set globally in the application bootstrap via ErrorResponseConfig.configLayer and can be locally overwritten via the handler aspects ErrorResponseConfig.debug or ErrorResponseConfig.withConfig.

What's Changed

Read more

v3.0.0-RC9

26 Jun 17:42
f5c0411
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v3.0.0-RC8...v3.0.0-RC9

v3.0.0-RC8

28 May 17:07
49478a5
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.0.0-RC7...v3.0.0-RC8

v3.0.0-RC7

16 May 14:51
ade9245
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v3.0.0-RC6...v3.0.0-RC7

v3.0.0-RC6

06 Apr 08:15
2591f9f
Compare
Choose a tag to compare

What's Changed

Read more

v3.0.0-RC5

12 Mar 09:17
ec7f24a
Compare
Choose a tag to compare

What's Changed

New Contributors

Read more

v3.0.0-RC4

30 Nov 09:43
58e0594
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v3.0.0-RC3...v3.0.0-RC4

v3.0.0-RC3

23 Oct 18:08
ff8563a
Compare
Choose a tag to compare

What's Changed

Read more