Mercurial > libervia-backend
comparison src/core/constants.py @ 1030:15f43b54d697
core, memory, bridge: added profile password + password encryption:
/!\ This changeset updates the database version to 2 and modify the database content!
Description:
- new parameter General / Password to store the profile password
- profile password is initialized with XMPP password value, it is stored hashed
- bridge methods asyncCreateProfile/asyncConnect takes a new argument "password" (default = "")
- bridge method asyncConnect returns a boolean (True = connection already established, False = connection initiated)
- profile password is checked before initializing the XMPP connection
- new private individual parameter to store the personal encryption key of each profile
- personal key is randomly generated and encrypted with the profile password
- personal key is decrypted after profile authentification and stored in a Sessions instance
- personal key is used to encrypt/decrypt other passwords when they need to be retrieved/modified
- modifying the profile password re-encrypt the personal key
- Memory.setParam now returns a Deferred (the bridge method "setParam" is unchanged)
- Memory.asyncGetParamA eventually decrypts the password, Memory.getParamA would fail on a password parameter
TODO:
- if profile authentication is OK but XMPP authentication is KO, prompt the user for another XMPP password
- fix the method "registerNewAccount" (and move it to a plugin)
- remove bridge method "connect", sole "asyncConnect" should be used
author | souliane <souliane@mailoo.org> |
---|---|
date | Wed, 07 May 2014 16:02:23 +0200 |
parents | adbde4a3a52f |
children | b262ae6d53af |
comparison
equal
deleted
inserted
replaced
1029:f6182f6418ea | 1030:15f43b54d697 |
---|---|
38 | 38 |
39 ## Parameters ## | 39 ## Parameters ## |
40 NO_SECURITY_LIMIT = -1 | 40 NO_SECURITY_LIMIT = -1 |
41 INDIVIDUAL = "individual" | 41 INDIVIDUAL = "individual" |
42 GENERAL = "general" | 42 GENERAL = "general" |
43 # Parameters related to encryption | |
44 PROFILE_PASS_PATH = ('General', 'Password') | |
45 MEMORY_CRYPTO_NAMESPACE = 'crypto' # for the private persistent binary dict | |
46 MEMORY_CRYPTO_KEY = 'personal_key' | |
43 # Parameters for static blog pages | 47 # Parameters for static blog pages |
44 STATIC_BLOG_KEY = "Blog page" | 48 STATIC_BLOG_KEY = "Blog page" |
45 STATIC_BLOG_PARAM_TITLE = "Title" | 49 STATIC_BLOG_PARAM_TITLE = "Title" |
46 STATIC_BLOG_PARAM_BANNER = "Banner" | 50 STATIC_BLOG_PARAM_BANNER = "Banner" |
47 STATIC_BLOG_PARAM_KEYWORDS = "Keywords" | 51 STATIC_BLOG_PARAM_KEYWORDS = "Keywords" |