diff options
author | vlad <vlad@driver.xyz> | 2017-03-25 14:03:32 -0700 |
---|---|---|
committer | vlad <vlad@driver.xyz> | 2017-03-25 14:03:32 -0700 |
commit | e74e0229b85a2cb85b31c1f9389dada65ec08b7d (patch) | |
tree | 366f136662d3e33a58017d740667f55ede59b4ae | |
parent | f2d98d0d3f473c2a3ae51b11ce0386114bf87a0d (diff) | |
download | driver-core-e74e0229b85a2cb85b31c1f9389dada65ec08b7d.tar.gz driver-core-e74e0229b85a2cb85b31c1f9389dada65ec08b7d.tar.bz2 driver-core-e74e0229b85a2cb85b31c1f9389dada65ec08b7d.zip |
PDW-238 Session validity verification support for `AuthProvider`, abstract `isSessionValid`
-rw-r--r-- | src/main/scala/xyz/driver/core/rest.scala | 2 | ||||
-rw-r--r-- | src/test/scala/xyz/driver/core/AuthTest.scala | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/main/scala/xyz/driver/core/rest.scala b/src/main/scala/xyz/driver/core/rest.scala index 42ffac4..d3a06d2 100644 --- a/src/main/scala/xyz/driver/core/rest.scala +++ b/src/main/scala/xyz/driver/core/rest.scala @@ -141,7 +141,7 @@ package rest { * Specific implementation can verify session expiration and single sign out * to verify if session is still valid */ - def isSessionValid(user: U)(implicit ctx: ServiceRequestContext): Future[Boolean] = Future.successful(true) + def isSessionValid(user: U)(implicit ctx: ServiceRequestContext): Future[Boolean] /** * Verifies if request is authenticated and authorized to have `permissions` diff --git a/src/test/scala/xyz/driver/core/AuthTest.scala b/src/test/scala/xyz/driver/core/AuthTest.scala index 76c2933..d1a37a2 100644 --- a/src/test/scala/xyz/driver/core/AuthTest.scala +++ b/src/test/scala/xyz/driver/core/AuthTest.scala @@ -31,6 +31,10 @@ class AuthTest extends FlatSpec with Matchers with MockitoSugar with ScalatestRo } val authStatusService = new AuthProvider[User](authorization, NoLogger) { + + override def isSessionValid(user: User)(implicit ctx: ServiceRequestContext): Future[Boolean] = + Future.successful(true) + override def authenticatedUser(implicit ctx: ServiceRequestContext): OptionT[Future, User] = OptionT.optionT[Future] { if (ctx.contextHeaders.keySet.contains(AuthProvider.AuthenticationTokenHeader)) { |