Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addAuthentication uses SttpRequest but zio env is optional #703

Open
gurghet opened this issue Jan 26, 2022 · 0 comments
Open

addAuthentication uses SttpRequest but zio env is optional #703

gurghet opened this issue Jan 26, 2022 · 0 comments

Comments

@gurghet
Copy link
Contributor

gurghet commented Jan 26, 2022

override def addAuthentication(request: SttpRequest, bearerToken: Option[String]): SttpRequest = request.auth.bearer(bearerToken.getOrElse(""))

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant