Describe the bug In Cryptography - Password Encoding page, a Java interface of PasswordEncoder comes with a different signature from an actual implementation in 5.7.x branch.

To Reproduce 1. Browse to Cryptography - Password Encoding page. 2. Browse to declaration of actual PasswordEncoder interface in the link above. 3. Visually compare PasswordEncoder interface between both source. 4. For encode method, it accepts String instead of CharSequence, for example.

Expected behavior 1. PasswordEncoder should have correct signatures of encode and matches methods. 2. PasswordEncoder should contain default method upgradeEncoding.

Sample

// current declaration in the document (https://docs.spring.io/spring-security/reference/features/integrations/cryptography.html#spring-security-crypto-passwordencoders)
public interface PasswordEncoder {

String encode(String rawPassword);

boolean matches(String rawPassword, String encodedPassword);
}

// expected behavior/declaration
public interface PasswordEncoder {
    String encode(CharSequence rawPassword);

    boolean matches(CharSequence rawPassword, String encodedPassword);

    default boolean upgradeEncoding(String encodedPassword) {
        return false;
    }
}

Comment From: jzheaux

Good catch, @talerngpong. Are you able to submit a PR that corrects the signature in the documentation?

Comment From: talerngpong

@jzheaux Yes. Here is my PR (#10922).