diff options
author | Zach Smith <zach@driver.xyz> | 2017-10-16 09:47:54 -0700 |
---|---|---|
committer | Zach Smith <zach@driver.xyz> | 2017-10-16 09:47:54 -0700 |
commit | 8a34b953fa480bfea7e80a46eb4de6b20b4bca68 (patch) | |
tree | d1463faae2068db92089301fb3140f11e9a57b5c /src/main/scala/xyz/driver/core/rest/AuthorizedServiceRequestContext.scala | |
parent | 6e9f40e4cacedfab43c92248d425866d73ea700e (diff) | |
download | driver-core-8a34b953fa480bfea7e80a46eb4de6b20b4bca68.tar.gz driver-core-8a34b953fa480bfea7e80a46eb4de6b20b4bca68.tar.bz2 driver-core-8a34b953fa480bfea7e80a46eb4de6b20b4bca68.zip |
Move AuthorizedServiceRequestContext into ServiceRequestContext.scala
Diffstat (limited to 'src/main/scala/xyz/driver/core/rest/AuthorizedServiceRequestContext.scala')
-rw-r--r-- | src/main/scala/xyz/driver/core/rest/AuthorizedServiceRequestContext.scala | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/main/scala/xyz/driver/core/rest/AuthorizedServiceRequestContext.scala b/src/main/scala/xyz/driver/core/rest/AuthorizedServiceRequestContext.scala deleted file mode 100644 index 1cf62c9..0000000 --- a/src/main/scala/xyz/driver/core/rest/AuthorizedServiceRequestContext.scala +++ /dev/null @@ -1,27 +0,0 @@ -package xyz.driver.core.rest - -import xyz.driver.core.auth.{PermissionsToken, User} -import xyz.driver.core.generators - -class AuthorizedServiceRequestContext[U <: User](override val trackingId: String = generators.nextUuid().toString, - override val contextHeaders: Map[String, String] = - Map.empty[String, String], - val authenticatedUser: U) - extends ServiceRequestContext { - - def withPermissionsToken(permissionsToken: PermissionsToken): AuthorizedServiceRequestContext[U] = - new AuthorizedServiceRequestContext[U]( - trackingId, - contextHeaders.updated(AuthProvider.PermissionsTokenHeader, permissionsToken.value), - authenticatedUser) - - override def hashCode(): Int = 31 * super.hashCode() + authenticatedUser.hashCode() - - override def equals(obj: Any): Boolean = obj match { - case ctx: AuthorizedServiceRequestContext[U] => super.equals(ctx) && ctx.authenticatedUser == authenticatedUser - case _ => false - } - - override def toString: String = - s"AuthorizedServiceRequestContext($trackingId, $contextHeaders, $authenticatedUser)" -} |