Class LocalActor

java.lang.Object
de.gustavblass.fsu.fmi.roombooking.model.actor.Actor
de.gustavblass.fsu.fmi.roombooking.model.actor.LocalActor
All Implemented Interfaces:
Identified, Serializable, Comparable<Actor>, org.springframework.security.core.CredentialsContainer, org.springframework.security.core.userdetails.UserDetails

@Entity public class LocalActor extends Actor
Represents an Actor whose credentials are stored locally in the database.
See Also:
  • Field Details

    • CODE

      @NonNull public static final @NonNull String CODE
      Identifies the local Actors.
      See Also:
    • password

      @Nullable private @Nullable String password
      Secret login credential chosen by the user and only known to them. Must be hashed before being stored in the database!
      Implementation Note:
      This column is annotated as unique in order to ensure that an attacker cannot notice that two users share the same password. While this application will never generate the same hash twice (thanks to unique salts), an IT administrator might accidentally make a manual modification to the database and copy over a hash.
  • Constructor Details

    • LocalActor

      public LocalActor()
  • Method Details

    • getTypeCode

      @Contract(pure=true) @NonNull public @NonNull String getTypeCode()
      Specified by:
      getTypeCode in class Actor
      Returns:
      The CODE.
    • password

      @Contract(pure=true) @NonNull public @NonNull Optional<String> password()
      Description copied from class: Actor
      A null-safe alternative to Actor.getPassword().
      Specified by:
      password in class Actor
      Returns:
      The password, if present.
    • getPassword

      @Contract(pure=true) @Nullable public @Nullable String getPassword()
      Warning! This method is only meant for the Spring framework! Use password() instead!
      Specified by:
      getPassword in interface org.springframework.security.core.userdetails.UserDetails
      Specified by:
      getPassword in class Actor
    • eraseCredentials

      public void eraseCredentials()
      Sets the password to null in order to delete it from memory for security reasons.