This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import play.api.libs.json._ | |
import play.api.libs.functional.syntax._ | |
import play.api.data.validation._ | |
implicit def tuple2Reads[A, B](implicit aReads: Reads[A], bReads: Reads[B]): Reads[Tuple2[A, B]] = Reads[Tuple2[A, B]] { | |
case JsArray(arr) if arr.size == 2 => for { | |
a <- aReads.reads(arr(0)) | |
b <- bReads.reads(arr(1)) | |
} yield (a, b) | |
case _ => JsError(Seq(JsPath() -> Seq(ValidationError("Expected array of two elements")))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package daos | |
import scala.concurrent.ExecutionContext | |
import scala.concurrent.Future | |
import play.api.Play.current | |
import play.modules.reactivemongo._ | |
import reactivemongo.api._ | |
import reactivemongo.api.indexes._ | |
import reactivemongo.bson._ | |
import reactivemongo.bson.handlers.BSONReader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mojolly.io | |
import org.jboss.netty.bootstrap.ClientBootstrap | |
import org.jboss.netty.channel._ | |
import socket.nio.NioClientSocketChannelFactory | |
import java.util.concurrent.Executors | |
import org.jboss.netty.handler.codec.http._ | |
import collection.JavaConversions._ | |
import websocketx._ | |
import java.net.{InetSocketAddress, URI} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package security | |
import scala.concurrent._ | |
object AccessToken { | |
/** | |
* The "b64token" syntax allows the 66 unreserved URI characters | |
* ([RFC3986]), plus a few others, so that it can hold a base64, | |
* base64url (URL and filename safe alphabet), base32, or base16 (hex) |