Improved Login security

This commit is contained in:
delvh 2020-04-10 15:42:00 +02:00
parent cd33006aef
commit 373faae63b
2 changed files with 4 additions and 26 deletions

View File

@ -1,7 +1,5 @@
package envoy.event; package envoy.event;
import envoy.data.LoginCredentials;
/** /**
* Signifies to the client that the handshake failed for the attached * Signifies to the client that the handshake failed for the attached
* reason.<br> * reason.<br>
@ -16,33 +14,14 @@ import envoy.data.LoginCredentials;
public class HandshakeRejectionEvent extends Event<String> { public class HandshakeRejectionEvent extends Event<String> {
/** /**
* Select this value if a given password hash was incorrect * Select this value if a given password hash or user was incorrect.
*/ */
public static final String WRONG_PASSWORD = "an incorrect password was entered"; public static final String WRONG_PASSWORD_OR_USER = "password or user were entered incorrectly";
/** /**
* Select this value if a given {@link LoginCredentials} pointed at a client who * Select this value if the handshake could not be completed for some reason.
* is already online
*/ */
public static final String ALREADY_ONLINE = "user is already online"; public static final String INTERNAL_ERROR = "the process could not be finished as an internal error occurred";
/**
* Select this value if a given {@link LoginCredentials} pointed at a client who
* does not exist
*/
public static final String USER_DOES_NOT_EXIST = "user does not exist";
/**
* Select this value if a given {@link LoginCredentials} with
* {@link LoginCredentials#isRegistration()}==true points at an already existing
* user
*/
public static final String USER_EXISTS_ALREADY = "user can not be created as he already exists";
/**
* Select this value if an unknown error occurred
*/
public static final String UNKNOWN_REASON = "cause of failure is unknown";
private static final long serialVersionUID = 0L; private static final long serialVersionUID = 0L;

View File

@ -31,5 +31,4 @@ class UserTest {
var deserializedUser = SerializationUtils.read(serializedUser, User.class); var deserializedUser = SerializationUtils.read(serializedUser, User.class);
assertEquals(user.getContacts(), deserializedUser.getContacts()); assertEquals(user.getContacts(), deserializedUser.getContacts());
} }
} }