Class

com.jaroop.play.sentry

TransparentIdContainer

Related Doc: package sentry

Permalink

class TransparentIdContainer[A] extends IdContainer[A]

Provides a stateless implementation of IdContainer, where the session is meant to be stored in cookies only. This means that the server has no way of invalidating an individual user session, and the only way to do so would be to change the secret key of the application to invalidate all signed tokens.

The AuthenticityToken in this case is just the user ID, so it is required that the Id type has an available implementation of the ToString and FromString type classes. scala.Int, scala.Long, and java.lang.String are supported by default to cover most use-cases.

A

The type of user ID that will be stored in the session.

Linear Supertypes
IdContainer[A], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TransparentIdContainer
  2. IdContainer
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TransparentIdContainer()(implicit arg0: ToString[A], arg1: FromString[A])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. def get(token: AuthenticityToken)(implicit ec: ExecutionContext): Future[Option[A]]

    Permalink

    Finds the user ID that is associated with an AuthenticityToken.

    Finds the user ID that is associated with an AuthenticityToken. If Some[Id] is returned, that is sufficient to show that a user's session is valid.

    token

    The AuthenticityToken to verify.

    returns

    The user ID associated with the AuthenticityToken within the IdContainer, if there is one. Otherwise, None.

    Definition Classes
    TransparentIdContainerIdContainer
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. def prolongTimeout(token: AuthenticityToken, timeout: Duration)(implicit ec: ExecutionContext): Future[Unit]

    Permalink

    Does nothing, as the session is not stored server-side.

    Does nothing, as the session is not stored server-side.

    token

    The AuthenticityToken of the session to prolong.

    timeout

    The new duration of the session. e.g. if there is 30 minutes left in a session, and a timeout of one hour is passed, the session will expire in one hour.

    returns

    A successful Future if the session was prolonged, or a failed Future if the session isn't valid, or some other error occurred.

    Definition Classes
    TransparentIdContainerIdContainer
  17. def remove(token: AuthenticityToken)(implicit ec: ExecutionContext): Future[Unit]

    Permalink

    Does nothing, as the session is not stored server-side.

    Does nothing, as the session is not stored server-side.

    token

    The AuthenticityToken that is paired with the session to be destroyed.

    returns

    A successful Future if the session was destroyed, or a failed Future if an error occurred.

    Definition Classes
    TransparentIdContainerIdContainer
  18. def startNewSession(userId: A, timeout: Duration)(implicit ec: ExecutionContext): Future[AuthenticityToken]

    Permalink

    Opens a new session for a user, and generates an AuthenticityToken that is paired with that user's ID.

    Opens a new session for a user, and generates an AuthenticityToken that is paired with that user's ID.

    userId

    The ID of the session the session will be created for.

    timeout

    How long the session will be valid before expiring in a stateful IdContainer.

    returns

    An AuthenticityToken to be given to the user to later verify their session is valid.

    Definition Classes
    TransparentIdContainerIdContainer
  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  20. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from IdContainer[A]

Inherited from AnyRef

Inherited from Any

Ungrouped