cat_2.8.2.0.1.0.source-code.credentials.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hubcat_2.8.2 Show documentation
Show all versions of hubcat_2.8.2 Show documentation
a vvip client of the github enterprises
The newest version!
package hubcat
import dispatch._
import com.ning.http.client.RequestBuilder
sealed trait Credentials {
def sign(req: RequestBuilder): RequestBuilder
}
case class OAuth2(access: String) extends Credentials {
def sign(req: RequestBuilder) =
req <:< Map("Authorization" -> "token %s".format(access))
}
case class BasicAuth(user: String, pass: String) extends Credentials {
def sign(req: RequestBuilder) =
req.as_!(user, pass)
}