Skip to content
This repository has been archived by the owner on Sep 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #279 from rfranco/feature/play-2.4
Browse files Browse the repository at this point in the history
Update Play 2.4.0
  • Loading branch information
akkie committed Apr 27, 2015
2 parents 2281420 + a96cb5b commit 33662e1
Show file tree
Hide file tree
Showing 46 changed files with 549 additions and 522 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ scala:
- 2.10.5
- 2.11.6
jdk:
- oraclejdk7
- oraclejdk8
env:
global:
secure: V6KuFtIP8++7MVr4uXe+VoyUGtjpw9fy/WjdTM5F7cN0w0Nns6JQpbbo4MwWBPIrcx2/fiPWH0hY53HKdhhi27tWSq0lGJO55TU8KtNyVi/UmBhyOp2DYKulXkYmcrOeCv0g5PXwXmrXxPW6SJZ6PR+cG8UhRQAF627jEdKsxBY=
Expand Down
2 changes: 1 addition & 1 deletion project/BuildSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ object BasicSettings extends AutoPlugin {

override def projectSettings = Seq(
organization := "com.mohiva",
version := "2.1-SNAPSHOT",
version := "3.0.0-SNAPSHOT",
resolvers ++= Dependencies.resolvers,
scalaVersion := Dependencies.Versions.scalaVersion,
crossScalaVersions := Dependencies.Versions.crossScala,
Expand Down
18 changes: 13 additions & 5 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ object Dependencies {
}

val resolvers = Seq(
"Atlassian Releases" at "https://maven.atlassian.com/public/"
"Atlassian Releases" at "https://maven.atlassian.com/public/",
"scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"
)

object Library {
Expand All @@ -33,13 +34,20 @@ object Dependencies {
val ws = "com.typesafe.play" %% "play-ws" % version
val cache = "com.typesafe.play" %% "play-cache" % version
val test = "com.typesafe.play" %% "play-test" % version
val specs2 = "com.typesafe.play" %% "play-specs2" % version
}

object Specs2 {
private val version = "3.4"
val matcherExtra = "org.specs2" %% "specs2-matcher-extra" % version
val mock = "org.specs2" %% "specs2-mock" % version
}

val jbcrypt = "org.mindrot" % "jbcrypt" % "0.3m"
val jwtCore = "com.atlassian.jwt" % "jwt-core" % "1.2.3"
val jwtApi = "com.atlassian.jwt" % "jwt-api" % "1.2.3"
val mockito = "org.mockito" % "mockito-core" % "1.9.5"
val jwtCore = "com.atlassian.jwt" % "jwt-core" % "1.2.4"
val jwtApi = "com.atlassian.jwt" % "jwt-api" % "1.2.4"
val mockito = "org.mockito" % "mockito-core" % "1.10.19"
val scalaGuice = "net.codingwell" %% "scala-guice" % "4.0.0-beta5"
val akkaTestkit = "com.typesafe.akka" %% "akka-testkit" % "2.3.3"
val akkaTestkit = "com.typesafe.akka" %% "akka-testkit" % "2.3.10"
}
}
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resolvers += "Sonatype snapshots" at "https://oss.sonatype.org/content/repositor

resolvers += "jgit-repo" at "http://download.eclipse.org/jgit/maven"

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.8")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.0-RC1")

addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.0.1")

Expand Down
6 changes: 3 additions & 3 deletions scripts/sbt-runner
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# Author: Paul Phillips <paulp@improving.org>

# todo - make this dynamic
declare -r sbt_release_version="0.13.7"
declare -r sbt_unreleased_version="0.13.8-M6"
declare -r sbt_release_version="0.13.8"
declare -r sbt_unreleased_version="0.13.8"
declare -r buildProps="project/build.properties"

declare sbt_jar sbt_dir sbt_create sbt_version
Expand Down Expand Up @@ -186,7 +186,7 @@ declare sbt_launch_dir="$HOME/.sbt/launchers"
[[ -w "$sbt_launch_dir" ]] || sbt_launch_dir="$(mktemp -d -t sbt_extras_launchers.XXXXXX)"

java_version () {
local version=$("$java_cmd" -version 2>&1 | grep -e 'java version' | awk '{ print $3 }' | tr -d \")
local version=$("$java_cmd" -version 2>&1 | grep -E -e '(java|openjdk) version' | awk '{ print $3 }' | tr -d \")
vlog "Detected Java version: $version"
echo "${version:2:1}"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ package object test {
body = f.body,
method = rh.method,
version = rh.version,
headers = FakeHeaders(rh.headers.toMap.toSeq),
headers = FakeHeaders(rh.headers.headers),
remoteAddress = rh.remoteAddress,
secure = rh.secure
)
Expand Down
2 changes: 2 additions & 0 deletions silhouette-testkit/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import Dependencies._

libraryDependencies ++= Seq(
Library.Play.test,
Library.Play.specs2 % Test,
Library.Specs2.matcherExtra % Test,
Library.mockito % Test,
Library.akkaTestkit % Test
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,6 @@ object AuthenticatorResult {
*/
trait AuthenticatorService[T <: Authenticator] {

/**
* Used to add additional headers to the existing headers.
*
* @param existing The existing headers.
* @param additional The additional headers to add.
*/
case class AdditionalHeaders(existing: Headers, additional: Seq[(String, Seq[String])]) extends Headers {
override protected val data: Seq[(String, Seq[String])] = (existing.toMap ++ additional).toSeq
}

/**
* Creates a new authenticator for the specified login info.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.mohiva.play.silhouette.api.util

import play.api.i18n.Messages
import play.api.i18n.Messages.Implicits._
import play.api.libs.json.Json
import play.api.mvc._
import play.api.Play.current

import scala.concurrent._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ trait HTTPLayer {
*
* @param url the URL to request
*/
def url(url: String): WSRequestHolder
def url(url: String): WSRequest
}

/**
Expand All @@ -44,5 +44,5 @@ class PlayHTTPLayer extends HTTPLayer {
*
* @param url the URL to request
*/
def url(url: String): WSRequestHolder = WS.url(url)
def url(url: String): WSRequest = WS.url(url)
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ class BearerTokenAuthenticatorService(
* @return The manipulated request header.
*/
def embed(token: String, request: RequestHeader) = {
request.copy(headers = AdditionalHeaders(request.headers, Seq(settings.headerName -> Seq(token))))
val additional = Seq(settings.headerName -> token)
request.copy(headers = request.headers.replace(additional: _*))
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ class CookieAuthenticatorService(
*/
def embed(cookie: Cookie, request: RequestHeader) = {
val cookies = Cookies.merge(request.headers.get(HeaderNames.COOKIE).getOrElse(""), Seq(cookie))
val additional = Seq(HeaderNames.COOKIE -> Seq(cookies))
request.copy(headers = AdditionalHeaders(request.headers, additional))
val additional = Seq(HeaderNames.COOKIE -> cookies)
request.copy(headers = request.headers.replace(additional: _*))
}

/**
Expand Down
Loading

0 comments on commit 33662e1

Please sign in to comment.