diff src/common/constants.py @ 961:22fe06569b1a

server: moved logging worflow in separated method, so it can be used by Libervia Pages
author Goffi <goffi@goffi.org>
date Fri, 27 Oct 2017 18:35:23 +0200
parents 0c0551967bdf
children fd4eae654182
line wrap: on
line diff
--- a/src/common/constants.py	Fri Oct 27 18:31:42 2017 +0200
+++ b/src/common/constants.py	Fri Oct 27 18:35:23 2017 +0200
@@ -28,19 +28,25 @@
     APP_VERSION = u'0.7.0D'  # Please add 'D' at the end for dev versions
     LIBERVIA_MAIN_PAGE = "libervia.html"
 
-    # MISC
-    PASSWORD_MIN_LENGTH = 6  # for new account creation
+    # REGISTRATION
+    # XXX: for now libervia forces the creation to lower case
+    # XXX: Regex patterns must be compatible with both Python and JS
+    REG_LOGIN_RE = r'^[a-z0-9_-]+$'
+    REG_EMAIL_RE = r'^.+@.+\..+'
+    PASSWORD_MIN_LENGTH = 6
 
     # HTTP REQUEST RESULT VALUES
     PROFILE_AUTH_ERROR = 'PROFILE AUTH ERROR'
     XMPP_AUTH_ERROR = 'XMPP AUTH ERROR'
     ALREADY_WAITING = 'ALREADY WAITING'
     SESSION_ACTIVE = 'SESSION ACTIVE'
+    NOT_CONNECTED = 'NOT CONNECTED'
     PROFILE_LOGGED = 'LOGGED'
-    PROFILE_LOGGED_REGISTERED_WITH_EXT_JID = 'LOGGED (REGISTERED WITH EXTERNAL JID)'
+    PROFILE_LOGGED_EXT_JID = 'LOGGED (REGISTERED WITH EXTERNAL JID)'
     ALREADY_EXISTS = 'ALREADY EXISTS'
     REGISTRATION_SUCCEED = 'REGISTRATION'
     INTERNAL_ERROR = 'INTERNAL ERROR'
+    INVALID_INPUT = 'INVALID INPUT'
     BAD_REQUEST = 'BAD REQUEST'
     NO_REPLY = 'NO REPLY'
     NOT_ALLOWED = 'NOT ALLOWED'