Skip to content

Edit declaration of PasswordEncoder interface of Cryptography section #10910

@talerngpong

Description

@talerngpong

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;
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: ideal-for-contributionAn issue that we actively are looking for someone to help us withtype: bugA general bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions