Class Redacted

java.lang.Object
me.ahoo.cosid.internal.Redacted

public final class Redacted extends Object
Store options as a toString shows them, without their secrets (R2-core-02): the value of a key whose canonical form names a password, token, secret or credential is ***, and a URL loses the password of its user info and its password= / pwd= parameters.
  • Method Details

    • options

      public static Map<String,Object> options(Map<String,?> options)
      The options without their secrets, in their order.
      Parameters:
      options - the options
      Returns:
      a new map
    • secret

      public static boolean secret(String key)
      Whether an option holds a secret.
      Parameters:
      key - the option key, in any spelling
      Returns:
      true for a password, token, secret or credential
    • url

      public static String url(String text)
      A text without the password of a URL in it.
      Parameters:
      text - the text
      Returns:
      //user:***@host, ?password=***