Skip to content

Instantly share code, notes, and snippets.

@trane
Created October 13, 2015 17:02
Show Gist options
  • Select an option

  • Save trane/c041908c1e25134bb1c9 to your computer and use it in GitHub Desktop.

Select an option

Save trane/c041908c1e25134bb1c9 to your computer and use it in GitHub Desktop.
// ServiceRouter1[ServiceIdentifier] => ...
// Map[ServiceIdentifier, Httpx.Client]
// (ServiceRouter / SessionIdRouter / IdentityRouter / AccessRouter) {(service, session, identity, access) => ...}
//
// ServiceRouter2[UpstreamService]
// case class UpstreamService(id: ServiceIdentifier) {
// val service = Httpx.newClient()
// val endpoint = authFilterChain andThen service
// }
// authFilterChain = SessionIdFilter andThen IdentityFilter andThen ...
// object ServiceBinder {
// def apply(id: ServiceIdentifier): Service[Request, Response] =
// forall {id : ServiceIdentifers} one-to-one {client: UpstreamService}
// }
//
val routes =
get("sso") { ... } :+:
ServiceRouter1 /> authFilterChain andThen ServiceBinder(_)
ServiceRouter2 /> _.endpoint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment