izumi.idealingua.runtime.rpc.http4s.IRTAuthenticator.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of idealingua-v1-runtime-rpc-http4s_2.13 Show documentation
Show all versions of idealingua-v1-runtime-rpc-http4s_2.13 Show documentation
idealingua-v1-runtime-rpc-http4s
The newest version!
package izumi.idealingua.runtime.rpc.http4s
import io.circe.Json
import izumi.functional.bio.{Applicative2, F}
import izumi.idealingua.runtime.rpc.IRTMethodId
import org.http4s.Headers
import java.net.InetAddress
abstract class IRTAuthenticator[F[_, _], AuthCtx, RequestCtx] {
def authenticate(authContext: AuthCtx, body: Option[Json], methodId: Option[IRTMethodId]): F[Nothing, Option[RequestCtx]]
}
object IRTAuthenticator {
def unit[F[+_, +_]: Applicative2, C]: IRTAuthenticator[F, C, Unit] = new IRTAuthenticator[F, C, Unit] {
override def authenticate(authContext: C, body: Option[Json], methodId: Option[IRTMethodId]): F[Nothing, Option[Unit]] = F.pure(Some(()))
}
final case class AuthContext(headers: Headers, networkAddress: Option[InetAddress])
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy