From 0bbf98db88ab153237d629a1099a309033665e24 Mon Sep 17 00:00:00 2001 From: delvh Date: Fri, 10 Apr 2020 15:42:00 +0200 Subject: [PATCH] Improved Login security --- .../envoy/event/HandshakeRejectionEvent.java | 29 +++---------------- src/test/java/envoy/data/UserTest.java | 1 - 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/src/main/java/envoy/event/HandshakeRejectionEvent.java b/src/main/java/envoy/event/HandshakeRejectionEvent.java index b6efb38..697eeac 100644 --- a/src/main/java/envoy/event/HandshakeRejectionEvent.java +++ b/src/main/java/envoy/event/HandshakeRejectionEvent.java @@ -1,7 +1,5 @@ package envoy.event; -import envoy.data.LoginCredentials; - /** * Signifies to the client that the handshake failed for the attached * reason.
@@ -16,33 +14,14 @@ import envoy.data.LoginCredentials; public class HandshakeRejectionEvent extends Event { /** - * 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 - * is already online + * Select this value if the handshake could not be completed for some reason. */ - public static final String ALREADY_ONLINE = "user is already online"; - - /** - * 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"; + public static final String INTERNAL_ERROR = "the process could not be finished as an internal error occurred"; private static final long serialVersionUID = 0L; diff --git a/src/test/java/envoy/data/UserTest.java b/src/test/java/envoy/data/UserTest.java index b04134d..4a1688b 100644 --- a/src/test/java/envoy/data/UserTest.java +++ b/src/test/java/envoy/data/UserTest.java @@ -31,5 +31,4 @@ class UserTest { var deserializedUser = SerializationUtils.read(serializedUser, User.class); assertEquals(user.getContacts(), deserializedUser.getContacts()); } - }