Record Class SignedInDevice

java.lang.Object
java.lang.Record
com.iizix.user.SignedInDevice
Record Components:
deviceID - The device: the device UUID of an iiziRun device, or the identifier the server issued to a Browser when it first remembered the user there.
appID - The application the device is remembered for.
deviceName - What the device said it is when it was last used, e.g. "Browser, Windows"; for display only, never trusted.
created - When the user was first remembered on the device, in epoch milliseconds.
lastUsed - When the device last signed in or was last remembered, in epoch milliseconds.
expires - When the device is forgotten unless it is used before, in epoch milliseconds.
staySignedIn - true when the device may sign the user in without the password, false when it is remembered for something else only (trusted for MFA).
mfaTrustedUntil - Until when the device is trusted for MFA, in epoch milliseconds; zero when it is not.
current - true for the device of the session that asked.

public record SignedInDevice(String deviceID, String appID, String deviceName, long created, long lastUsed, long expires, boolean staySignedIn, long mfaTrustedUntil, boolean current) extends Record
A device a user is remembered on: one row of the user's device tokens, as the SignIn module lists them for the user to look through and to revoke (CC-LOGIN-L5-DEVICE-TOKEN, SignIn L-5; F-18 of the SignIn survey). It carries nothing secret: the device's token is known to the device alone, and the server keeps only its hash.
Author:
Christopher Mindus
  • Constructor Details

    • SignedInDevice

      public SignedInDevice(String deviceID, String appID, String deviceName, long created, long lastUsed, long expires, boolean staySignedIn, long mfaTrustedUntil, boolean current)
      Creates an instance of a SignedInDevice record class.
      Parameters:
      deviceID - the value for the deviceID record component
      appID - the value for the appID record component
      deviceName - the value for the deviceName record component
      created - the value for the created record component
      lastUsed - the value for the lastUsed record component
      expires - the value for the expires record component
      staySignedIn - the value for the staySignedIn record component
      mfaTrustedUntil - the value for the mfaTrustedUntil record component
      current - the value for the current record component
  • Method Details

    • isMfaTrusted

      public boolean isMfaTrusted(long now)
      Tells whether the device is trusted for MFA at a time.
      Parameters:
      now - The time in epoch milliseconds.
      Returns:
      true when it is.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • deviceID

      public String deviceID()
      Returns the value of the deviceID record component.
      Returns:
      the value of the deviceID record component
    • appID

      public String appID()
      Returns the value of the appID record component.
      Returns:
      the value of the appID record component
    • deviceName

      public String deviceName()
      Returns the value of the deviceName record component.
      Returns:
      the value of the deviceName record component
    • created

      public long created()
      Returns the value of the created record component.
      Returns:
      the value of the created record component
    • lastUsed

      public long lastUsed()
      Returns the value of the lastUsed record component.
      Returns:
      the value of the lastUsed record component
    • expires

      public long expires()
      Returns the value of the expires record component.
      Returns:
      the value of the expires record component
    • staySignedIn

      public boolean staySignedIn()
      Returns the value of the staySignedIn record component.
      Returns:
      the value of the staySignedIn record component
    • mfaTrustedUntil

      public long mfaTrustedUntil()
      Returns the value of the mfaTrustedUntil record component.
      Returns:
      the value of the mfaTrustedUntil record component
    • current

      public boolean current()
      Returns the value of the current record component.
      Returns:
      the value of the current record component