-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AYS-329 | Check Password Changing Validity Flow Has Been Created (#348)
- Loading branch information
1 parent
347900a
commit fadfd4f
Showing
16 changed files
with
497 additions
and
9 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
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
27 changes: 27 additions & 0 deletions
27
src/main/java/org/ays/auth/util/exception/AysUserPasswordCannotChangedException.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,27 @@ | ||
package org.ays.auth.util.exception; | ||
|
||
import org.ays.common.util.exception.AysAuthException; | ||
|
||
import java.io.Serial; | ||
|
||
/** | ||
* Exception thrown when a user password cannot be changed. | ||
*/ | ||
public final class AysUserPasswordCannotChangedException extends AysAuthException { | ||
|
||
/** | ||
* Unique serial version ID. | ||
*/ | ||
@Serial | ||
private static final long serialVersionUID = -2214328005741759939L; | ||
|
||
/** | ||
* Constructs a new {@link AysUserPasswordCannotChangedException} with the given password ID. | ||
* | ||
* @param passwordId the ID of the password that cannot be changed | ||
*/ | ||
public AysUserPasswordCannotChangedException(String passwordId) { | ||
super("user password cannot be changed! passwordId:" + passwordId); | ||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/org/ays/auth/util/exception/AysUserPasswordDoesNotExistException.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,27 @@ | ||
package org.ays.auth.util.exception; | ||
|
||
import org.ays.common.util.exception.AysAuthException; | ||
|
||
import java.io.Serial; | ||
|
||
/** | ||
* Exception thrown when a user password does not exist. | ||
*/ | ||
public final class AysUserPasswordDoesNotExistException extends AysAuthException { | ||
|
||
/** | ||
* Unique serial version ID. | ||
*/ | ||
@Serial | ||
private static final long serialVersionUID = -9023497278913148659L; | ||
|
||
/** | ||
* Constructs a new {@link AysUserPasswordDoesNotExistException} with the given password ID. | ||
* | ||
* @param passwordId the ID of the password that does not exist | ||
*/ | ||
public AysUserPasswordDoesNotExistException(String passwordId) { | ||
super("user password does not exist! passwordId:" + passwordId); | ||
} | ||
|
||
} |
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,26 @@ | ||
package org.ays.common.util; | ||
|
||
import lombok.experimental.UtilityClass; | ||
|
||
import java.util.UUID; | ||
|
||
@UtilityClass | ||
public class AysUUID { | ||
|
||
/** | ||
* Checks if the given string is a valid UUID (Universally Unique Identifier). | ||
* The method attempts to create a UUID object from the given string and returns true if successful, false otherwise. | ||
* | ||
* @param value the string to check | ||
* @return true if the string is a valid UUID, false otherwise | ||
*/ | ||
public static boolean isValid(String value) { | ||
try { | ||
UUID.fromString(value); | ||
return true; | ||
} catch (IllegalArgumentException e) { | ||
return false; | ||
} | ||
} | ||
|
||
} |
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.