ca.shiftfocus.krispii.core.services

AuthServiceDefault

Related Doc: package services

class AuthServiceDefault extends AuthService

Linear Supertypes
AuthService, Service[Fail], Lifting[Fail], Serialized, FutureMonad, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AuthServiceDefault
  2. AuthService
  3. Service
  4. Lifting
  5. Serialized
  6. FutureMonad
  7. AnyRef
  8. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AuthServiceDefault(db: DB, scalaCache: ScalaCache, userRepository: UserRepository, roleRepository: RoleRepository, sessionRepository: SessionRepository)

Value Members

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

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

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

    Definition Classes
    AnyRef → Any
  4. def addRole(userId: UUID, roleName: String): Future[\/[Fail, User]]

    Add a role to a user.

    Add a role to a user.

    userId

    the unique id of the user

    roleName

    the name of the role

    returns

    a boolean indicator if the role was added

    Definition Classes
    AuthServiceDefaultAuthService
  5. def addRoles(userId: UUID, roleNames: IndexedSeq[String]): Future[\/[Fail, User]]

    Add a role to a user.

    Add a role to a user.

    userId

    the unique id of the user

    roleNames

    the name of the role

    returns

    a boolean indicator if the role was added

    Definition Classes
    AuthServiceDefaultAuthService
  6. def addUsers(roleId: UUID, userIds: IndexedSeq[UUID]): Future[\/[Fail, Unit]]

    Add a role to a given list of users.

    Add a role to a given list of users.

    roleId

    the UUID of the Role to be added

    userIds

    an IndexedSeq of UUID listing the users to gain the role

    returns

    a boolean indicator if the role was added

    Definition Classes
    AuthServiceDefaultAuthService
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def authenticate(identifier: String, password: String): Future[\/[Fail, User]]

    Authenticates a given identifier/password combination.

    Authenticates a given identifier/password combination.

    identifier
    password
    returns

    Some(user) if valid, otherwise None.

    Definition Classes
    AuthServiceDefaultAuthService
  9. implicit def cache: ScalaCache

  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. implicit def conn: Connection

  12. def create(username: String, email: String, password: String, givenname: String, surname: String, id: UUID = UUID.random): Future[\/[Fail, User]]

    Create a new user.

    Create a new user. Throws exceptions if the e-mail and username aren't unique.

    username

    A unique identifier for this user.

    email

    The user's unique e-mail address.

    password

    The user's password.

    givenname

    The user's first name.

    surname

    The user's family name.

    id

    The ID to allocate for this user, if left out, it will be random.

    returns

    the created user

    Definition Classes
    AuthServiceDefaultAuthService
  13. def createRole(name: String, id: UUID = UUID.random): Future[\/[Fail, Role]]

    Create a new role.

    Create a new role.

    name

    the name of the Role to create

    returns

    the newly created Role

    Definition Classes
    AuthServiceDefaultAuthService
  14. def createSession(userId: UUID, ipAddress: String, userAgent: String): Future[\/[Fail, Session]]

    Create a new session.

    Create a new session.

    userId
    ipAddress
    userAgent
    returns

    Definition Classes
    AuthServiceDefaultAuthService
  15. val db: DB

    Database connection (pool).

    Database connection (pool). Services will take connections from this pool when making repository calls.

    Definition Classes
    AuthServiceDefaultService
  16. def delete(id: UUID, version: Long): Future[\/[Fail, User]]

    Deletes a user.

    Deletes a user.

    TODO: delete the user's work

    id

    the unique id of the user to be updated

    version

    the latest version of the user for O.O.L.

    returns

    a future disjunction containing the deleted user, or a failure

    Definition Classes
    AuthServiceDefaultAuthService
  17. def deleteRole(id: UUID, version: Long): Future[\/[Fail, Role]]

    Delete a role.

    Delete a role.

    id

    the unique id of the role

    version

    the version of the role for optimistic offline lock

    returns

    the deleted role

    Definition Classes
    AuthServiceDefaultAuthService
  18. def deleteSession(sessionId: UUID): Future[\/[Fail, Session]]

    Delete a session.

    Delete a session.

    sessionId
    returns

    Definition Classes
    AuthServiceDefaultAuthService
  19. implicit def eitherRunner[B](eithert: EitherT[Future, Fail, B]): Future[\/[Fail, B]]

    Definition Classes
    Lifting
  20. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  23. def find(identifier: String): Future[\/[Fail, User]]

    Find a user by their unique identifier.

    Find a user by their unique identifier.

    identifier

    The unique e-mail or username identifying this user.

    returns

    a future disjunction containing the user and their information, or a failure

    Definition Classes
    AuthServiceDefaultAuthService
  24. def find(id: UUID): Future[\/[Fail, User]]

    Find a user by their UUID.

    Find a user by their UUID.

    id

    the unique id for the user

    returns

    a future disjunction containing the user and their information, or a failure

    Definition Classes
    AuthServiceDefaultAuthService
  25. def findRole(name: String): Future[\/[Fail, Role]]

    Find a specific role by name

    Find a specific role by name

    name

    the name of the Role to find

    returns

    an optional Role

    Definition Classes
    AuthServiceDefaultAuthService
  26. def findRole(id: UUID): Future[\/[Fail, Role]]

    Find a specific role by its unique id.

    Find a specific role by its unique id.

    id

    the UUID of the Role to find

    returns

    an optional Role

    Definition Classes
    AuthServiceDefaultAuthService
  27. def findSession(sessionId: UUID): Future[\/[Fail, Session]]

    Find one session by its ID.

    Find one session by its ID.

    sessionId
    returns

    Definition Classes
    AuthServiceDefaultAuthService
  28. implicit val futureMonad: Monad[Future]

    Definition Classes
    FutureMonad
  29. final def getClass(): Class[_]

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

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

    Definition Classes
    Any
  32. def lift[B]: (Future[\/[Fail, B]]) ⇒ EitherT[Future, Fail, B]

    Definition Classes
    Lifting
  33. def liftSeq[B](fIntermediate: Future[IndexedSeq[\/[Fail, B]]])(implicit ec: ExecutionContext): EitherT[Future, Fail, IndexedSeq[B]]

    Definition Classes
    Lifting
  34. def liftSeq[B](interList: IndexedSeq[Future[\/[Fail, B]]])(implicit ec: ExecutionContext): EitherT[Future, Fail, IndexedSeq[B]]

    Definition Classes
    Lifting
  35. def list(roles: IndexedSeq[String]): Future[\/[Fail, IndexedSeq[User]]]

    List users with filter for roles and courses.

    List users with filter for roles and courses.

    roles

    an optional list of roles to filter by

    returns

    an IndexedSeq of user

    Definition Classes
    AuthServiceDefaultAuthService
  36. def list: Future[\/[Fail, IndexedSeq[User]]]

    List all users.

    List all users.

    returns

    an IndexedSeq of user

    Definition Classes
    AuthServiceDefaultAuthService
  37. def listRoles(userId: UUID): Future[\/[Fail, IndexedSeq[Role]]]

    List all roles for one user.

    List all roles for one user.

    userId

    The user whose roles should be listed.

    returns

    an array of this user's Roles

    Definition Classes
    AuthServiceDefaultAuthService
  38. def listRoles: Future[\/[Fail, IndexedSeq[Role]]]

    List all roles.

    List all roles.

    returns

    an array of Roles

    Definition Classes
    AuthServiceDefaultAuthService
  39. def listSessions(userId: UUID): Future[\/[Fail, IndexedSeq[Session]]]

    List the active sessions for one user.

    List the active sessions for one user.

    userId
    returns

    Definition Classes
    AuthServiceDefaultAuthService
  40. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  41. final def notify(): Unit

    Definition Classes
    AnyRef
  42. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  43. def predicate(fCondition: Future[Boolean])(fail: Fail)(implicit ec: ExecutionContext): EitherT[Future, Fail, Unit]

    Definition Classes
    Lifting
  44. def predicate(condition: Boolean)(fail: Fail): EitherT[Future, Fail, Unit]

    Definition Classes
    Lifting
  45. def removeRole(userId: UUID, roleName: String): Future[\/[Fail, User]]

    Remove a role from a user.

    Remove a role from a user.

    userId

    the unique id of the user

    roleName

    the name of the role

    returns

    a boolean indicator if the role was removed

    Definition Classes
    AuthServiceDefaultAuthService
  46. def removeUsers(roleId: UUID, userIds: IndexedSeq[UUID]): Future[\/[Fail, Unit]]

    Remove a role from a given list of users.

    Remove a role from a given list of users.

    roleId

    the UUID of the Role to be removed

    userIds

    an IndexedSeq of UUID listing the users to lose the role

    returns

    a boolean indicator if the role was removed

    Definition Classes
    AuthServiceDefaultAuthService
  47. val roleRepository: RoleRepository

    Definition Classes
    AuthServiceDefaultAuthService
  48. val scalaCache: ScalaCache

    Definition Classes
    AuthServiceDefaultAuthService
  49. def serialized[E, R, L[E] <: IndexedSeq[E]](collection: L[E])(fn: (E) ⇒ Future[R])(implicit ec: ExecutionContext): Future[IndexedSeq[R]]

    Definition Classes
    Serialized
  50. def serializedT[E, R, L[E] <: IndexedSeq[E]](collection: L[E])(fn: (E) ⇒ Future[\/[Fail, R]])(implicit ec: ExecutionContext): Future[\/[Fail, IndexedSeq[R]]]

    Definition Classes
    Lifting
  51. val sessionRepository: SessionRepository

    Definition Classes
    AuthServiceDefaultAuthService
  52. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  53. def toString(): String

    Definition Classes
    AnyRef → Any
  54. def transactional[A](f: (Connection) ⇒ Future[A]): Future[A]

    Takes a function that returns a future, and runs it inside a database transaction.

    Takes a function that returns a future, and runs it inside a database transaction.

    Definition Classes
    Service
  55. def update(id: UUID, version: Long, email: Option[String], username: Option[String], givenname: Option[String], surname: Option[String]): Future[\/[Fail, User]]

    Update a user's identifiers.

    Update a user's identifiers.

    id

    the unique id of the user

    version

    the latest version of the user for O.O.L.

    email

    optionally update the e-mail

    username

    optionally update the username

    givenname

    the user's updated given name

    surname

    the user's updated family name

    returns

    a future disjunction containing the updated user, or a failure

    Definition Classes
    AuthServiceDefaultAuthService
  56. def updateIdentifier(id: UUID, version: Long, email: Option[String] = None, username: Option[String] = None): Future[\/[Fail, User]]

    Update a user's identifiers.

    Update a user's identifiers.

    id

    the unique id of the user

    version

    the latest version of the user for O.O.L.

    email

    optionally update the e-mail

    username

    optionally update the username

    returns

    a future disjunction containing the updated user, or a failure

    Definition Classes
    AuthServiceDefaultAuthService
  57. def updateInfo(id: UUID, version: Long, givenname: Option[String] = None, surname: Option[String] = None): Future[\/[Fail, User]]

    Update a user's "non-identifying" information.

    Update a user's "non-identifying" information.

    id

    the unique id of the user to be updated

    version

    the latest version of the user for O.O.L.

    givenname

    the user's updated given name

    surname

    the user's updated family name

    returns

    a future disjunction containing the updated user, or a failure

    Definition Classes
    AuthServiceDefaultAuthService
  58. def updatePassword(id: UUID, version: Long, password: String): Future[\/[Fail, User]]

    Update the user's password.

    Update the user's password.

    id

    the unique id of the user to be updated

    version

    the latest version of the user for O.O.L.

    password

    the new password

    returns

    a future disjunction containing the updated user, or a failure

    Definition Classes
    AuthServiceDefaultAuthService
  59. def updateRole(id: UUID, version: Long, name: String): Future[\/[Fail, Role]]

    Update a Role

    Update a Role

    id

    the unique id of the Role

    version

    the version of the Role for optimistic offline lock

    name

    the new name to assign this Role

    returns

    the newly updated Role

    Definition Classes
    AuthServiceDefaultAuthService
  60. def updateSession(sessionId: UUID, ipAddress: String, userAgent: String): Future[\/[Fail, Session]]

    Update an existing session.

    Update an existing session.

    sessionId
    ipAddress
    userAgent
    returns

    Definition Classes
    AuthServiceDefaultAuthService
  61. val userRepository: UserRepository

    Definition Classes
    AuthServiceDefaultAuthService
  62. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AuthService

Inherited from Service[Fail]

Inherited from Lifting[Fail]

Inherited from Serialized

Inherited from FutureMonad

Inherited from AnyRef

Inherited from Any

Ungrouped