Skip to content

Instantly share code, notes, and snippets.

@edwelker
Created February 10, 2017 20:38
Show Gist options
  • Save edwelker/b535bb3b6e443b2b35e31567f3a06818 to your computer and use it in GitHub Desktop.
Save edwelker/b535bb3b6e443b2b35e31567f3a06818 to your computer and use it in GitHub Desktop.
Eddie is awesome, with his stink.
val credentials = for {
// Create credentials
username <- Utils.username
password <- Utils.password
} yield BasicAuth.client(username, password)
//TODO: connection pooling https://twitter.github.io/finagle/guide/Clients.html#pooling
val client = for {
host_port <- Utils.host_port
} yield Http.client.withTlsWithoutValidation.newService(host_port)
val credential_client = for {
creds: Client <- credentials
cli: Service[Request, Response] <- client
} yield creds.andThen(cli)(request)
credential_client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment