-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from indigo-iam/fix/INDIAM-131
INDIAM-131: Email forgot endpoint is confused by some emails
- Loading branch information
Showing
51 changed files
with
923 additions
and
558 deletions.
There are no files selected for viewing
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
23 changes: 23 additions & 0 deletions
23
iam-login-service/src/main/java/it/infn/mw/iam/api/account/EmailDTO.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package it.infn.mw.iam.api.account; | ||
|
||
import javax.validation.constraints.NotNull; | ||
|
||
import org.hibernate.validator.constraints.Email; | ||
|
||
public class EmailDTO { | ||
|
||
@Email(message = "please specify a valid email address") | ||
@NotNull(message = "please specify an email address") | ||
private String email; | ||
|
||
public EmailDTO() {} | ||
|
||
public String getEmail() { | ||
return email; | ||
} | ||
|
||
public void setEmail(String email) { | ||
this.email = email; | ||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
iam-login-service/src/main/java/it/infn/mw/iam/api/account/InvalidEmailAddressError.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package it.infn.mw.iam.api.account; | ||
|
||
public class InvalidEmailAddressError extends RuntimeException { | ||
|
||
|
||
/** | ||
* | ||
*/ | ||
private static final long serialVersionUID = 1L; | ||
|
||
public InvalidEmailAddressError(String message) { | ||
super(message); | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
...ogin-service/src/main/java/it/infn/mw/iam/api/account/InvalidPasswordResetTokenError.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package it.infn.mw.iam.api.account; | ||
|
||
public class InvalidPasswordResetTokenError extends RuntimeException { | ||
|
||
/** | ||
* | ||
*/ | ||
private static final long serialVersionUID = 1L; | ||
|
||
public InvalidPasswordResetTokenError(String message) { | ||
super(message); | ||
} | ||
|
||
} |
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
33 changes: 30 additions & 3 deletions
33
iam-login-service/src/main/java/it/infn/mw/iam/api/account/PasswordResetService.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,11 +1,38 @@ | ||
package it.infn.mw.iam.api.account; | ||
|
||
/** | ||
* | ||
* The IAM password reset service | ||
* | ||
*/ | ||
public interface PasswordResetService { | ||
|
||
public Boolean checkResetKey(String resetKey); | ||
|
||
public void changePassword(String resetKey, String password); | ||
/** | ||
* Validates a password reset token. | ||
* | ||
* @param resetToken the password reset token to be validated | ||
* | ||
* @throws InvalidPasswordResetTokenError if the password reset token is not valid | ||
*/ | ||
public void validateResetToken(String resetToken); | ||
|
||
public void forgotPassword(String email); | ||
/** | ||
* Resets the password for an account, given a valid password reset token | ||
* | ||
* @param resetToken the password reset token | ||
* | ||
* @param password the password to be set | ||
* | ||
* @throws InvalidPasswordResetTokenError if the password reset token is not valid | ||
*/ | ||
public void resetPassword(String resetToken, String password); | ||
|
||
/** | ||
* Creates a password reset token for the account linked with the email passed as argument. | ||
* | ||
* @param email the email linked to the account for which the password must be reset | ||
*/ | ||
public void createPasswordResetToken(String email); | ||
|
||
} |
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
24 changes: 24 additions & 0 deletions
24
iam-login-service/src/main/java/it/infn/mw/iam/core/web/IamRootController.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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package it.infn.mw.iam.core.web; | ||
|
||
import javax.servlet.http.HttpServletRequest; | ||
|
||
import org.springframework.security.access.prepost.PreAuthorize; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.ui.ModelMap; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
@Controller | ||
public class IamRootController { | ||
|
||
@RequestMapping({"", "home", "index"}) | ||
public String home(HttpServletRequest request) { | ||
return "home"; | ||
} | ||
|
||
@PreAuthorize("hasRole('ROLE_USER')") | ||
@RequestMapping("manage/**") | ||
public String manage(ModelMap m) { | ||
return "manage"; | ||
} | ||
|
||
} |
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
Oops, something went wrong.