tamer icon indicating copy to clipboard operation
tamer copied to clipboard

`addAuthentication` uses SttpRequest but zio env is optional

Open gurghet opened this issue 2 years ago • 0 comments

https://github.com/laserdisc-io/tamer/blob/8c8c40ff1f17b3735d44349797257600bdf31f15/example/src/main/scala/tamer/rest/RESTCustomAuth.scala#L21 This can result in code like this for custom auth:

val authentication: Authentication[Any] = new Authentication[Any] {
    override def addAuthentication(request: SttpRequest, supplementalSecret: Option[String]): SttpRequest =
    // ...
}

A suggestion is to make the type parameter -R <: SttpClient or to make authentication independent from any particular client.

gurghet avatar Jan 26 '22 14:01 gurghet