-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sandside): #198 implement password generator and checker for ano…
…nymous
- Loading branch information
Showing
7 changed files
with
64 additions
and
7 deletions.
There are no files selected for viewing
19 changes: 15 additions & 4 deletions
19
sandside/src/main/java/fr/ght1pc9kc/baywatch/security/api/PasswordService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,28 @@ | ||
package fr.ght1pc9kc.baywatch.security.api; | ||
|
||
import fr.ght1pc9kc.baywatch.security.api.model.PasswordEvaluation; | ||
import fr.ght1pc9kc.baywatch.security.api.model.User; | ||
import reactor.core.publisher.Flux; | ||
import reactor.core.publisher.Mono; | ||
|
||
public interface PasswordService { | ||
/** | ||
* Check the password strength and return an evaluation | ||
* <p>Check the password strength and return an evaluation</p> | ||
* <p>The current authenticated user is used to populate the password evaluation context</p> | ||
* | ||
* @param password The new password | ||
* @return {@code Void} when the password is changed | ||
* @throws IllegalArgumentException When password strength is not enough | ||
* @return A password evaluation | ||
* @throws fr.ght1pc9kc.baywatch.common.api.exceptions.UnauthorizedException When no user was authenticated | ||
*/ | ||
Mono<PasswordEvaluation> checkPasswordStrength(String password); | ||
|
||
Mono<String> generateSecurePassword(); | ||
/** | ||
* Check the password strength and return a {@link PasswordEvaluation} | ||
* | ||
* @param user The user owner of the password as the context | ||
* @return A password evaluation | ||
*/ | ||
Mono<PasswordEvaluation> checkPasswordStrength(User user); | ||
|
||
Flux<String> generateSecurePassword(int number); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters