Interface Password

All Superinterfaces:
Normalisable<Password>, org.wiremock.stringparser.ParsedString, PercentEncoded<Password>

public interface Password extends PercentEncoded<Password>, org.wiremock.stringparser.ParsedString
Represents the password portion of user information in a URI authority.

The password is the part after the colon in user information (username:password). Passwords may contain percent-encoded characters.

Security Warning: Including passwords in URIs is strongly discouraged as they may be logged, cached, or exposed in various ways. This interface is provided for compatibility with legacy systems only.

Implementations must be immutable and thread-safe.

See Also:
  • Method Details

    • parse

      static Password parse(String password) throws IllegalPassword
      Parses a string into a password.
      Parameters:
      password - the string to parse
      Returns:
      the parsed password
      Throws:
      IllegalPassword - if the string is not a valid password
    • encode

      static Password encode(String unencoded)
      Encodes a string into a valid password with proper percent-encoding.
      Parameters:
      unencoded - the unencoded string
      Returns:
      the encoded password