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 #372 from akkie/master
Browse files Browse the repository at this point in the history
Move type for the settings to authenticator
  • Loading branch information
akkie committed Jun 9, 2015
2 parents 188f18d + 1907c5c commit c85223c
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,20 @@ 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.
*
* @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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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.
*
Expand Down

0 comments on commit c85223c

Please sign in to comment.