Class PasswordField

java.lang.Object
com.inet.taskplanner.server.api.field.Field
com.inet.taskplanner.server.api.field.PasswordField

@JsonData public class PasswordField extends Field
A field that allows the definition of a password.
Since:
taskplanner 3.0
  • Constructor Details

    • PasswordField

      public PasswordField(String key, String label)
      Creates the field for setting a password
      Parameters:
      key - the key of the field
      label - the label to be displayed in front of the field
      Since:
      taskplanner 3.0
  • Method Details

    • passwordFieldAsTextArea

      public static PasswordField passwordFieldAsTextArea(String key, String label, String placeholderIfValueSet)
      Creates the field for setting a password - as textarea, which displays the value only when being created
      Parameters:
      key - the key of the field
      label - the label to be displayed in front of the field
      placeholderIfValueSet - a placeholder for the case that there is a value already set
      Returns:
      the password field model
      Since:
      taskplanner 21.0
    • encodePassword

      public static String encodePassword(String plainPassword) throws IOException
      Encodes the given plain password with an internal strong encryption
      Parameters:
      plainPassword - the password to be encrypted
      Returns:
      the encoded password
      Throws:
      IOException - if the encryption failed due to an error
      Since:
      taskplanner 3.0
    • decodePassword

      public static String decodePassword(String encodedPassword) throws IOException
      Decodes the given encrypted password and returns the plain string
      Parameters:
      encodedPassword - the encrypted password to be decoded
      Returns:
      the decoded password
      Throws:
      IOException - if the decryption failed due to an error
      Since:
      taskplanner 3.0