Skip to content

Commit

Permalink
Minor renamings
Browse files Browse the repository at this point in the history
  • Loading branch information
chuwy committed Oct 6, 2018
1 parent eb265af commit 0a731d6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/src/main/scala/org/http4s/rho/AuthedContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ class AuthedContext[F[_]: Monad, U] extends FailureResponseOps[F] {
/* Attribute key to lookup authInfo in request attributeMap . */
final private val authKey = AttributeKey[U]

/** Turn the [[HttpService]] into an `AuthedService`
/** Turn the [[HttpRoutes§]] into an `AuthedService`
*
* @param service [[HttpService]] to convert
* @param routes [[HttpRoutes]] to convert
* @return An `AuthedService` which can be mounted by http4s servers.
*/
def toService(service: HttpRoutes[F]): AuthedService[U, F] = {
def toService(routes: HttpRoutes[F]): AuthedService[U, F] = {
type O[A] = OptionT[F, A]

Kleisli[O, AuthedRequest[F, U], Response[F]] { (a: AuthedRequest[F, U]) =>
service(a.req.withAttribute[U](authKey, a.authInfo))
Kleisli[O, AuthedRequest[F, U], Response[F]] { a: AuthedRequest[F, U] =>
routes(a.req.withAttribute[U](authKey, a.authInfo))
}
}

Expand Down

0 comments on commit 0a731d6

Please sign in to comment.