Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit declaration of PasswordEncoder interface of Cryptography section #10910

Closed
talerngpong opened this issue Feb 25, 2022 · 2 comments
Closed
Labels
status: ideal-for-contribution An issue that we actively are looking for someone to help us with type: bug A general bug
Milestone

Comments

@talerngpong
Copy link
Contributor

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;
	}
}
@talerngpong talerngpong added status: waiting-for-triage An issue we've not yet triaged type: bug A general bug labels Feb 25, 2022
@jzheaux
Copy link
Contributor

jzheaux commented Feb 28, 2022

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

@jzheaux jzheaux added status: ideal-for-contribution An issue that we actively are looking for someone to help us with and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 28, 2022
@jzheaux jzheaux added this to the 5.7.0-M3 milestone Feb 28, 2022
@talerngpong
Copy link
Contributor Author

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

@jzheaux jzheaux closed this as completed in acda921 Mar 1, 2022
jzheaux pushed a commit that referenced this issue Mar 1, 2022
jzheaux pushed a commit that referenced this issue Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ideal-for-contribution An issue that we actively are looking for someone to help us with type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants