diff --git a/silhouette/app/com/mohiva/play/silhouette/api/Authenticator.scala b/silhouette/app/com/mohiva/play/silhouette/api/Authenticator.scala index fbbb6bccf..bb61a3bfa 100644 --- a/silhouette/app/com/mohiva/play/silhouette/api/Authenticator.scala +++ b/silhouette/app/com/mohiva/play/silhouette/api/Authenticator.scala @@ -29,6 +29,11 @@ trait Authenticator { */ type Value + /** + * The type of the settings an authenticator can handle. + */ + type Settings + /** * Gets the linked login info for an identity. * diff --git a/silhouette/app/com/mohiva/play/silhouette/api/services/AuthenticatorService.scala b/silhouette/app/com/mohiva/play/silhouette/api/services/AuthenticatorService.scala index 426050e71..569c420cc 100644 --- a/silhouette/app/com/mohiva/play/silhouette/api/services/AuthenticatorService.scala +++ b/silhouette/app/com/mohiva/play/silhouette/api/services/AuthenticatorService.scala @@ -88,17 +88,12 @@ trait AuthenticatorService[T <: Authenticator] extends ExecutionContextProvider */ type Self <: AuthenticatorService[T] - /** - * The type of the settings. - */ - type Settings - /** * Gets the authenticator settings. * * @return The authenticator settings. */ - def settings: Settings + def settings: T#Settings /** * Gets an authenticator service initialized with a new settings object. @@ -106,7 +101,7 @@ trait AuthenticatorService[T <: Authenticator] extends ExecutionContextProvider * @param f A function which gets the settings passed and returns different settings. * @return An instance of the authenticator service initialized with new settings. */ - def withSettings(f: Settings => Settings): Self + def withSettings(f: T#Settings => T#Settings): Self /** * Creates a new authenticator for the specified login info. diff --git a/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/BearerTokenAuthenticator.scala b/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/BearerTokenAuthenticator.scala index 554059506..ccb5f3845 100644 --- a/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/BearerTokenAuthenticator.scala +++ b/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/BearerTokenAuthenticator.scala @@ -59,6 +59,11 @@ case class BearerTokenAuthenticator( */ override type Value = String + /** + * The type of the settings an authenticator can handle. + */ + override type Settings = BearerTokenAuthenticatorSettings + /** * Checks if the authenticator isn't expired and isn't timed out. * @@ -105,11 +110,6 @@ class BearerTokenAuthenticatorService( */ override type Self = BearerTokenAuthenticatorService - /** - * The type of the settings. - */ - override type Settings = BearerTokenAuthenticatorSettings - /** * Gets an authenticator service initialized with a new settings object. * diff --git a/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/CookieAuthenticator.scala b/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/CookieAuthenticator.scala index e5c2ba7ac..c124f0180 100644 --- a/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/CookieAuthenticator.scala +++ b/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/CookieAuthenticator.scala @@ -72,6 +72,11 @@ case class CookieAuthenticator( */ override type Value = Cookie + /** + * The type of the settings an authenticator can handle. + */ + override type Settings = CookieAuthenticatorSettings + /** * Checks if the authenticator isn't expired and isn't timed out. * @@ -176,11 +181,6 @@ class CookieAuthenticatorService( */ override type Self = CookieAuthenticatorService - /** - * The type of the settings. - */ - override type Settings = CookieAuthenticatorSettings - /** * Gets an authenticator service initialized with a new settings object. * diff --git a/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/DummyAuthenticator.scala b/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/DummyAuthenticator.scala index af65c0986..e3d8f086f 100644 --- a/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/DummyAuthenticator.scala +++ b/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/DummyAuthenticator.scala @@ -35,6 +35,11 @@ case class DummyAuthenticator(loginInfo: LoginInfo) extends Authenticator { */ override type Value = Unit + /** + * The type of the settings an authenticator can handle. + */ + override type Settings = Unit + /** * Authenticator is always valid. * @@ -56,11 +61,6 @@ class DummyAuthenticatorService(implicit val executionContext: ExecutionContext) */ override type Self = DummyAuthenticatorService - /** - * The type of the settings. - */ - override type Settings = Unit - /** * Gets the authenticator settings. * diff --git a/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/JWTAuthenticator.scala b/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/JWTAuthenticator.scala index ea8529324..b7bcdb3a5 100644 --- a/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/JWTAuthenticator.scala +++ b/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/JWTAuthenticator.scala @@ -73,6 +73,11 @@ case class JWTAuthenticator( */ override type Value = String + /** + * The type of the settings an authenticator can handle. + */ + override type Settings = JWTAuthenticatorSettings + /** * Checks if the authenticator isn't expired and isn't timed out. * @@ -253,11 +258,6 @@ class JWTAuthenticatorService( */ override type Self = JWTAuthenticatorService - /** - * The type of the settings. - */ - override type Settings = JWTAuthenticatorSettings - /** * Gets an authenticator service initialized with a new settings object. * diff --git a/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/SessionAuthenticator.scala b/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/SessionAuthenticator.scala index 0c10a6cae..1741f8915 100644 --- a/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/SessionAuthenticator.scala +++ b/silhouette/app/com/mohiva/play/silhouette/impl/authenticators/SessionAuthenticator.scala @@ -58,6 +58,11 @@ case class SessionAuthenticator( */ override type Value = Session + /** + * The type of the settings an authenticator can handle. + */ + override type Settings = SessionAuthenticatorSettings + /** * Checks if the authenticator isn't expired and isn't timed out. * @@ -158,11 +163,6 @@ class SessionAuthenticatorService( */ override type Self = SessionAuthenticatorService - /** - * The type of the settings. - */ - override type Settings = SessionAuthenticatorSettings - /** * Gets an authenticator service initialized with a new settings object. *