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 #375 from akkie/master
Browse files Browse the repository at this point in the history
Add @Inject annotation where it makes sense
  • Loading branch information
akkie committed Jun 11, 2015
2 parents 54508fa + 110d9fc commit 78b325f
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package com.mohiva.play.silhouette.impl.daos

import javax.inject.Inject

import com.mohiva.play.silhouette.api.StorableAuthenticator
import com.mohiva.play.silhouette.api.util.CacheLayer

Expand All @@ -28,7 +30,8 @@ import scala.reflect.ClassTag
* @param cacheLayer The cache layer implementation.
* @tparam T The type of the authenticator to store.
*/
class CacheAuthenticatorDAO[T <: StorableAuthenticator: ClassTag](cacheLayer: CacheLayer) extends AuthenticatorDAO[T] {
class CacheAuthenticatorDAO[T <: StorableAuthenticator: ClassTag] @Inject() (cacheLayer: CacheLayer)
extends AuthenticatorDAO[T] {

/**
* Finds the authenticator for the given ID.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package com.mohiva.play.silhouette.impl.providers

import javax.inject.Inject

import com.mohiva.play.silhouette.api.exceptions.ConfigurationException
import com.mohiva.play.silhouette.api.repositories.AuthInfoRepository
import com.mohiva.play.silhouette.api.util._
Expand All @@ -40,7 +42,7 @@ import scala.concurrent.{ ExecutionContext, Future }
* @param passwordHasherList List of password hasher supported by the application.
* @param executionContext The execution context to handle the asynchronous operations.
*/
class BasicAuthProvider(
class BasicAuthProvider @Inject() (
authInfoRepository: AuthInfoRepository,
passwordHasher: PasswordHasher,
passwordHasherList: Seq[PasswordHasher])(implicit val executionContext: ExecutionContext)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
*/
package com.mohiva.play.silhouette.impl.providers

import javax.inject.Inject

import com.mohiva.play.silhouette.api._
import com.mohiva.play.silhouette.api.exceptions.ConfigurationException
import com.mohiva.play.silhouette.api.repositories.AuthInfoRepository
Expand All @@ -42,7 +44,7 @@ import scala.concurrent.{ ExecutionContext, Future }
* @param passwordHasherList List of password hasher supported by the application.
* @param executionContext The execution context to handle the asynchronous operations.
*/
class CredentialsProvider(
class CredentialsProvider @Inject() (
authInfoRepository: AuthInfoRepository,
passwordHasher: PasswordHasher,
passwordHasherList: Seq[PasswordHasher])(implicit val executionContext: ExecutionContext)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package com.mohiva.play.silhouette.impl.providers.oauth1.secrets

import javax.inject.Inject

import com.mohiva.play.silhouette.api.util.{ Clock, ExtractableRequest }
import com.mohiva.play.silhouette.impl.exceptions.OAuth1TokenSecretException
import com.mohiva.play.silhouette.impl.providers.oauth1.secrets.CookieSecretProvider._
Expand Down Expand Up @@ -96,7 +98,7 @@ case class CookieSecret(value: String, expirationDate: DateTime) extends OAuth1T
* @param settings The secret settings.
* @param clock The clock implementation.
*/
class CookieSecretProvider(
class CookieSecretProvider @Inject() (
settings: CookieSecretSettings,
clock: Clock) extends OAuth1TokenSecretProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package com.mohiva.play.silhouette.impl.providers.oauth2.state

import javax.inject.Inject

import com.mohiva.play.silhouette._
import com.mohiva.play.silhouette.api.util.{ ExtractableRequest, Base64, Clock, IDGenerator }
import com.mohiva.play.silhouette.impl.exceptions.OAuth2StateException
Expand Down Expand Up @@ -101,7 +103,7 @@ case class CookieState(expirationDate: DateTime, value: String) extends OAuth2St
* @param idGenerator The ID generator used to create the state value.
* @param clock The clock implementation.
*/
class CookieStateProvider(
class CookieStateProvider @Inject() (
settings: CookieStateSettings,
idGenerator: IDGenerator,
clock: Clock) extends OAuth2StateProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package com.mohiva.play.silhouette.impl.services

import java.security.MessageDigest
import javax.inject.Inject

import com.mohiva.play.silhouette.api.Logger
import com.mohiva.play.silhouette.api.services.AvatarService
Expand All @@ -33,7 +34,8 @@ import scala.concurrent.Future
*
* @param httpLayer The HTTP layer implementation.
*/
class GravatarService(httpLayer: HTTPLayer) extends AvatarService with Logger with ExecutionContextProvider {
class GravatarService @Inject() (httpLayer: HTTPLayer) extends AvatarService
with Logger with ExecutionContextProvider {

/**
* The execution context to handle the asynchronous operations.
Expand Down

0 comments on commit 78b325f

Please sign in to comment.