aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/scala/xyz/driver/core/rest.scala6
-rw-r--r--src/test/scala/xyz/driver/core/AuthTest.scala4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/main/scala/xyz/driver/core/rest.scala b/src/main/scala/xyz/driver/core/rest.scala
index dd43989..42ffac4 100644
--- a/src/main/scala/xyz/driver/core/rest.scala
+++ b/src/main/scala/xyz/driver/core/rest.scala
@@ -132,16 +132,16 @@ package rest {
* Specific implementation on how to extract user from request context,
* can either need to do a network call to auth server or extract everything from self-contained token
*
- * @param context set of request values which can be relevant to authenticate user
+ * @param ctx set of request values which can be relevant to authenticate user
* @return authenticated user
*/
- def authenticatedUser(context: ServiceRequestContext): OptionT[Future, U]
+ def authenticatedUser(implicit ctx: ServiceRequestContext): OptionT[Future, U]
/**
* Specific implementation can verify session expiration and single sign out
* to verify if session is still valid
*/
- def isSessionValid(user: U)(context: ServiceRequestContext): Future[Boolean] = Future.successful(true)
+ def isSessionValid(user: U)(implicit ctx: ServiceRequestContext): Future[Boolean] = Future.successful(true)
/**
* 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 c39d9da..e6025fb 100644
--- a/src/test/scala/xyz/driver/core/AuthTest.scala
+++ b/src/test/scala/xyz/driver/core/AuthTest.scala
@@ -31,8 +31,8 @@ class AuthTest extends FlatSpec with Matchers with MockitoSugar with ScalatestRo
}
val authStatusService = new AuthProvider[User](authorization, NoLogger) {
- override def authenticatedUser(context: ServiceRequestContext): OptionT[Future, User] = OptionT.optionT[Future] {
- if (context.contextHeaders.keySet.contains(AuthProvider.AuthenticationTokenHeader)) {
+ override def authenticatedUser(implicit ctx: ServiceRequestContext): OptionT[Future, User] = OptionT.optionT[Future] {
+ if (ctx.contextHeaders.keySet.contains(AuthProvider.AuthenticationTokenHeader)) {
Future.successful(Some(BasicUser(Id[User]("1"), Set(TestRole))))
} else {
Future.successful(Option.empty[User])